search
Japanese Chinese Nederlands Espanol Italiano Deutsch Francais Twitter Rss Feeds
SQL Server GroupsView
SQL Server Ce
SQL Server Clients
SQL Server Clustering
SQL Server Connect
SQL Server Dts
SQL Server Fulltext
SQL Server Integrationsvcs
SQL Server Msde
SQL Server Newusers
SQL Server Olap
SQL Server Programming
SQL Server Replication
SQL Server Reportingsvcs
SQL Server Security
SQL Server Server
SQL Server Setup
SQL Server Tools
SQL Server Xml

Group SummariesView
.NET Framework
Access
BizTalk
Certifications
CRM
DDK
Exchange Server
FoxPro
French
French .NET
Games
German
German .NET
Graphic Design
IIS
Internet
ISA Server
Italian
Italian .NET
Maps
MCIS
Miscellaneous
Mobile Application Development
Money
MSN
Networking
Office
Ops Mgr
Publisher
Security
SharePoint
Small Business
Spanish
Spanish .NET
SQL Server
Systems Management Server
Transaction Server
Virtual PC / Virtual Server
Visual Studio
Win32
Windows 2000
Windows 2003 Server
Windows 7
Windows Live
Windows Media
Windows Update
Windows Vista
Windows XP
 

View All Microsoft SQL Server Programming Posts  Ask A New Question 

Comparing text columns - Erland Sommarskog

Monday, June 02, 2008 6:41 PM

ISSDBEngr (ISSDBEngr@gmail.com) writes:

Since you are on SQL 2005, why use text when you can use varchar(MAX)?
That is far less painful than text.

I don't know whether checksum() works on varchars longer than 8000 though.
But checksum() is not very good anyway, you would probably miss a lof
of actual changes. I would run a simple = to compare the values.


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
reply
 

Comparing text columns - ISSDBEngr

Wednesday, June 04, 2008 9:19 PM

We are currently using SQL 2005 and I need to create a pipe delimited
text file of over 80 columns daily.  The final dataset is saved as a
text column before sving it to a file as it is larger that varchar
(8000).  If even 1 value in the column changes do I need to include it
in the next day's file.
Is there a way to compare a text column that does not have alot of
overhead.  The data set can be large and it does not seem like
CHECKSUM is a option as text is not supported.
Any help is appreciated.

thanks
Mina
reply

If VARCHAR(8000) isnt' enough and you're using SQL Server 2005,VARCHAR(MAX) is - Eric Isaacs

Wednesday, June 04, 2008 9:19 PM

If VARCHAR(8000) isnt' enough and you're using SQL Server 2005,
VARCHAR(MAX) is an option you might consider for the column datatype.

What about tracking the last update date/time for the columns and the
varchar(max) column with a trigger on the update/insert of the columns
and the varchar(max) column?  Another option would be to have the
VARCHAR(Max) column be a calculated column that is always a summary of
the columns in question.

Hope that helps!
reply