SQL Server - copying data
#1
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
#3
Cheers fella
Just found out about the UPDATETEXT methoid and written a method using it that does what I want. I really should get round to reading the book sometime
Mojo
Just found out about the UPDATETEXT methoid and written a method using it that does what I want. I really should get round to reading the book sometime
Mojo
Thread
Thread Starter
Forum
Replies
Last Post
JonMc
Subaru Parts
22
06 February 2016 09:50 PM
Sam Witwicky
Engine Management and ECU Remapping
17
13 November 2015 10:49 AM