Results 1 to 3 of 3

Thread: insert data from one DB to another problem

  1. #1
    Join Date
    Dec 2005
    Posts
    29

    insert data from one DB to another problem

    Hello I am developing a VB application and my backend is MSSQL 2000.

    I have 2 Database Say DB1 and DB2.Both are in Same Server.

    Now i need to get data from DB1 and insert into DB2.

    Eg.
    Insert into tablefromDB1 Select * from ServerName.dbo.TableFromDB2

    how can i do this with username

    insert into tablefromDB1 select * from Servername.username.TablefromDB2
    When i put like this it pops up a error.

    Need help
    with regards

  2. #2
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254
    It is a 4 part qualifier "servername.databasename.owner.objectname"

    If both databases are on the same server then use 3 part qualifier.
    "databasename.owner.objectname"

  3. #3
    Join Date
    Dec 2005
    Posts
    29
    Hello MAK you are correct.
    I have a model and i like to know your suggestion.
    I have a LIVE DB which i cant do anything except pull data from that and process it.So what i planned is have another DB and pull data from the LIVE Db and put it in my TEMPDB and then process data with views and SPs so that my process will be much faster and Less Drag to Server for my application work as a reporting tool. But i have one problem.
    The report tool which i am making is a multi user system and so for each user i need to pull data seperately and using USERID i am working around it.Next everytime they import it takes lot of time to import the data for the data is around 600,000 odd. I am using SP to connect to that db and using a selectqry and pull data from live server and assigning directly to the local table in tempdb. Is there any easier way to do this rather than what i am doing?
    with regards


    With regards
    vimal
    Last edited by vimalpercy; 12-23-2005 at 08:28 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •