Is there any way that I can set up permissions on SQL Server 2005 with the use of variables. I am looking to do something like this...
As I have a very long list of permissions, it would save me having to change the login name for each permission.
Any help would be much appreciated.
Thanks
Code:
DECLARE @Login varchar(255)
SET @Login = 'LoginName'
GRANT CONNECT TO QUOTENAME(@Login)
--(ie GRANT CONNECT TO [LoginName])
As I have a very long list of permissions, it would save me having to change the login name for each permission.
Any help would be much appreciated.
Thanks