Inserting Records to 2 different database?

  • 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...

    Mitesh

     

  • "but without luck" is a rather general statement. What is the error number and error message which is being returned ?

    SQL = Scarcely Qualifies as a Language

  • Thank you for responding very quickly.

    I will get you the exact error message tommorrow. I am at home now.

     

    Mits

  • Make sure that the login you are using to connect to SQL has appropriate permissions in both databases.  What you are doing should certainly work.  The error message will certainly help

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply