Click here to Skip to main content
15,915,975 members
Home / Discussions / Database
   

Database

 
GeneralRe: Resetting 'Identity Specification' column in Sql Table Pin
unclejimbob6-Jan-12 14:21
unclejimbob6-Jan-12 14:21 
GeneralRe: Resetting 'Identity Specification' column in Sql Table Pin
Mycroft Holmes6-Jan-12 20:26
professionalMycroft Holmes6-Jan-12 20:26 
GeneralRe: Resetting 'Identity Specification' column in Sql Table Pin
unclejimbob6-Jan-12 21:16
unclejimbob6-Jan-12 21:16 
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 
Hi all

I have encountered a stored procedure template that we are supposed to use for our daily development work. The strange thing about this template (to me, at least) is that it has a RETURN statement just before the final END statement. Obviously if the proc is returning a value, this statement is necessary, but we are talking about a stored proc that returns no value. I do not understand why this convention exists, much less why someone would care to enforce it. It looks like it clutters the readability of the stored proc by appending code that does nothing. I don't recall seeing any C code like this: "void fx(void) { return; }", at least not on purpose.

But I figure that this convention must have come from somewhere, and maybe at some point there were a perfectly valid and good reason for it.

So my question is this: What good reason is there (if any) to have a RETURN; statement just prior to the final END statement in a stored proc that does not return a value?

Here is an example:
SQL
CREATE PROC fx
AS
BEGIN
    RETURN; -- Why is this here just before the END?
END
go

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 
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 

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.