Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Where should I place ; ?

Author  Topic 

shapper
Constraint Violating Yak Guru

450 Posts

Posted - 2007-02-06 : 10:41:14
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
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-02-06 : 11:23:56
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

12543 Posts

Posted - 2007-02-06 : 12:11:44
>> 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
   

- Advertisement -