Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Query error

Author  Topic 

Hinduson
Yak Posting Veteran

69 Posts

Posted - 2014-11-01 : 17:58:21
Am on the Microsoft website and learning how to CREATE A LOGIN
Below is the article and after i tried it on my sql server i keep getting this error message ..:

To create a new Windows account
Click Start, click Run, in the Open box, type %SystemRoot%\system32\compmgmt.msc /s, and then click OK to open the Computer Management program.
Under System Tools, expand Local Users and Groups, right-click Users, and then click New User.
In the User name box type Mary.
In the Password and Confirm password box, type a strong password, and then click Create to create a new local Windows user.
To create a login
In a Query Editor window of SQL Server Management Studio, type and execute the following code replacing computer_name with the name of your computer. FROM WINDOWS indicates that Windows will authenticate the user. The optional DEFAULT_DATABASE argument connects Mary to the TestData database, unless her connection string indicates another database. This statement introduces the semicolon as an optional termination for a Transact-SQL statement.

CREATE LOGIN [computer_name\Mary]
FROM WINDOWS
WITH DEFAULT_DATABASE = [TestData];
GO

Msg 15401, Level 16, State 1, Line 2
Windows NT user or group 'computer_name\mbabe' not found. Check the name again.



Best Regards.

gbritton
Master Smack Fu Yak Hacker

2780 Posts

Posted - 2014-11-02 : 13:54:00
Windows will look for the user in the local machine, if you specify the local machine name ( is it really called 'computer_name'?) or in Active Directory for non-local names
Go to Top of Page
   

- Advertisement -