dbTalk Databases Forums  

Syntax check

microsoft.public.sqlserver.server microsoft.public.sqlserver.server


Discuss Syntax check in the microsoft.public.sqlserver.server forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Eric
 
Posts: n/a

Default Syntax check - 10-08-2009 , 09:36 AM






Hi,

If I put a bunch of commands (insert into..., update table... x 10, drop
table.....) wil the server then first check the whole syntax before it
excecutes or will it just start and hold on error?

It's not like I'm gonna send wrong code, but in case during transmission to
the server the data gets corrupted.

rg,
Eric

Reply With Quote
  #2  
Old   
Plamen Ratchev
 
Posts: n/a

Default Re: Syntax check - 10-08-2009 , 09:42 AM






In SSMS there is a Parse icon (or from the Query menu -> Parse, or Ctrl+F5) which will only parse and check the SQL.

--
Plamen Ratchev
http://www.SQLStudio.com

Reply With Quote
  #3  
Old   
Ray Marron
 
Posts: n/a

Default Re: Syntax check - 10-08-2009 , 09:43 AM



Eric wrote:
Quote:
Hi,

If I put a bunch of commands (insert into..., update table... x 10, drop
table.....) wil the server then first check the whole syntax before it
excecutes or will it just start and hold on error?

It's not like I'm gonna send wrong code, but in case during transmission to
the server the data gets corrupted.
I imagine it would just go top-down. Is that a transaction I smell?

--
Ray Marron

Reply With Quote
  #4  
Old   
nzrdb6
 
Posts: n/a

Default Re: Syntax check - 10-08-2009 , 09:45 AM



On Oct 8, 3:36*pm, Eric <E... (AT) discussions (DOT) microsoft.com> wrote:
Quote:
Hi,

If I put a bunch of commands (insert into..., update table... x 10, drop
table.....) wil the server then first check the whole syntax before it
excecutes or will it just start and hold on error?

It's not like I'm gonna send wrong code, but in case during transmission to
the server the data gets corrupted.

rg,
Eric
Check the whole script compiles using the "blue tickmark" button
before you exec

Reply With Quote
  #5  
Old   
Linchi Shea
 
Posts: n/a

Default RE: Syntax check - 10-08-2009 , 09:46 AM



For each batch, it'll check the syntax first and then execute the batch. A
syntax error in one batch does not prevent SQL Server from executing the next
batch.

Linchi

"Eric" wrote:

Quote:
Hi,

If I put a bunch of commands (insert into..., update table... x 10, drop
table.....) wil the server then first check the whole syntax before it
excecutes or will it just start and hold on error?

It's not like I'm gonna send wrong code, but in case during transmission to
the server the data gets corrupted.

rg,
Eric

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.