0

I am trying to give users different grants into a database. I Know how to do this graphically in SQL Server 2008, but how can I do this with SQL code.

I know to do this for a table for example

GRANT SELECT, INSERT, UPDATE ON dbo.YourTable TO YourUserName

But how to make this not only for one table but for the entire DB. I have tried it like above with the name of database , but it does not function....How can I do this? Please help me?

user3272713
  • 167
  • 2
  • 5
  • 15

1 Answers1

1

If you know how to do it graphically (I assume you mean with SSMS or another tool), than turn on the SQL Profiler and capture the TSQL statements that SSMS emits when it does it - you can learn exactly how to do any such task.

E.J. Brennan
  • 45,870
  • 7
  • 88
  • 116
  • I dont have SQL Profiler in my SQL Server, because I dont have SQL SErver Express or R2, but only sql server 2008, ant it does not have ethis option – user3272713 Feb 25 '14 at 14:44