Jasinski Technical Wiki

Navigation

Home Page
Index
All Pages

Quick Search
»
Advanced Search »

Contributor Links

Create a new Page
Administration
File Management
Login/Logout
Your Profile

Other Wiki Sections

Software

PoweredBy

Page History: Deploying a Database - SQL Server

Compare Page Revisions



« Older Revision - Back to Page History - Current Revision


Page Revision: Thu, Oct 13, 2011, 2:08 PM


When deploying a SQL Server database for the first time, in addition to distributing the BAK file, you will probably need to create the user and login used by the connection string in your configuration file(s). The following script will do this.

USE [master]
GO
CREATE LOGIN [<span class='param'>MyUser</span>] WITH PASSWORD=N'<span class='param'>MyUser</span>', DEFAULT_DATABASE=[master], 
    CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF
GO
USE [CSTE]
GO
exec sp_change_users_login @Action='Update_One', @UserNamePattern = '<span class='param'>MyUser</span>', @LoginName ='<span class='param'>MyUser</span>'
GO

ScrewTurn Wiki version 3.0.1.400. Some of the icons created by FamFamFam. Except where noted, all contents Copyright © 1999-2024, Patrick Jasinski.