|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Tuesday, May 14, 2013 2:24 AM
Points: 1,871,
Visits: 2,692
|
|
One question though if you execute you should get error below,
Msg 134, Level 15, State 1, Line 9 The variable name '@sqlstring' has already been declared. Variable names must be unique within a query batch or stored procedure.
actually not. 2 statements, not a single batch query.
---------------------------------------------- Msg 8134, Level 16, State 1, Line 1 Divide by zero error encountered.
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Friday, May 17, 2013 2:28 PM
Points: 857,
Visits: 474
|
|
|
|
|
|
SSChasing Mays
      
Group: General Forum Members
Last Login: Yesterday @ 3:53 PM
Points: 648,
Visits: 1,303
|
|
While we're being pedantic...
I would have thought the answer depends on your permissions. If you can't run dbcc showfilestats then both will fail.

One of the symptoms of an approaching nervous breakdown is the belief that one's work is terribly important. Bertrand Russell
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Yesterday @ 3:07 PM
Points: 7,096,
Visits: 7,156
|
|
Henrico Bekker (2/16/2012) actually not. 2 statements, not a single batch query. There aren't two statements, there are 6. If you'd said "two batches of statements" instead of "two statements" the thing would have made sense. But you didn't. Since it is necessary to execute at least three statements - ie a batch of statements not a single statement - to get any meningful result, we have to assume you are referring to two of the statements in however many batches you supplied; and you supplied something that was plainly and clearly one batch, not two, so it was reasonable to assume it was intended to as a singe batch (Occam's razor is applicable: there was no "go" anywhere between the two declarations, and there was no necessity to invent one). So as it stands, your reply to Satish seems to me to be nothing other than inaccurate nonsense.
Are think you are lucky there's no-one screaming about a "trick" question; I'm not, because I never attribute to malice (nor even to stupidity) that which is more easily explained as a simple oversight. Satish didn't eithesuggest a "trick" either, maybe for the same reason.
And, just as an aside: I now see that I must use more than 2 emoticons per post if I want to clown anywhere John Mitchell-245523 is likely to see it.
Tom Que conclure à la fin de tous mes longs propos? C'est que les préjugés sont la raison des sots. (Voltaire, 1756)
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Tuesday, May 14, 2013 2:24 AM
Points: 1,871,
Visits: 2,692
|
|
So as it stands, your reply to Satish seems to me to be nothing other than inaccurate nonsense.
next time, I'll run it past you, to ensure it meets YOUR requirements. I'll ask Steve to give you the 1 point as it ruined your day apparently.
---------------------------------------------- Msg 8134, Level 16, State 1, Line 1 Divide by zero error encountered.
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Yesterday @ 3:07 PM
Points: 7,096,
Visits: 7,156
|
|
Henrico Bekker (2/20/2012)
So as it stands, your reply to Satish seems to me to be nothing other than inaccurate nonsense. next time, I'll run it past you, to ensure it meets YOUR requirements. I'll ask Steve to give you the 1 point as it ruined your day apparently. Try not to be more of an arrogant idiot than you can help.
Tom Que conclure à la fin de tous mes longs propos? C'est que les préjugés sont la raison des sots. (Voltaire, 1756)
|
|
|
|
|
SSChasing Mays
      
Group: General Forum Members
Last Login: Yesterday @ 3:53 PM
Points: 648,
Visits: 1,303
|
|
Tom and Enrico
I'm only learning this stuff (SQL Server). That's why I come here. There seems to be a better cross section of SQL experts here than I have found at other fora. The spat that this discussion has descended into though, is a rather unedifying spectacle. I get the arguments on both sides. I don't get the personal attacks. You guys contribute, presumably out of altruism, and those of us still getting a handle on the caper are the better for it. Don't throw the baby out with the bathwater. It belittles you both.

One of the symptoms of an approaching nervous breakdown is the belief that one's work is terribly important. Bertrand Russell
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Sunday, May 19, 2013 11:16 PM
Points: 1,061,
Visits: 1,151
|
|
thanks, Its good to know this....
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Sunday, May 19, 2013 11:16 PM
Points: 1,061,
Visits: 1,151
|
|
We can also use any no. of semicolon before WITH also - ;;;with CTE as (select * from LocationMaster) select LocationName from CTE
So, semicolon doesnt make any effect that how many semicolons you used after any statement or as a prefix to WITH while writing a CTE expression...
|
|
|
|