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

Variable Array Table Expand / Collapse
Author
Message
Posted Tuesday, October 12, 2010 7:59 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, September 4, 2013 11:03 AM
Points: 4, Visits: 24
I just think it's hilareous what the SQL 2008 intellisense looks like (newline characters and all) when you perform a select against this 'table':

select dbo.[VarArray[]](i int)
GO

begin tran
insert into VarArray(i) select 1;
print 1;
rollback
GO
while(1=1)].print_i
from dbo.[VarArray[]](i int)
GO

begin tran
insert into VarArray(i) select 1;
print 1;
rollback
GO
while(1=1)]


What a strange question... My first impression was that this was done by mistake when trying to use VARARRAY from Oracle (or someone was testing to see if VARARRAY was valid in that version of SQL Server).
Post #1002829
Posted Tuesday, October 12, 2010 8:04 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, July 21, 2014 2:20 PM
Points: 14, Visits: 43
You are right. The parser in SSMS 2008 is a little different from 2005. The table name has the actual insert statement in it and then some. I wasted 20-30 minutes trying to get it to work like the posted answer.
Post #1002838
Posted Tuesday, October 12, 2010 9:10 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: Yesterday @ 1:39 PM
Points: 922, Visits: 197
Hugo, thank you for your explanation. I was totally confused by the square brackets.
Post #1002918
Posted Tuesday, October 12, 2010 10:41 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, April 4, 2013 2:37 PM
Points: 1,294, Visits: 46
I thought the ending ] was a typo, it just didn't make sense with it there :)
Post #1003015
Posted Tuesday, October 12, 2010 10:49 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, April 4, 2013 2:37 PM
Points: 1,294, Visits: 46
I think I wasted 15 min of my time today on this question learning nothing new, thanks Hugo for taking the time to explain the delimiter concepts.
Post #1003025
Posted Tuesday, October 12, 2010 12:13 PM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Today @ 3:45 AM
Points: 8,681, Visits: 9,206
Interesting question with totally useless (or worse than that) explanation.
Thank heavens for Hugo's clear and simple explanation!


Tom
Post #1003100
Posted Tuesday, October 12, 2010 1:36 PM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Saturday, March 15, 2014 1:45 PM
Points: 405, Visits: 286
Dogpile on Carlo. Give him a dutch rub.
Post #1003176
Posted Tuesday, October 12, 2010 3:17 PM
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: Yesterday @ 2:07 PM
Points: 593, Visits: 2,875
First time I've ever joined a QOTD discussion. In almost 10 years on the site this must be the worst QOTD yet. I quite regularly get them wrong as I am a part time user of SQL Server now days having got promoted to PM roll. I enjoy the learnings and encourage my teams to spend time on the forums and to always do the QOTD. Well this one is a total waste of time as it is a situation that will NEVER occur in a real world situation. I know that it is voluntary to submit a question and there are probalby times when only one is submitted ut I would prefer to have no QOTD that ones as bad as this.


Post #1003238
Posted Tuesday, October 12, 2010 6:15 PM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Today @ 3:45 AM
Points: 8,681, Visits: 9,206
dogramone (10/12/2010)
First time I've ever joined a QOTD discussion.

No, there have been far worse. At least in this one the answer was not wrong. And for irrelevance to real work - one QoTD that I set beats this one for irrelevance (and Hugo quite properly and politely pointed out its irrelevance).


Tom
Post #1003307
Posted Tuesday, October 12, 2010 9:28 PM
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, May 15, 2014 8:37 PM
Points: 589, Visits: 2,437
That was a realy trick question. Thank you Hugo for the explanation. I had to read it twice, but I finaly got it... Sure I know how a ] works now!
Post #1003339
« Prev Topic | Next Topic »

Add to briefcase «««12345»»»

Permissions Expand / Collapse