Linked server

  • Hi,

    I have made a stored procedure which retreview the data from the table, basically that are the excel file.Now I connect to that file using Linked server and transfer the data into the table since there are many records that why I have used Cursor to fetch the records and transfer the data into the table.

    The code is as follows :

     

    FETCH

    NEXT FROM TransferCursor

    INTO

    @MerchantID,@FileName

    WHILE

    @@FETCH_STATUS = 0

    BEGIN

     

    @Path

    varchar(500)

    set

    @Path = 'C:\DataFeed\CurrentDataFeed\14-11-2006\'+@FileName

    EXEC(' Insert into TransferedDatafeed

    SELECT *,getdate() FROM OPENROWSET(''Microsoft.Jet.OLEDB.4.0'',

    ''Excel 8.0;Database='

    +@path +''',[luzstransfer$])')

    print

    @Path

     

     

     

    FETCH

    NEXT FROM TransferCursor

    INTO

    @MerchantID,@FileName

    End

    CLOSE

    TransferCursor

    DEALLOCATE

    TransferCursor

     

     

    Now some time it gives me the error rather say warning that the linked server already exists.

     

  • Hello,

    I have solved the problem.

    Thanks,

    Deepesh Verma

  • Hi Deepesh,

    Hw did u solve the problem? I am also facing the same problem..

     

    Did u use the sp_dropserver command which u hadn't used before or some other way..??

     

    Please reply soon as I am in the middle of this issue.

    Thanks a ton,

    Shyam

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

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