Hi, HanShi -
When I received your post, I had just run the following commands:
CREATE ROLE testing;
GRANT CREATE TABLE TO testing;
CREATE USER test_user FOR LOGIN [NULL\test_user];
EXEC sp_addrolemember testing, test_user;
(Yes, NULL is the SQL Server domain name on my PC.)
This worked fine, BUT I had said
CREATE ROLE testing;
rather than
USE AdventureWorksDW
CREATE ROLE testing;
Is there any way to tell (preferably via SQL commands, rather than via SQL Server management Studio, but either would be fine), which database my ROLE "testing" got associated with?
Also, do you know if there is a way to create a login (as opposed to creating a USER for a LOGIN) via SQL commands, rather than via SQL Server Management Studio?
Thanks for your help already, and thanks for any further information you could provide.