Getting Started with Adobe After Effects - Part 6: Motion Blur


Upload Image Close it
Select File

Browse by Tags · View All
sql_server 217
t-sql 211
tsql 116
sqlserver 96
BRH 78
#SQLServer 66
#TSQL 56
SQL Server 34
function 11
SSMS 9

Archive · View All
August 2007 17
August 2010 8
June 2012 7
June 2011 7
November 2007 7
August 2012 6
May 2012 6
November 2011 6
August 2011 6
October 2011 6

Madhivanan's TSQL Blog

Always execute a procedure using the keyword EXEC or EXECUTE

Jun 13 2011 2:34AM by Madhivanan   

Though it is optional to execute a stored procedure without using EXEC or EXECUTE, it is needed when you use GO(or any other batch seperator) as the stored procedure name.

Create this procedure

create procedure GO 
as 
select 1 as number

Execute the procedure by

GO

It will not execute becuase GO is treated as a batch seperator

Now execute it by

EXEC GO

So It is always a better practice to use EXEC or EXECUTE to execute a stored procedure

Tags: t-sql, sql_server, GO, sqlserver, tsql, BRH, fun,


Madhivanan
3 · 40% · 12899
0
Liked
 
0
Lifesaver
 
0
Refreshed
 
0
Learned
 
0
Incorrect



Submit

4  Comments  

  • To execute a stored procedure, use the Transact-SQL EXECUTE statement. Alternatively, you can execute a stored procedure without using the EXECUTE keyword if the stored procedure is the first statement in the batch.

    it is always good practice to use exec or execute

    Reference MSDN

    Manoj

    commented on Jul 5 2011 3:19AM
    Manoj Bhadiyadra
    146 · 1% · 335
  • It is an even better practice not to name a stored procedure after a reserver or key word in SQL

    commented on Jul 5 2011 9:00PM
    benstaylor
    431 · 0% · 92
  • (from BoL) GO is not a Transact-SQL statement; it is a command recognized by the sqlcmd and osql utilities and SQL Server Management Studio Code editor. SQL Server utilities interpret GO as a signal that they should send the current batch of Transact-SQL statements to an instance of SQL Server.

    Not only is "GO" not a reserved or key word in SQL, but the SQL Server Management Studio can be configured to use any sequence of characters as the batch separator. In SSMS, on the "Query" menu, under "Query Options..." you can enter any string you like as the batch separator. It is source of some amusement to change a colleague's batch separator to "SELECT", which causes some most unusual error messages... ;)

    commented on Jul 8 2011 3:49AM
    paul.ramster
    565 · 0% · 66

Your Comment


Sign Up or Login to post a comment.

    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]