fetching the data

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Syed Hadi
    New Member
    • Dec 2012
    • 56

    fetching the data

    ow to fetch the data from one server to another server that are connected through lan. ...... Help me out
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    You can create linked servers using http://msdn.microsoft.com/en-us/library/ms190479.aspx
    Then query across them using syntax like
    Code:
    select colNames from LocalTable,[ExternalServerName].ExternalDB].[ExternalUser].[ExternalTable]

    Comment

    • Syed Hadi
      New Member
      • Dec 2012
      • 56

      #3
      see i know this is not a tutorial clases but then also i am asking this ques coz i need it urgent sorry for this ....

      well my ques is i am having two pc A and B with both the db name av and table containing tok in both db. what i want is to fetch the data from pc A (one month) into the pc B . My boss want the query in the batch file i tried but not getting

      Comment

      • r035198x
        MVP
        • Sep 2006
        • 13225

        #4
        1.) You need to write full words. Some of us can't follow all that short hand language and hippy stuff. I didn't understand half of what you posted above.
        2.) It's not important to tell us that it's urgent. That won't change how we will reply.
        3.) Be clear in explaining what you want to do. At this stage I don't know if you want to
        a.) Export data from one database to another or
        b.) Query data from a database on a remote server
        c.) Run a script that references two database on two different computers.
        Regardless, no one is going to give you a full step by step guide that you are going to just blindly follow. This is important data to some people so you will need to put a lot of effort into understanding a suggested solution. First you'll have to put effort into explaining yourself though

        Comment

        • Syed Hadi
          New Member
          • Dec 2012
          • 56

          #5
          i want to export from one database to another ..... limited period like fifteen days data

          Comment

          • Syed Hadi
            New Member
            • Dec 2012
            • 56

            #6
            Code:
            sp_addlinkedserver('sqlserver2008')
            SET IDENTITY_INSERT tblphndata ON
            Insert Into BKP2008.avqms.dbo.tblphndata
            Select * From sqlserver2008.avqm.dbo.Tbltoken
            SET IDENTITY_INSERT tblphndata off
            then it showing incorrect syntax near the server name sqlserver2008

            Comment

            • r035198x
              MVP
              • Sep 2006
              • 13225

              #7
              Check the examples in the link I posted above, you need to EXEC with the external server's settings.

              Comment

              • Syed Hadi
                New Member
                • Dec 2012
                • 56

                #8
                exec sp_addlinkedser ver @server='sqlser ver2008', @datasrc='q-server\sqlserve r2008'

                i exec to ...than also giving error

                Comment

                • r035198x
                  MVP
                  • Sep 2006
                  • 13225

                  #9
                  There is nothing else to be said here.
                  Use the syntax that is used in the examples and it should work. If you get an error you should read the message to get an idea of what the problem is.

                  Comment

                  • Syed Hadi
                    New Member
                    • Dec 2012
                    • 56

                    #10
                    almost all error solved but this is error is not getting solved
                    "The object name contains more than the maximum number of prefixes. The maximum is 2." any idea sir how to solve this error

                    Comment

                    • r035198x
                      MVP
                      • Sep 2006
                      • 13225

                      #11
                      First find out if this is caused by the insert into table name or the select from table name. The error message usually tells you which name it is.

                      Comment

                      • Syed Hadi
                        New Member
                        • Dec 2012
                        • 56

                        #12
                        its indicating with the server name ..... that server is use for select ...

                        Comment

                        Working...