What is the difference between ; and GO in stored procedure in SQL Server?
sql-server, stored-procedures
Solution
`;` just ends the statement.
GO is not a statement but a command to the server to commit the current batch to the Database. It creates a stop inside the transaction.
http://msdn.microsoft.com/en-us/library/ms188037.aspx
(Update, thanks for the comments): GO is a statement intended for the Management studio as far as I know, maybe to other tools as well.
Problem
What is the difference between `;` and `GO` in stored procedure in SQL Server ? Actually, if I have a stored procedure in SQL server and wanna to put t separate queries inside it which the first one just calculates number of records (count) and the second one selects some records based on some conditions, then what should I use between that two queries? `Go` or `;`