• TDuffy (4/11/2008)


    Nice article thanks.

    One thing I found interesting in 05 is that when you use the UI to script an existing login, it still uses the old syntax!

    /****** Object: Login [aamin] Script Date: 04/11/2008 09:58:34 ******/

    EXEC master.dbo.sp_addlogin @loginame = N'mylogin', @passwd = @randomPwd, @defdb = N'master', @deflanguage = N'us_english'

    Check to see what version of SQL Server SSMS is set to script for (Tools | Options | Scripting | and under General scripting options check Script for server version). If it's set for SQL Server 2000, then the script makes sense. Otherwise, it should be scripting for SQL Server 2005, which means using CREATE LOGIN syntax.

    K. Brian Kelley
    @kbriankelley