Multiple commands on one line in SQL Server 2005
use master; sp_spaceused mytable;
should suffice. GO
simply signals the end of a batch of Transact-SQL statements to the SQL Server utilities.
You don't need GO
. Just use ;
The answers provided thus far are incorrect. It does not work to combine lines with a semi-colon if the lines must be in a separate batch. Try this one:
DECLARE @x int; DECLARE @x int;