Pass in Parameter Sp

  • Hi All,

    Please help.  I tried to build a sp so that user can pass-in database name and my sp will allow them to query in the database that they select.  How can I do that in the sp.  I have about 50dbs, and those 50dbs have the same table name tbl_email. 

    I will be very  appreciate for any help.

    Thanks

    Minh Vu

  • Your best bet is to put the SP in each DB and tell them to reference and execute by running this way

    dbname.dbo.SPName

    The other way is dynamic SQL and you end of giving the very permissions you want to avoid on the table.

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

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