Copy data fm one table to another

MrMix's profile image MrMix posted 4 weeks ago in General Permalink

Hello,

I'm trying to copy data from one column named 'title' from table songs (db named db001) to a column named 'songs' from table songs in another db named db002. This is the code: SELECT title INTO songs IN db002 FROM songs;

I get an error msg.:SQL Error (1327): Undeclared variable: songs

What am I doing wrong ?

Thank you, Regards

MM

wlodekh's profile image wlodekh posted 3 weeks ago Permalink

Try this:

INSERT INTO db002.dbo.songs (title) SELECT title FROM db001.dbo.songs

MrMix's profile image MrMix posted 3 weeks ago Permalink

Thank you for the answer ! It works but without 'dbo'

INSERT INTO db002.songs (title) SELECT title FROM db001.songs

regards MM

Please login to leave a reply, or register at first.