Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
kioteh
Starting Member
16 Posts |
Posted - 2010-03-17 : 17:40:37
|
I get the following message whenever I try to insert into a table that has a user defined datatype for a couple of the columns.Msg 402, Level 16, State 1, Line 4The data types void type and varchar are incompatible in the greater than or equal to operator.The UDT is a simple varchar(7) and the code that does the insert has been used for years. This came up during a migration from SQL 2000 to SQL 2008. The funny thing is the code is a simple insert statement with no boolean type code in it.insert DBName..TableName (Col1, Col2, Col3)select substring(Row,1,6), substring(Row,7,6), substring(Row,13,6)from DBName..TableName2 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
kioteh
Starting Member
16 Posts |
Posted - 2010-03-18 : 10:38:50
|
I can in the sense that if I do, it works fine, but I can't as a permanent solution. |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2010-03-18 : 13:37:24
|
Tried dropping and recreating the Type? I suspect that SQL 2008 is looking for a CLR assembly. Dropping and recreating will resolve if that's the case. |
 |
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2010-03-18 : 13:55:20
|
by the way...I just tested creating a type in sql 2000, then restored the db to sql 2008. i didn't have this problem, either in 80 or 100 compatibility mode.still suggest dropping and recreating type -- using DROP TYPE / CREATE TYPE syntax (not sp_addtype)by the way, have you applied SP1 to your SQL 2008 installation? |
 |
|
kioteh
Starting Member
16 Posts |
Posted - 2010-03-19 : 17:31:37
|
Russell, that's a good idea, I'll try that and report back. |
 |
|
|
|
|
|
|