0

I have a deployment script that installs a database, a login and a user for the database (using the login). Everything works but for some reason, the password does not match the one specified in the script. The script looks like:

USE [master]
GO
CREATE DATABASE TestDB;
GO
ALTER DATABASE [TestDB] SET COMPATIBILITY_LEVEL = 100
GO
ALTER DATABASE [TestDB] SET ANSI_NULL_DEFAULT OFF
GO
::
IF NOT EXISTS (SELECT * FROM sys.server_principals WHERE name = N'TestDBUser')
    CREATE LOGIN [TestDBUser] WITH PASSWORD='TestPassword', DEFAULT_DATABASE=[TestDB], DEFAULT_LANGUAGE=[us_english], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF
GO
USE [TestDB]
GO
CREATE USER [TestDBUser] FOR LOGIN [TestDBUser] WITH DEFAULT_SCHEMA=[dbo]
GO
EXEC sp_addrolemember db_datareader, [TestDBUser] 
GO
EXEC sp_addrolemember db_datawriter, [TestDBUser] 
GO
::

In SQL Server Management Studio I can open the properties of the Login and change its password (it appears it has one character less) and then everything works as expected. Why does SQL not take the literal password and how can I make it work?

BramVader
  • 43
  • 5
  • Do you enable mixed mode authentication? Check out this solution: http://stackoverflow.com/questions/1393654/how-can-i-change-from-sql-server-windows-mode-to-mixed-mode-sql-server-2008 – Malibu Dec 08 '14 at 16:41
  • have you followed any documentation? http://msdn.microsoft.com/en-us/library/ms189751.aspx – unixmiah Dec 08 '14 at 16:42
  • The number of dots in the password field has nothing to do with the actual length of the password. – Jim Dec 08 '14 at 17:14
  • @nabeyakiudon: I've enabled mixed mode, otherwise I even couldn't use the Login after changing the password. – BramVader Dec 08 '14 at 22:05
  • @unixmiah: Yes I've read the documentation to the letter, searched the web, but it seems that I'm the only one who experiences this problem... – BramVader Dec 08 '14 at 22:07

0 Answers0