MS SQL stored procedures in a separate DB

Discussion in 'Databases' started by Chuck Koepplin, Apr 2, 2013.

  1. #1
    Is there an easy way to be connected to a MS SQL database and execute a stored procedure from another DB?

    Thank you for your assistance.
    Chuck
     
    Last edited by a moderator: Apr 2, 2013
    Chuck Koepplin, Apr 2, 2013 IP
  2. funkseo

    funkseo Greenhorn

    Messages:
    23
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #2
    yes sure, the simplest way;
    select * from [OtherServerName].[OtherDBName].[dbo].[OtherTableName]

    you may use linked server queries too but the first one is easy.

    ps:Your sql server user must have access to both databases.
     
    funkseo, Apr 24, 2013 IP