Click here to Skip to main content
15,900,378 members
Home / Discussions / Database
   

Database

 
GeneralRe: Resetting 'Identity Specification' column in Sql Table Pin
Mycroft Holmes7-Jan-12 13:24
professionalMycroft Holmes7-Jan-12 13:24 
GeneralRe: Resetting 'Identity Specification' column in Sql Table Pin
unclejimbob7-Jan-12 17:33
unclejimbob7-Jan-12 17:33 
GeneralRe: Resetting 'Identity Specification' column in Sql Table Pin
Mycroft Holmes7-Jan-12 19:52
professionalMycroft Holmes7-Jan-12 19:52 
GeneralRe: Resetting 'Identity Specification' column in Sql Table Pin
jschell9-Jan-12 10:10
jschell9-Jan-12 10:10 
QuestionRETURN; before END Pin
Waldemar Sauer4-Jan-12 6:05
Waldemar Sauer4-Jan-12 6:05 
AnswerRe: RETURN; before END Pin
jschell4-Jan-12 8:24
jschell4-Jan-12 8:24 
AnswerRe: RETURN; before END Pin
Eddy Vluggen4-Jan-12 11:46
professionalEddy Vluggen4-Jan-12 11:46 
AnswerRe: RETURN; before END Pin
PIEBALDconsult4-Jan-12 13:18
mvePIEBALDconsult4-Jan-12 13:18 
AnswerRe: RETURN; before END Pin
Luc Pattyn4-Jan-12 14:10
sitebuilderLuc Pattyn4-Jan-12 14:10 
QuestionUsing Change Data Capture to Replicate data Pin
Pascal Ganaye4-Jan-12 0:12
Pascal Ganaye4-Jan-12 0:12 
AnswerRe: Using Change Data Capture to Replicate data Pin
Mycroft Holmes4-Jan-12 12:14
professionalMycroft Holmes4-Jan-12 12:14 
AnswerRe: Using Change Data Capture to Replicate data Pin
eusimonica8-Jan-12 23:32
eusimonica8-Jan-12 23:32 
AnswerRe: Using Change Data Capture to Replicate data Pin
shreekar11-Jan-12 7:44
shreekar11-Jan-12 7:44 
QuestionAutomate job schedule Pin
Neelesh_Rmsi2-Jan-12 23:10
Neelesh_Rmsi2-Jan-12 23:10 
AnswerRe: Automate job schedule Pin
SilimSayo3-Jan-12 10:58
SilimSayo3-Jan-12 10:58 
AnswerRe: Automate job schedule Pin
SilimSayo6-Jan-12 13:58
SilimSayo6-Jan-12 13:58 
QuestionOptimizing TSQL Stored Procedure Code, need a better alternative for performance. Pin
Nadia Monalisa1-Jan-12 14:46
Nadia Monalisa1-Jan-12 14:46 
Hello,

I just started learning TSQL Stored procedure (SQL Server 2005) and looks like it does not have strong set of functions that I could do in programming languages. Anyway, I wanted to return a string type data which holds comma separated value read from a temporary table. After spending hours, I came to the following code that WORKS. But I am wondering there should be more efficient way to do that. My following code runs at least 2 query to the temp table in each iteration to build the string where one of the query uses Nested SQL statement which can be more expensive in performance. So, Would anyone please tell me is there any better way to do that ? I thought there would be SKIP operation but SKIP operator is not being accepted by my SQL Server. IF there was any SKIP operator, at least I could save a nested query. Anyway, your help would be highly appreciated.

Regards.

SQL
DECLARE @Iterator INT
 SET @Iterator = 0

WHILE (@Iterator < @totalIds)
BEGIN

    IF(@Iterator = 0)
     BEGIN
              SELECT TOP 1 @DeletedIDArr = CAST(Id AS varchar(50)) FROM #deletedIds
     END
    ELSE
     BEGIN
             SELECT TOP 1 @DeletedIDArr = (@DeletedIDArr + ',' + CAST(Id AS varchar(50)))
             FROM #deletedIds
             WHERE Id NOT IN(SELECT TOP (@Iterator) Id FROM #deletedIds);
     END
    SET @Iterator = @Iterator + 1
END

AnswerRe: Optimizing TSQL Stored Procedure Code, need a better alternative for performance. Pin
Luc Pattyn1-Jan-12 15:31
sitebuilderLuc Pattyn1-Jan-12 15:31 
GeneralRe: Optimizing TSQL Stored Procedure Code, need a better alternative for performance. Pin
Nadia Monalisa1-Jan-12 16:16
Nadia Monalisa1-Jan-12 16:16 
AnswerRe: Optimizing TSQL Stored Procedure Code, need a better alternative for performance. Pin
Luc Pattyn1-Jan-12 16:57
sitebuilderLuc Pattyn1-Jan-12 16:57 
AnswerRe: Optimizing TSQL Stored Procedure Code, need a better alternative for performance. Pin
PIEBALDconsult1-Jan-12 16:07
mvePIEBALDconsult1-Jan-12 16:07 
GeneralRe: Optimizing TSQL Stored Procedure Code, need a better alternative for performance. Pin
Nadia Monalisa1-Jan-12 21:29
Nadia Monalisa1-Jan-12 21:29 
AnswerRe: Optimizing TSQL Stored Procedure Code, need a better alternative for performance. Pin
Shameel1-Jan-12 18:40
professionalShameel1-Jan-12 18:40 
GeneralRe: Optimizing TSQL Stored Procedure Code, need a better alternative for performance. Pin
Nadia Monalisa1-Jan-12 21:30
Nadia Monalisa1-Jan-12 21:30 
AnswerRe: Optimizing TSQL Stored Procedure Code, need a better alternative for performance. Pin
unclejimbob5-Jan-12 11:52
unclejimbob5-Jan-12 11:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.