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 2:20 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Tuesday, October 7, 2014 2:56 AM
Points: 2,842, Visits: 3,876
Hugo Kornelis (10/12/2010)
The short explanation is that, within a [delimited identifier], you have to double the ] to get a single ] character.

Ah, that makes sense... Well, it doesn't completely, since I would expect that the opening square bracket should be escaped as well then for conistentcy. But whatever :)

Still, SMO seems to have some issues dropping the table. But it looks like it's not the delimiter that is causing the problem, but a unix like linefeed instead of carriage return with linefeed between the "statements" in the name.

Following is the statement that returns no rows because of the linefeeds when trying to drop the table via SSMS (recorded via profiler). The linefeeds (0x0A) can be seen by converting to varbinary(max) for example.
SELECT
SCHEMA_NAME(tbl.schema_id) AS [Schema],
tbl.name AS [Name]
FROM
sys.tables AS tbl
WHERE
(tbl.name=N'VarArray[](i int)
--GO
begin tran
insert into Vararray(i) SELECT 1
rollback
--GO
while 1 = 1' and SCHEMA_NAME(tbl.schema_id)=N'dbo'
)



Best Regards,
Chris Büttner
Post #1002599
Posted Tuesday, October 12, 2010 3:00 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Monday, November 24, 2014 4:38 AM
Points: 2,301, Visits: 1,432
oh....what a answer...i selected onlyxxxxxxxxxxxxxxxxxxx........But my answer was wrong
Post #1002614
Posted Tuesday, October 12, 2010 3:20 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, May 9, 2012 4:22 PM
Points: 188, Visits: 76
Hugo Kornelis, you are a ninja!
i feel like i learned something now :)
i was pretty confused by the question, and even the explanation of why i got it wrong, but now i can see clearly what's goin on.

Thanks!
Post #1002625
Posted Tuesday, October 12, 2010 3:32 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 10:21 AM
Points: 1,812, Visits: 6,583
What a bizarre question!
Post #1002633
Posted Tuesday, October 12, 2010 4:10 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Monday, July 21, 2014 2:56 AM
Points: 2,603, Visits: 2,061
Splendid work!!

---------------------------------------------------
"Thare are only 10 types of people in the world:
Those who understand binary, and those who don't."
Post #1002651
Posted Tuesday, October 12, 2010 4:16 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 5:21 AM
Points: 6,098, Visits: 8,367
lukus_g (10/12/2010)
Hugo Kornelis, you are a ninja!

True! Well, except for the trendy clothes, the superior stealth, the extreme strength and endurance, the ability to kill without getting killed or caught, and the generic sheer awesomeness of course.
But thanks anyway!



Hugo Kornelis, SQL Server MVP
Visit my SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
Post #1002655
Posted Tuesday, October 12, 2010 6:54 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Tuesday, November 4, 2014 12:48 PM
Points: 2,818, Visits: 2,566
Interesting question. Good follow on discussion.
Post #1002758
Posted Tuesday, October 12, 2010 7:16 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, July 21, 2014 2:20 PM
Points: 14, Visits: 43
This question completely wasted my time. It serves little use to anybody.
Post #1002784
Posted Tuesday, October 12, 2010 7:31 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Thursday, October 2, 2014 3:39 PM
Points: 2,444, Visits: 424
I felt it was worth two points , sure stumped me.

Make you think outside the box.

Thank you
Post #1002799
Posted Tuesday, October 12, 2010 7:55 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, November 4, 2014 4:59 AM
Points: 1,093, Visits: 2,619
Carlo, nice try with this Question of the Day, but I really learned more with Hugo's explanation......



_______________________________________________________________________
For better assistance in answering your questions, click here
Post #1002824
« Prev Topic | Next Topic »

Add to briefcase ««12345»»»

Permissions Expand / Collapse