Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Inserting/Copying Records to 2 different database?

Author  Topic 

Mits
Starting Member

48 Posts

Posted - 2005-11-02 : 14:44:01
Hi all
I have 2 different database in one sql server.
DBName New and Test. Both the database contains a a table with same name and same table structure.
I want to insert a record into table of New database from the table in Test database.
I tried following statement but without luck.

Insert into New.dbo.POP (field1,field2,field3,field4)
select field1,field2,field3,field4 from Test.dbo.POP where [Pop No]=1234

I dont know what i am doing wrong? Any help would be really appreciated.

Thank you all in advance...
Mits

nathans
Aged Yak Warrior

938 Posts

Posted - 2005-11-02 : 15:23:14
What error are you receiving? What is datatype of [Pop No]? Do you have permission on both databases?

* Do not use spaces in your column_names.


Nathan Skerl
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-11-04 : 00:37:18
The code seems correct. Does Test.dbo.POP have records?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -