Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12»»

go command Expand / Collapse
Author
Message
Posted Monday, October 25, 2010 11:17 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, October 26, 2010 8:07 AM
Points: 6, Visits: 5
DELETE FROM emp
WHERE job = 'clerk';
go

i m getting som erros.i read alomst 10 to 15 of articles on go command still i m not able to get it.i m trying all the possible stuffs with it.but all the time i get some error.
help me out pls

thanks in advance

jay thakkar,student,india
Post #1010201
Posted Monday, October 25, 2010 12:12 PM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Yesterday @ 3:52 PM
Points: 42,849, Visits: 35,978
It's simply a batch delimiter. It tells the client tool where to break apart batches to send to SQL. It is not actually a SQL command.


Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1010249
Posted Monday, October 25, 2010 12:15 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 11:36 PM
Points: 7,161, Visits: 13,235
What are the error messages you get? The query itself looks fine...

There can be anything like permission issues, mis-spelled table or column name, data type conflict, foreign key references - just to name a few.




Lutz
A pessimist is an optimist with experience.

How to get fast answers to your question
How to post performance related questions
Links for Tally Table , Cross Tabs and Dynamic Cross Tabs , Delimited Split Function
Post #1010253
Posted Monday, October 25, 2010 12:17 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, October 26, 2010 8:07 AM
Points: 6, Visits: 5
i kno "go" isnt a part of t-sql.
but the statement i wrote shld get executed.
it isnt.why??
if i remove "go" it works fine
why???
Post #1010257
Posted Monday, October 25, 2010 12:19 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, October 26, 2010 8:07 AM
Points: 6, Visits: 5
go only works in ssms is that true??
if i execute the same query in query editor of ssms it works fine.
Post #1010259
Posted Monday, October 25, 2010 12:24 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Tuesday, May 1, 2012 1:35 AM
Points: 70, Visits: 67
you have to use either ";" or "GO"
but not both of them.
both are batch separator
Post #1010266
Posted Monday, October 25, 2010 12:28 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, October 26, 2010 8:07 AM
Points: 6, Visits: 5
; --> statement delemeter or terminator

GO --> batch terminator.

i read somewhere.
Post #1010273
Posted Monday, October 25, 2010 12:37 PM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Yesterday @ 3:52 PM
Points: 42,849, Visits: 35,978
sanjays-735734 (10/25/2010)
you have to use either ";" or "GO"
but not both of them.
both are batch separator


That is not true.

The ; is a statement delimiter. It shows where the end of the statement is. GO breaks apart batches.

Easy to demonstrate. The first example works, the second does not.

DECLARE @i int;
SET @i = 1;
SELECT @i;

DECLARE @i int
GO
SET @i = 1
GO
SELECT @i
GO




Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1010280
Posted Monday, October 25, 2010 12:38 PM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Yesterday @ 3:52 PM
Points: 42,849, Visits: 35,978
jay.supersaiyan (10/25/2010)
i kno "go" isnt a part of t-sql.
but the statement i wrote shld get executed.
it isnt.why??
if i remove "go" it works fine
why???


No idea. It looks fine.

What's the error you're getting? Is that the entire script?



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1010282
Posted Monday, October 25, 2010 12:41 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, October 26, 2010 8:07 AM
Points: 6, Visits: 5
now its working fine i guess.i read some where that go command will only work in query editor of ssms.

so statements

use employeedb;
go
select * from emp;
go

are working fine till now.

jay thakkar,student,india
Post #1010285
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse