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.
Author |
Topic |
Grifter
Constraint Violating Yak Guru
274 Posts |
Posted - 2010-08-17 : 09:19:00
|
HiI have users I am trying to add to the DB using the procedure:sp_grantdbaccess N'User'GO But keep getting:quote: The procedure 'sp_grantDBAccess' cannot be executed within a transaction.
What does it mean within a transaction? How else can a piece of code be defined, is this not a transaction?G |
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2010-08-17 : 10:44:18
|
I was able to run the line with no problem...which sql version are you using?--------------------keeping it simple... |
 |
|
Grifter
Constraint Violating Yak Guru
274 Posts |
Posted - 2010-08-17 : 11:47:16
|
2000! |
 |
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2010-08-17 : 14:01:53
|
works for me too. are you sure you're not executing any other code? |
 |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2010-08-17 : 21:44:12
|
exactly as what the error message says, you can't execute the sp_grantdbaccess inside a transactions likeBEGIN TRANexec sp_grantdbaccess N'User'COMMIT move the sp_grantdbaccess to outside of the BEGIN TRAN .. COMMIT section KH[spoiler]Time is always against us[/spoiler] |
 |
|
Grifter
Constraint Violating Yak Guru
274 Posts |
Posted - 2010-08-18 : 05:39:20
|
I've not got:begin trans commitEven running like this:exec sp_grantdbaccess N'User'GO Doesn't work, I get the same error.Any other ideas?ThanksG |
 |
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2010-08-18 : 06:02:09
|
run the query on another window...you might have an open transaction on that session--------------------keeping it simple... |
 |
|
aravindt77
Posting Yak Master
120 Posts |
Posted - 2010-08-18 : 08:03:00
|
whether the logged in user have the right to grant access ?? |
 |
|
|
|
|