Stored Procedure

  • I need a help,

    I need to write a stored procedure on our database server (on www), which should update table on our local database server

    I tried

    sp_addlinkedserver

    but is not working

    I just want to know

    Can we define connectionstring within a stored procedure?

    And if yes then how?

  • Can yu link from the local server to the www server? That way you could put the sp on the local server and execute it from the remote.

  • Hi,

    you can define a view like:

    CREATE VIEW dbo._v_Item

    AS

    SELECT *

    FROM OPENROWSET('MSDASQL',

    'DRIVER={SQL Server};SERVER=test;UID=xx;PWD=yyyy;',

    'select No_, Description + '', '' + [Description 2] COLLATE SQL_Latin1_General_Cp1_CI_AS as Description, [Item Category Code] COLLATE SQL_Latin1_General_Cp1_CI_AS as [Item Category Code], [Product Group Code] COLLATE SQL_Latin1_General_Cp1_CI_AS as [Product Group Code] , [Product Group Code 2] COLLATE SQL_Latin1_General_Cp1_CI_AS as [Product Group Code 2] from sitesql.dbo.[VSA Gruppe$Item]')

    regards

    karl

    Best regards
    karl

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

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