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 Thursday, February 16, 2012 12:31 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Thursday, August 28, 2014 2:39 AM
Points: 1,880, Visits: 2,846

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.
Post #1252905
Posted Friday, February 17, 2012 1:16 PM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, July 24, 2014 2:48 PM
Points: 1,379, Visits: 834
Good question.
Post #1254141
Posted Monday, February 20, 2012 2:03 AM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Monday, November 17, 2014 12:33 AM
Points: 832, Visits: 1,593
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
Post #1254585
Posted Monday, February 20, 2012 10:47 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 9:35 AM
Points: 7,874, Visits: 9,613
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
Post #1254840
Posted Monday, February 20, 2012 10:26 PM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Thursday, August 28, 2014 2:39 AM
Points: 1,880, Visits: 2,846
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.
Post #1255001
Posted Tuesday, February 21, 2012 1:42 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 9:35 AM
Points: 7,874, Visits: 9,613
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
Post #1255556
Posted Tuesday, February 21, 2012 2:04 PM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Monday, November 17, 2014 12:33 AM
Points: 832, Visits: 1,593
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
Post #1255568
Posted Thursday, October 11, 2012 1:53 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 12:12 AM
Points: 1,953, Visits: 2,397
thanks,
Its good to know this....



_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
Post #1371254
Posted Thursday, October 11, 2012 1:59 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 12:12 AM
Points: 1,953, Visits: 2,397
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...



_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
Post #1371257
Posted Thursday, May 30, 2013 5:30 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Friday, September 27, 2013 5:37 AM
Points: 306, Visits: 524
i did something in past 1+

Neeraj Prasad Sharma
Sql Server Tutorials
Post #1458152
« Prev Topic | Next Topic »

Add to briefcase «««12345

Permissions Expand / Collapse