I'm running SQL 2005 Management Studio on an XP Pro workstation and am running the following SQL Statement to prevent the insert of duplicate data from a Table called Software to a table called Packages.
Here's the SQL Query that I'm running:
ALTER PROCEDURE [dbo].[SpPackagesTable_Del
ete_Reseed
Identity_I
nsert ]
AS
DELETE
FROM CRPRDNMSQABE.platform_vali
dation_too
l.dbo.pack
ages
DBCC CHECKIDENT ('platform_validation_tool
.dbo.packa
ges', RESEED, 0);
INSERT INTO platform_validation_tool.d
bo.package
s (Name, Version, Build)
SELECT Distinct Name, Version, Build
FROM crprdnmsqabe.platform_vali
dation_too
l.dbo.soft
ware
Everything worked fine when our Software and Packages tables datatypes were set to varchar. One of our Engineers decided to change the datatypes to "text" on all the tables including these two. When I run this query, here's the error I get:
Msg 421, Level 16, State 1, Line 2
The text data type cannot be selected as DISTINCT because it is not comparable.
Msg 421, Level 16, State 1, Line 2
The text data type cannot be selected as DISTINCT because it is not comparable.
Msg 421, Level 16, State 1, Line 2
The text data type cannot be selected as DISTINCT because it is not comparable.
Does the Distinct keyword have an issue running queries on tables with datatype TEXT and/or is there another command I can use to workaround this issue?
Thank you,
Wallace
Start Free Trial