SQLCMD

  • I just need the format to run this from a .bat file using sqlcmd

    USE [XXX]

    GO

    CREATE USER [domain\IamBadAtCmd] FOR LOGIN [domain\IamBadAtCmd]

    GO

    USE [XXX]

    GO

    EXEC sp_addrolemember N'db_datawriter', N'domain\IamBadAtCmd'

    GO

    USE [XXX]

    GO

    EXEC sp_addrolemember N'db_datareader', N'domain\IamBadAtCmd'

    GO

  • forget it. This works but is this how I should do it?

    -q "EXIT(CREATE USER [Domain\Blah] FOR LOGIN [Blahs])"

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply