|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Monday, April 29, 2013 12:19 AM
Points: 219,
Visits: 326
|
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Friday, November 30, 2012 1:52 AM
Points: 1,116,
Visits: 602
|
|
Anyone who still uses text variables should be shot, especially because it makes me read the question wrong.
Ronald Hensbergen
Help us, help yourself... Post data so we can read and use it: http://www.sqlservercentral.com/articles/Best+Practices/61537/ ------------------------------------------------------------------------- 2+2=5 for significant large values of 2
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: 2 days ago @ 12:52 PM
Points: 2,548,
Visits: 17,348
|
|
| Hey Ronald - do you have a statistics background? I just noticed your sig line and it reminded me of an old statistician joke... :)
|
|
|
|
|
UDP Broadcaster
      
Group: General Forum Members
Last Login: Wednesday, April 17, 2013 10:57 PM
Points: 1,491,
Visits: 3,008
|
|
Like Ronald, I doubt I'll have much use for a "text" datatype, but we do have XML in our databases so this QOD was valuable to me in pointing out that non-comparable datatypes are ignored. This script is modified from the original QOD to show the danger of depending on checksum or binary_checksum to flag certain changes.
Declare @FirstCksum int CREATE TABLE #myTable (column1 xml,column2 int); INSERT INTO #myTable VALUES ('<test></test>',109); select * from #mytable SELECT @FirstCksum = BINARY_CHECKSUM(*) from #myTable; update #myTable set column1='<test>values</test>' where column2 = 109 select * from #mytable SELECT Case when BINARY_CHECKSUM(*) = @FirstCksum then 'No Change' else 'Table Modified' end as TableChanged from #myTable; DROP TABLE #myTable Yes, it returns "No Change" because only the int column is considered by the function.
|
|
|
|