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

Temporary Objects 2 Expand / Collapse
Author
Message
Posted Thursday, March 8, 2012 8:56 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Tuesday, October 14, 2014 10:58 AM
Points: 5,333, Visits: 25,272
Comments posted to this topic are about the item Temporary Objects 2

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 #1264094
Posted Thursday, March 8, 2012 8:59 PM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Today @ 7:13 PM
Points: 1,293, Visits: 1,128
Hi Bitbucket,

The link you provide is not correct.

http://www.sqlservercentral.com/questions/UNION/88678/http://www.sqlservercentral.com/Forums/Topic1205649-1222-2.aspx

And there is a typo in the question.

SELECT Id,,ProductionDate FROM Foobar

Initially I was confused whether it has to do anything with the question itself.


Anyways finally managed to get it right.
Post #1264096
Posted Thursday, March 8, 2012 9:28 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Tuesday, October 14, 2014 10:58 AM
Points: 5,333, Visits: 25,272
Once again I looked at my notes and here is the link

Posted 11/15/2011 1:34 PM

http://www.sqlservercentral.com/Forums/Topic1205649-1222-2.aspx

Mr Hugo Kornelis comment is
in my display mode is at the bottom of page 2 of the forum

The title of the forum is Table variable - 2



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 #1264106
Posted Thursday, March 8, 2012 9:29 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Tuesday, October 14, 2014 10:58 AM
Points: 5,333, Visits: 25,272
Once again I looked at my notes and here is the link

Posted 11/15/2011 1:34 PM

http://www.sqlservercentral.com/Forums/Topic1205649-1222-2.aspx

Mr Hugo Kornelis comment is
in my display mode is at the bottom of page 2 of the forum

The title of the forum is Table variable - 2



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 #1264107
Posted Friday, March 9, 2012 12:29 AM
SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

Group: General Forum Members
Last Login: Wednesday, June 25, 2014 9:03 PM
Points: 609, Visits: 140
The answer is I think incorrect:

SELECT Id,,ProductionDate FROM Foobar - if you assume this is not a typo then both first and second users will receive an error message - I demand a recount!
Post #1264156
Posted Friday, March 9, 2012 12:40 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 1:28 PM
Points: 13,263, Visits: 11,053
The real answer is: the proc cannot be created because of the flagrant syntax violation.



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 #1264162
Posted Friday, March 9, 2012 1:05 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 3:35 PM
Points: 6,043, Visits: 8,324
I am embarassed to admit that I got this question, that apparently was based on my comments, wrong.

I should have been warned. I even checked the code several times. All because I thought that if both programs run without error (as I assumed), there would have been THREE correct answers. So I checked. And checked again.

I did contemplate the extra comma, but figured that this would not be Ron's style, so it had to be a genuine type (hint: test all code before submitting QotD!)
I did also contemplate the inconsistent use of upper- and lowercase, but figure that wouldn't be Ron's style either (hint: test all code on a database with case-sensitive collation)

And after reading the script yet another time, I ticked the first three options - and then kicked myself for overlooking the named constraint.

Thanks, Ron! Good question (though unfortunately hampered by the typo and the inconsistent upper-/lowercase).



Hugo Kornelis, SQL Server MVP
Visit my SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
Post #1264167
Posted Friday, March 9, 2012 1:43 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Thursday, September 18, 2014 12:19 AM
Points: 302, Visits: 179
Well, I didn't catch the error on the select from Foobar, but just thought about locking while selecting/inserting.
I didn't really look into the temp table as this should be local to the procedure, but the constraint eluded my reading abilities. I have on other occations been bitten by ghe "named sometning" in a procedure, so I should be warned.
Anyway, the "select any two correct" should have hinted at the correct answer. If we disregard deadlocks between concurrent runs, then instance #2 should always wait for instance #1, så if it were possible to complete #2 at all, it should. And as others have pointed out: If both completed, you would have 3 check marks.
Post #1264182
Posted Friday, March 9, 2012 3:03 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 2:48 AM
Points: 1,733, Visits: 1,143
That one took me about 20 minutes of careful thought to get what the problem was - I knew there had to be one somewhere (besides the obvious typo). Useful to be aware of the issue.
Post #1264201
Posted Friday, March 9, 2012 3:46 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 10:26 AM
Points: 1,780, Visits: 6,475
Got this right as I was hit by it a few weeks ago after an attempt to "tidy up" some code by naming the constraints
Post #1264220
« Prev Topic | Next Topic »

Add to briefcase 1234»»»

Permissions Expand / Collapse