MS SQL Server: How can I add new login and grand permissions for DB using T-SQL

$0
=
$0
+
$0
No specific Bitcoin Bounty has been announced by author. Still, anyone could send Bitcoin Tips to those who provide a good answer.
0

I need to be able to establish an ODBC connection through SQL Server authentication.

How can I grant permissions for an user with ALL rights on DB?

Please help :)

Tags: ,

1 Answer - total earned - 0 BTC ($0 USD)

1
=
0
=
$0
Internet users could send Bitcoin Tips to you if they like your answer!

I found solution:

CREATE DATABASE <DB name>
CREATE LOGIN <login name> WITH PASSWORD = 'aaaaaa' with default_database = <DB name>
GO
USE <DB name>
CREATE USER <User name> FROM LOGIN <login name>
EXEC sp_addrolemember 'db_owner', '<User name>'
GO

It's all :)

SEND BITCOIN TIPS
0

Post Answer