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
 General SQL Server Forums
 New to SQL Server Programming
 Power Shell Connection with Isolation level

Author  Topic 

jarthda
Starting Member

10 Posts

Posted - 2013-03-07 : 17:07:58
Is it possible to set an isolation level when connecting with powershell. This is for SQL 2008r2. I want to connect at the snapshot level then issue several BCP out statements (one per table)
Is it possible?

John

Jarthda
Embarcadero/SQL Server/and now... Informatica

robvolk
Most Valuable Yak

15732 Posts

Posted - 2013-03-07 : 17:25:05
You'd have to use bcp with the queryout option and specify the isolation level in the query expression, for each bcp that you run. I'm not even sure SET TRANSACTION ISOLATION LEVEL will work in that context, but it definitely can't be set one time for an entire batch of bcp commands.

Another option is to set the database to READ COMMITTED SNAPSHOT, that way you'll get snapshot isolation by default.
Go to Top of Page
   

- Advertisement -