I am using a script to create a new user for logging in. When I do in script, the user looks fine in the enterprise manager, but I cannot use his user/pass to log in.If I create the user, using enterprise manager. I have no problems.Can someone tell me what I am doing wrong?if not exists (select * from master.dbo.syslogins where loginname = N'Web')BEGIN declare @logindb nvarchar(132), @loginlang nvarchar(132) select @logindb = N'Web', @loginlang = N'us_english' if @logindb is null or not exists (select * from master.dbo.sysdatabases where name = @logindb) select @logindb = N'master' if @loginlang is null or (not exists (select * from master.dbo.syslanguages where name = @loginlang) and @loginlang <> N'us_english') select @loginlang = @@language exec sp_addlogin N'Web', null, @logindb, @loginlangENDGOif not exists (select * from dbo.sysusers where name = N'Web' and uid < 16382) EXEC sp_grantdbaccess N'Web', N'Web'GOexec sp_addrolemember N'db_datareader', N'Web'GOexec sp_addrolemember N'db_datawriter', N'Web'GOexec sp_addrolemember N'db_owner', N'Web'GO
Error I receive:Server: Msg 18456, Level 16, State 1[Microsoft][ODBC SQL Server Driver][Sql Sever] Login failed for user 'Web'