Unanswered: Hello - Export data from one catalog1-table1 to a catalog2-table2
I have two user tables, one is in a catalog1 another is in catalog2.
How would I copy catalog1.users into catalog2.users (not duplicate, but copy some fields over...).
I've tried variations of thi sample code below, with #temptable and with @temptable, inside the "use master" and outside of....
DECLARE @temptable TABLE (name nvarchar(5))
INSERT INTO @temptable(name)
SELECT name FROM users
INSERT INTO dbo.users(name)
SELECT name from @temptable
SQL 2008, R2.
Suggestions are more than welcome.
Edit: Oh, maybe I can just insert it straight into the table, something like this:
INSERT INTO catalog2.users(name)
SELECT name FROM catalog1.users
Edit: Solved, worked like a charm, no need for the temporary table... Thanks for your time!
Edit: Refined the question a bit.