SQL Server - copying data
Folks,
Can anyone tell me how I can copy the contents of a ntext field from one SQL database to another?
I'm trying to do:
UPDATE db1.dbo.table1
SET db1.dbo.table1.notesField1 = (SELECT db2.dbo.table2.notesField2 FROM db2.dbo.table2 WHERE db2.dbo.table2.ProjID= @ProjID)
WHERE db1.dbo.table1.ID = @ID
But I keep getting the really helpful message:
Error 279: The text, ntext, and image data types are invalid in this subquery or aggregate expression.
I've tried storing the data in a local variable but I'm told I'm not allowed because:
Error 2739: The text, ntext, and image data types are invalid for local variables.
I've also tried creating a user defined function but it tells me that functions aren't allowed to return "text, ntext, and image data types"
HELP!!!
Cheers
Mojo
Can anyone tell me how I can copy the contents of a ntext field from one SQL database to another?
I'm trying to do:
UPDATE db1.dbo.table1
SET db1.dbo.table1.notesField1 = (SELECT db2.dbo.table2.notesField2 FROM db2.dbo.table2 WHERE db2.dbo.table2.ProjID= @ProjID)
WHERE db1.dbo.table1.ID = @ID
But I keep getting the really helpful message:
Error 279: The text, ntext, and image data types are invalid in this subquery or aggregate expression.
I've tried storing the data in a local variable but I'm told I'm not allowed because:
Error 2739: The text, ntext, and image data types are invalid for local variables.
I've also tried creating a user defined function but it tells me that functions aren't allowed to return "text, ntext, and image data types"
HELP!!!
Cheers
Mojo
Thread
Thread Starter
Forum
Replies
Last Post





