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 |
|
boreddy
Posting Yak Master
172 Posts |
Posted - 2010-02-24 : 23:55:12
|
| When i am adding roles on a xp machine, using transactions of SQL it is working fine.But i am facing problems with a VISTA machine, as the same script with transactions is not creating roles on VISTA machine.this is the my procedure and executonCreate PROCEDURE [dbo].[spGrantPermissions]@Name varchar(100)ASBEGIN-- SET NOCOUNT ON added to prevent extra result sets from-- interfering with SELECT statements.SET NOCOUNT ON;DECLARE @String varchar(1000),@String1 varchar(1000),@String2 varchar(1000),@UserIP varchar(50)Begin trybegin transaction SET @String1 = ' CREATE USER ['+ @Name +']'EXEC (@String1)SET @String1 = ' EXEC sp_addrolemember'+ '''' + 'db_owner' + '''' + ',' +'[' + @Name +']' EXEC (@String1)Commit Transaction End tryBegin catchrollback transaction end catchENDthe below is the exicution(in xp os it is working fine(adding the roles) but in vista it is not working(not adding the roles))declare @Host varchar(200)set @Host = (select host_Name())set @Host = @Host+ '\ASPNET'--one executionexec spGrantPermissions @Host--second executiopnset @Host = 'NT AUTHORITY\NETWORK SERVICE'exec spGrantPermissions @Host |
|
|
pk_bohra
Master Smack Fu Yak Hacker
1182 Posts |
Posted - 2010-02-25 : 00:07:20
|
| Why u are creating another thread for same question..http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=140239 |
 |
|
|
|
|
|