dja*_*fan 3 sql-server stored-procedures
I am dealing with a web application that uses 2 different databases to store information. These databases have some database keys that refer to records in the other database. I would like to be able to write a stored procedure in SQL 2005 that can modify data in the current database as well as go out and modify some data in the other database. Is this possible? How?
您可以完全限定表名(我假设数据库位于同一个数据库服务器上)
例如来自DB1中的sproc:
UPDATE DB2.dbo.MyOtherTable
SET Field = 'SomeValue'
WHERE ID = 1
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1748 次 |
| 最近记录: |