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 12345»»»

EXECUTE Expand / Collapse
Author
Message
Posted Monday, February 13, 2012 8:59 PM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 5:47 AM
Points: 1,904, Visits: 2,827
Comments posted to this topic are about the item EXECUTE

----------------------------------------------
Msg 8134, Level 16, State 1, Line 1
Divide by zero error encountered.
Post #1251642
Posted Monday, February 13, 2012 9:00 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 12:42 PM
Points: 5,571, Visits: 24,779
Nice back to basics question -- no gimmicks .... nice very nice


If everything seems to be going well, you have obviously overlooked something.

Ron

Please help us, help you -before posting a question please read

Before posting a performance problem please read
Post #1251643
Posted Monday, February 13, 2012 9:50 PM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Today @ 6:54 AM
Points: 1,032, Visits: 1,295
Nice question. Thanks

Thanks
Post #1251657
Posted Tuesday, February 14, 2012 12:13 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 1:28 PM
Points: 13,280, Visits: 10,155
Great question, thanks Henrico.
I stumbled across this issue a few times too many, so a real easy one for me




How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1251691
Posted Tuesday, February 14, 2012 12:41 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Monday, March 17, 2014 7:18 AM
Points: 2,439, Visits: 6,426
Koen Verbeeck (2/14/2012)
Great question, thanks Henrico.
I stumbled across this issue a few times too many, so a real easy one for me

You're not alone, Koen


--------------------------------------------------------------------------
A little knowledge is a dangerous thing (Alexander Pope)

In order for us to help you as efficiently as possible, please read this before posting (courtesy of Jeff Moden)
Post #1251693
Posted Tuesday, February 14, 2012 1:14 AM
Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Friday, July 25, 2014 2:19 AM
Points: 759, Visits: 833
Good question - i got it right.

But surely without running the code there would be no output :0)

(Above is tongue in cheek)
Post #1251696
Posted Tuesday, February 14, 2012 1:16 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 1:28 PM
Points: 13,280, Visits: 10,155
danielfountain (2/14/2012)

But surely without running the code there would be no output :0)


Indeed!
I'm missing the answer "after waiting for a few hours you eventually decide to go home..."




How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1251699
Posted Tuesday, February 14, 2012 1:46 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Friday, May 9, 2014 6:09 AM
Points: 302, Visits: 177
I would have expected it to fail due to no newline or semicolon.
But it were not so
Anywhere I can find specific rules about when to use and when not to use semicolon?
Except the reserved word ";with" of course.
Post #1251713
Posted Tuesday, February 14, 2012 2:05 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 1:28 PM
Points: 13,280, Visits: 10,155
kll 51891 (2/14/2012)
I would have expected it to fail due to no newline or semicolon.
But it were not so
Anywhere I can find specific rules about when to use and when not to use semicolon?
Except the reserved word ";with" of course.


The semicolon is not yet obligated, except when using the WITH clause. This probably will change in a future version.
If there's a statement before the WITH clause, it should be terminated with a semicolon. Pay attention, this is not the same as saying that it should be ";WITH". If everyone starts terminating statements with semicolon in old code to make the code portable to a newer edition of SQL Server, all ;WITH statements will fail.




How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1251718
Posted Tuesday, February 14, 2012 2:13 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Friday, May 9, 2014 6:09 AM
Points: 302, Visits: 177
Koen Verbeeck (2/14/2012)
kll 51891 (2/14/2012)
I would have expected it to fail due to no newline or semicolon.<snip>


The semicolon is not yet obligated, except when using the WITH clause. This probably will change in a future version.
If there's a statement before the WITH clause, it should be terminated with a semicolon. Pay attention, this is not the same as saying that it should be ";WITH". If everyone starts terminating statements with semicolon in old code to make the code portable to a newer edition of SQL Server, all ;WITH statements will fail.


Thank you for the clarification.

A quick test:
use master
select top 10 * from sys.all_columns
select top 10 * from sys.all_objects
select top 10 * from sys.all_columns select top 10 * from sys.all_objects
select top 10 * from sys.all_columns ;; select top 10 * from sys.all_objects

reveals that you are correct in the missing semicolons are OK. But it doesn't show why an abundance of semicolons should have detrimental effects.

My quoting of ";with" were somewhat tongue-in-cheek as it is the first keyword that I am aware of that doesn't accept a newline as a break in command.
Anyway, looking objectively at stuff, then the fact that I can write
Select *
From xx
Where something is right

should warn me that semicolons were problably superflous.
Post #1251721
« Prev Topic | Next Topic »

Add to briefcase 12345»»»

Permissions Expand / Collapse