July 11, 2012 at 11:55 am
I think this might help:
July 11, 2012 at 11:55 am
deprecation?
last i heard, the views were there to stay, but could be changed;
some article i read said any changes would be things like adding columns to the end of the current views, but not outright changing or dropping them.
Lowell
July 11, 2012 at 12:01 pm
Lowell (7/11/2012)
deprecation?last i heard, the views were there to stay, but could be changed;
some article i read said any changes would be things like adding columns to the end of the current views, but not outright changing or dropping them.
As Lynn said, I'm misremembering what is actually deprecated. SQL Server Deprecated Items List. Syscolumns is indeed on there. For some reason, my brain just stuck the period in there because ... well, I can't explain that. @=)
Thanks for the other link, Lynn.
July 12, 2012 at 7:13 pm
Excellent Code, thanks Lowell 🙂
When i ran sp_UglySearch proc I did not get ColName.
use this
SET @sql = 'IF EXISTS(SELECT * FROM ' + QUOTENAME(@SCHEMANAME) + '.' + QUOTENAME(@TABLENAME) + ' WHERE ' + @COLZ + ') INSERT INTO #RESULTS(TBLNAME,COLNAME,SQL) VALUES(''' + @TABLENAME + ''',' + @COLNAME + ','' SELECT * FROM ' + QUOTENAME(@TABLENAME) + ' WHERE ' + REPLACE(@COLZ,'''','''''') + ''') ;'
instead of
SET @sql = 'IF EXISTS(SELECT * FROM ' + QUOTENAME(@SCHEMANAME) + '.' + QUOTENAME(@TABLENAME) + ' WHERE ' + @COLZ + ') INSERT INTO #RESULTS(TBLNAME,COLNAME,SQL) VALUES(''' + @TABLENAME + ''',''-'','' SELECT * FROM ' + QUOTENAME(@TABLENAME) + ' WHERE ' + REPLACE(@COLZ,'''','''''') + ''') ;'
July 13, 2012 at 4:45 am
Mahmood, would you please bold the places where you made chances to the code to make it easier to read?
July 15, 2012 at 6:04 pm
use this
SET @sql = 'IF EXISTS(SELECT * FROM ' + QUOTENAME(@SCHEMANAME) + '.' + QUOTENAME(@TABLENAME) + ' WHERE ' + @COLZ + ') INSERT INTO #RESULTS(TBLNAME,COLNAME,SQL) VALUES(''' + @TABLENAME + ''',' + @COLNAME + ','' SELECT * FROM ' + QUOTENAME(@TABLENAME) + ' WHERE ' + REPLACE(@COLZ,'''','''''') + ''') ;'
instead of
SET @sql = 'IF EXISTS(SELECT * FROM ' + QUOTENAME(@SCHEMANAME) + '.' + QUOTENAME(@TABLENAME) + ' WHERE ' + @COLZ + ') INSERT INTO #RESULTS(TBLNAME,COLNAME,SQL) VALUES(''' + @TABLENAME + ''',''-'','' SELECT * FROM ' + QUOTENAME(@TABLENAME) + ' WHERE ' + REPLACE(@COLZ,'''','''''') + ''') ;'
July 18, 2012 at 11:39 am
both catalog view(sys schema) and information_schema views can be used.
~ Lokesh Vij
Link to my Blog Post --> www.SQLPathy.com[/url]
Follow me @Twitter
July 18, 2012 at 11:43 am
lokeshvij (7/18/2012)
both catalog view(sys schema) and information_schema views can be used.
That works for the database. If I remember correctly, the OP is talking about a label box on a form in Visual Studio. That's not quite so easy.
July 18, 2012 at 11:48 am
Oh...got is Thanks!
~ Lokesh Vij
Link to my Blog Post --> www.SQLPathy.com[/url]
Follow me @Twitter
Viewing 9 posts - 16 through 23 (of 23 total)
You must be logged in to reply to this topic. Login to reply