Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Other SQL Server 2008 Topics
 Cross-schema update and commit

Author  Topic 

JimmyJimmy
Starting Member

1 Post

Posted - 2011-01-31 : 22:19:43
The database engine I'm currently using allows me to connect with a username and password then perform the following transaction on that single connection. My user account has full access to the schemas SchemaOne and SchemaTwo.

My question: With SQL Server, can a single connection be used to update and commit to multiple schemas in a single transaction?

======
Update SchemaOne.SomeTable Set SomeField = 'SomeValue';
Update SchemaTwo.SomeTable Set SomeField = 'SomeValue';
commit;
======

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-01-31 : 22:42:14
Yes. You can even do it across two servers such as a linked server plus the DTC.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -