Click here to Skip to main content
15,039,359 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi Friends,

I came across one of the issue that is One Database "TestDB" which has an "TestAdmin" User, I am creating new database using sql script "TestNewDB", I want to give access "TestAdmin" to access "TestNewDB" database.

How could we do that using sql script.Please suggest.

Thanks & Regards,
deepakaitr12345
Posted

1 solution

You need to use GRANT (Transact-SQL)[^].
Something like:
SQL
USE TestNewDB;
GRANT ALL TO TestAdmin;
GO

Hope this helps.
   
Comments
deepakaitr12345 4-Nov-15 4:09am
   
Thanks philo..
Link is very useful and it gives me the idea to make my problem resolved.

Thanks
phil.o 4-Nov-15 4:14am
   
You're very welcome. Happy coding.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900