|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Monday, April 22, 2013 8:51 AM
Points: 32,
Visits: 62
|
|
the only thing i'd like to mention is regarding the convert in the where clause. if you don't specify the length when you convert the current search column to varchar it, by default, will truncate the column value to a length of 30. it will also trim trailing spaces, so it would really only search the first 30 characters of the current column. see my example below:
DECLARE @Value varchar(100)='12345678901234567890123456789012345678901234567890' SELECT @Value, LEN(@Value), LEN(CAST(@Value AS varchar)), LEN(CONVERT(varchar, @Value)), LEN(CAST(@Value AS varchar(1000))), LEN(CONVERT(varchar(1000), @Value)) SET @Value=REPLACE(@Value, '0',' ') SELECT @Value, LEN(@Value), LEN(CAST(@Value AS varchar)), LEN(CONVERT(varchar, @Value)), LEN(CAST(@Value AS varchar(1000))), LEN(CONVERT(varchar(1000), @Value))
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Today @ 7:11 AM
Points: 877,
Visits: 1,159
|
|
Thanks @Adam Gojdas & Author. It helps me to solve one issue.
Thanks
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Yesterday @ 2:51 PM
Points: 315,
Visits: 1,356
|
|
Yes, thanks to Michael and others for this. Helped me quickly find an errant value in a field during a very large insert that failed.
Ken
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Yesterday @ 11:45 AM
Points: 7,
Visits: 83
|
|
I created this query for the same purpose: [url=http://fullparam.wordpress.com/2012/09/07/fck-it-i-am-going-to-search-all-tables-all-collumns][/url]
|
|
|
|