Stored Procedures VS Indexed Views - Performance?
Hey folks,In the past, one of the factors I'd consider when choosing to use a Stored Procedure over a View was the fact that the Stored Procedure would get optimized by storing the query execution path...
View Articlewhat happens inside ...... when fired Index Reorganize
Hi all,what happens inside ...... when fired Index Reorganize Thanksvijay
View ArticleInclude table to aggregated update statement
I want to include receipt_link_id table to the below statement how can I achieve it???UPDATE#arr SET rec_id =(SELECT max(dbo.recpt_status.recpt_id)AS aggr$1FROM dbo.recpt_status WHERE...
View ArticleHow to create a function to output Any recordset into JSON format?
I want to create a T-SQL function,to output "ANY" recordset into JSON format.That means,this function needs two parameters,the first is the recordset and the second is output json parametername.For...
View ArticleHelp needed on Equi join?
I have 3 views and in that common column datatype is varchar. I have to use equi join to get the data from 3 view.In 3 views total records are 23668,111,3033when i wrote the join i am getting the...
View ArticleInconsistent Resultset from the Stored procedure
Hi All, I am getting inconsistent resultset when i run the Stored Procedure. Can anyone please suggest how to fix this issue.Regards,Puneeth
View Articlestoring pdf file in sql database
currently i am working on my last semester project.I am using visual studio 2010 to design front end and sql server 2008 for database. I that case i want to store the pdf file in sql server 2008...
View Articleadd approve data column in sp
i want to add approve date from approval table i tried but it not worksspALTER procedure [dbo].[spdocuments] as SELECT dbo.DocumentInfo.DocID as DocumentID, dbo.DocumentInfo.DocName as DocumentName,...
View ArticleFormat number with comma and 1 decimal point
How can I format a number like this 1,234.5 even if the number is 1,234.50 or 1,234.56 ?
View ArticleHow to run trigger for each affected row in delete query
Hello every body, can anyone help me ?I will describe my problem. First, i have 2 table name tbStock andtbSalesDetail. Column in tbStock and tbSalesDetail is like this :CREATE TABLE tbStock ( idStock...
View ArticleIs 'YYYY-MM-DD' not valid for SQL Server?
'YYYYMMDD' and 'YYYY-MM-DD' are valid ANSI date strings.BOL: "date YYYY-MM-DD 0001-01-01 through 9999-12-311 day3NoNo"LINK: http://technet.microsoft.com/en-us/library/ms186724.aspxI...
View ArticleHow to use IF-ElSE in 'WITH' clause
Hi, I wonder if i can use IF-ELSE in 'With' clause; as follows;WITH TEST AS( --my select statement ) IF parameter >0 BEGIN --select statement on TEST with...
View Articlelocking
I am inserting 5000 rows from working table to main table?will the sql server lock my main table row by row and or page level or table level?how do i know what factor determine what level locking does...
View ArticlePivot issues
Happy holidays!I am having issues using PIVOT. I have never seemed to truly understand the syntax behind it and I know this is a simple question.... I have a simple table that has 3 columns: DayofWeek...
View ArticleSQL PIVOT with Matrix
Hi - I would like to create a SSRS Matrix report. I have some SQL (see below) and understand I may need to update it using TSQL Pivot to allow me to create a SSRS matrix that would give me the...
View Articletunning simple query with full-text
I would like tuning my query with full-text searching. I have two tables: 1. artaolInventTable a) IT_NAMEIDIDX (Unique, Non-clustered) - itemId - itemName (include column b) IT_IMPORTIDX...
View ArticleSQL Timeouts
I am on SQL server 2008 R2. I have a monthly process that inserts and updates 50,000 records.The process make take 4 minutes or it may time out. If I delete the data and rerun the process it runs in 30...
View Articleselected aggregate values from stored procedure always zero
I am trying to create a report in an ASP VB .Net application. My stored procedure tallies results from a survey which our website members fill out. It returns multiple result sets. The first is a...
View Article