SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Where should I place ; ?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

shapper
Constraint Violating Yak Guru

450 Posts

Posted - 02/06/2007 :  10:41:14  Show Profile  Reply with Quote
Hello,

When I read SQL code I often see a code line ending with ;.
However, it is very common to not use ;.

For example:
SELECT Name
FROM dbo.Users
WHERE Country = @Country;

Or:
SELECT Name
FROM dbo.Users
WHERE Country = @Country

Thanks,
Miguel

harsh_athalye
Flowing Fount of Yak Knowledge

India
5581 Posts

Posted - 02/06/2007 :  11:23:56  Show Profile  Visit harsh_athalye's Homepage  Click to see harsh_athalye's MSN Messenger address  Send harsh_athalye a Yahoo! Message  Reply with Quote
Generally, this comes from the ORACLE style of syntax. SQL Server doesn't require you to end statement with semicolon.

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

nr
SQLTeam MVY

United Kingdom
12543 Posts

Posted - 02/06/2007 :  12:11:44  Show Profile  Visit nr's Homepage  Reply with Quote
>> SQL Server doesn't require you to end statement with semicolon.
Unless you use a CTE.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000