on 10-29-2010 2:02 PM
Hi All,
I am gettin an error The data types ntext and ntext are incompatible in the equal to operator whil eexecuting the following SP;
if @object_type = '191' and @transaction_type in ('A','U')
BEGIN
if exists
(Select oscl.callid from oscl
where oscl.U_SERIALNUM=
(select p.U_SERIALNUM from oscl p
where p.callid=@list_of_cols_val_tab_del)
and oscl.callid!=@list_of_cols_val_tab_del)
begin
set @error =2
set @error_message = 'Duplicate Serial Number !'
end
END
Thanks,
Joseph
Hi,
You can't use text columns in an equal operation of a WHERE clause,you have to change your column type from text to either varchar(max) or nvarchar(max) '
Use below code:
if @object_type = '191' and @transaction_type in ('A','U')
BEGIN
if exists
(Select oscl.callid from oscl
where cast(oscl.U_SERIALNUM as nvarchar(MAX)) =
(select CAST(p.U_SERIALNUM AS Nvarchar(MAX)) from oscl p
where p.callid=@list_of_cols_val_tab_del)
and oscl.callid!=@list_of_cols_val_tab_del)
begin
set @error =2
set @error_message = 'Duplicate Serial Number !'
end
END
Thanks,
Neetu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Joseph......
I guess the problem is with Datatype of UDF taken in Sevice call......
Change its Datatype or convert it in SP to nvarchar.....
Regards,
Rahul
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
100 | |
11 | |
10 | |
6 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.