Notices
Computer & Technology Related Post here for help and discussion of computing and related technology. Internet, TVs, phones, consoles, computers, tablets and any other gadgets.

SQL Server - copying data

Thread Tools
 
Search this Thread
 
Old May 27, 2003 | 12:23 PM
  #1  
Mojo's Avatar
Mojo
Thread Starter
Scooby Regular
 
Joined: May 2000
Posts: 409
Likes: 0
Unhappy

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
Reply
Old May 27, 2003 | 03:10 PM
  #2  
Alec's Avatar
Alec
Scooby Regular
 
Joined: Aug 1999
Posts: 583
Likes: 0
Post

Hi there matey

Try using ReadText() , WriteText() and UpdateText(). Functions.

Cheers

Alec
Reply
Old May 27, 2003 | 03:20 PM
  #3  
Mojo's Avatar
Mojo
Thread Starter
Scooby Regular
 
Joined: May 2000
Posts: 409
Likes: 0
Post

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
Reply
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
JonMc
Subaru Parts
22
Feb 6, 2016 09:50 PM
Sam Witwicky
Engine Management and ECU Remapping
17
Nov 13, 2015 10:49 AM
IAN WR1
ScoobyNet General
8
Sep 28, 2015 08:14 PM
Nick_Cat
Computer & Technology Related
2
Sep 26, 2015 08:00 AM
Littleted
Computer & Technology Related
0
Sep 25, 2015 08:44 AM




All times are GMT +1. The time now is 10:27 AM.