RE: Transact: GRANT LOGIN
- From: Linchi Shea <LinchiShea@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 19 Jul 2009 19:00:00 -0700
If you do a sp_helptext 'sp_grantlogin', you'll see the folllowing code
segment:
-- DISALLOW SQL LOGIN (IE. MUST BE 'DOMAIN\USER') --
if (charindex('\', @loginame) = 0)
begin
raiserror(15407, -1, -1, @loginame)
return (1)
end
In other words, you can use sp_grantlogin to create a SQL login. If you are
CREATE LOGIN, continue to use it and you don't need to use sp_grantlogin.
Linchi
"Bruno" wrote:
Hi All,.
I am trying to programatically manage user accounts (SQL Server 2005
Express).
At this stage I am really only issuing transact commands from within
Management Studio Express and see how they work. later I'll
encapsulate those in my Delphi application.
So far, all I can do is create a new login. I understand that I also
need to GRANT login as well as select, insert, update, delete rights
to any new user.
I have looked up the syntax for doing this, but when trying to grant
login rights to a newly created user, I get an error message.
This works:
create login testUser with password = 'testpsw'
But this doesn't:
exec sp_grantlogin 'testUser'
SQL Server says that 'testUser' is not a valid Windows NT name, and
asks me to provide a complete name: <domain\username>.
I want users to login with SQL, not Window authentication. Why should
I providea domain\username?
Thanks for any thoughts on this.
Bruno.
- Follow-Ups:
- Re: Transact: GRANT LOGIN
- From: Bruno
- Re: Transact: GRANT LOGIN
- References:
- Transact: GRANT LOGIN
- From: Bruno
- Transact: GRANT LOGIN
- Prev by Date: Re: AdventureWorks scripts
- Next by Date: Litespeed - VDI memory?
- Previous by thread: Transact: GRANT LOGIN
- Next by thread: Re: Transact: GRANT LOGIN
- Index(es):
Relevant Pages
|