SQL Error

  • Hi,

    I am using the addlink server and used the following statement

    SELECT * INTO ITW.WebModule.dbo.tblICInventoryZone_99999 FROM [TEST].dbo.tblICInventoryZone

    but I got error like this :

    The object name 'ITW.WebModule.dbo.' contains more than the maximum number of prefixes. The maximum is 2.

    Please help me.

  • I don't believe you can use Select Into on a linked server. You have to create the table first, then use Insert Select.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • SELECT INTO syntax is designed to create a table on the fly.

    i believe a linked server only allows you to add/insert/update into existing objects....not CREATE objects on the fly like that, which is why you get an error.

    create the destination table on the linked server and then do the

    INSERT INTO linkedservertabe.dbname.owner.tablename

    select * from localtable

    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!

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

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