Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12345»»»

Table Variable Expand / Collapse
Author
Message
Posted Monday, April 29, 2013 11:56 PM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Wednesday, May 11, 2016 7:35 AM
Points: 1,378, Visits: 1,579
Danny Ocean (4/29/2013)
Lokesh Vij (4/29/2013)
[quote]Was keeping busy with my Master's exams. Finally they are over

So now its party time


Oh Yes..Sure!!
Have to submit dissertation/thesis by the end of December. Any research idea's please??


~ Lokesh Vij

Guidelines for quicker answers on T-SQL question
Guidelines for answers on Performance questions

Link to my Blog Post --> www.SQLPathy.com

Follow me @Twitter

Post #1447888
Posted Monday, April 29, 2013 11:57 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 7:56 AM
Points: 5,303, Visits: 10,157
Thanks everyone for positive feedback.

As you can guess the question came from practical experience when developers were puzzled with "odd" behaviour of SQL Server.
Had to build this sample script to make the matter clear.

Then it appeared to me other might benefit from it too.
Post #1447889
Posted Monday, April 29, 2013 11:59 PM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: 2 days ago @ 11:40 PM
Points: 2,193, Visits: 2,752
Sergiy (4/29/2013)
Thanks everyone for positive feedback.

As you can guess the question came from practical experience when developers were puzzled with "odd" behaviour of SQL Server.
Had to build this sample script to make the matter clear.

Then it appeared to me other might benefit from it too.

+1



_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
Post #1447890
Posted Tuesday, April 30, 2013 12:01 AM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Thursday, December 17, 2015 3:03 PM
Points: 504, Visits: 259
Thanks for the tricky question on table variables. I enjoyed.
Post #1447891
Posted Tuesday, April 30, 2013 12:02 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Wednesday, May 11, 2016 7:35 AM
Points: 1,378, Visits: 1,579
Sergiy (4/29/2013)

Then it appeared to me other might benefit from it too.


Much appreciated Sergiy. Keep it up!


~ Lokesh Vij

Guidelines for quicker answers on T-SQL question
Guidelines for answers on Performance questions

Link to my Blog Post --> www.SQLPathy.com

Follow me @Twitter

Post #1447894
Posted Tuesday, April 30, 2013 12:09 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, February 18, 2016 6:33 AM
Points: 1,127, Visits: 1,616
This was a very good one....learnt something new.

Vinu Vijayan

For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden
Post #1447898
Posted Tuesday, April 30, 2013 12:17 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 9:48 AM
Points: 1,742, Visits: 739
A nice one! I learnt something new, even if i wouldn't use this behaviour.
I'll still declare every variable as before. It's much easier to read and understand for me.
Post #1447901
Posted Tuesday, April 30, 2013 1:26 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, June 2, 2016 10:52 AM
Points: 1,085, Visits: 775
Sergiy (4/29/2013)
Thanks everyone for positive feedback.

As you can guess the question came from practical experience when developers were puzzled with "odd" behaviour of SQL Server.
Had to build this sample script to make the matter clear.

Then it appeared to me other might benefit from it too.


Yep, nice one.


_______________________________________________
www.sql-kefalo.net (SQL Server saveti, ideje, fazoni i fore)
Post #1447912
Posted Tuesday, April 30, 2013 2:19 AM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Today @ 3:43 AM
Points: 9,494, Visits: 11,472
Nice fun question, clear explanation, back to basics of variable declarations.

Of course MS have got the documentation wrong yet again - this is another one of those. The the IF condition @ToCreate = 1 returns neither false nor true, so according to the introductory paragraph of the IF...ELSE BOL page neither the THEN nor the ELSE branch is executed and @Table should remain empty. Of course this doesn't happen, it's a bug in the documentation. I added some community content to the 2008 R2 page to point this out, but probably it won't get corrected.


Tom
Post #1447917
Posted Tuesday, April 30, 2013 4:11 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 9:01 AM
Points: 5,121, Visits: 6,841
Interesting question, thanks

____________________________________________
Space, the final frontier? not any more...
All limits henceforth are self-imposed.
“libera tute vulgaris ex”
Post #1447938
« Prev Topic | Next Topic »

Add to briefcase ««12345»»»

Permissions Expand / Collapse