Home Forums SQL Server 7,2000 T-SQL create a table on a 2nd SQL server via linked server RE: create a table on a 2nd SQL server via linked server

  • ismahmoud (10/13/2016)


    i'm using this script :

    select * into LinkedServer.[DB_Name].[dbo].[Table_Name] FROM Server2.[DB2_Name].[dbo].Table2_Name

    but give this error:

    Msg 117, Level 15, State 1, Line 1

    The object name 'LinkerserverName.DB_Name.dbo.Table_Name' contains more than the maximum number of prefixes. The maximum is 2.

    i don't understand how can i use SP to solve this problem ?????

    In your example, you cannot use the select...into newtable via a linked server. The four part syntax s not supported for that dynamic creation.

    You have to create the table explititly, then use a standard insert into tablename...select

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!