Recently I have came across very good question on SQLServerCentral.com
Different T-SQL constructs can assign a value to a regular identifier with a leading '@' without using SET nor SELECT :
- An Input argument to a Procedure or Function - http://msdn.microsoft.com/en-us/library/ms187926
- An Output argument to a Procedure - http://msdn.microsoft.com/en-us/library/ms187926
- EXECUTE a Function: EXEC @return = udfFunct() - http://msdn.microsoft.com/en-us/library/ms188332
- The Stored Procedure return status: EXEC @status = uspProc (This is very different from a Function return.) - http://msdn.microsoft.com/en-us/library/ms188332
- The OUTPUT clause: OUTPUT INTO @tablevar (Could count this 4 times but it is really one construct) http://msdn.microsoft.com/en-us/library/ms177564
- RECEIVE .... FROM
INTO @tablevar - http://msdn.microsoft.com/en-us/library/ms186963.aspx - FETCH NEXT FROM cursor INTO @varname - http://msdn.microsoft.com/en-us/library/ms180152
- DECLARE @varname INT = 0; - http://msdn.microsoft.com/en-us/library/ms188927
source discussion: http://www.sqlservercentral.com/Forums/Topic1346324-326-1.aspx
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.