The following two SQL scripts, that must be executed one after another, will create apache_logs database in Microsoft SQL Server instance, and ApacheLogToDb user with 11223344 password and with permissions to write to apache_logs database.

USE master
CREATE DATABASE apache_logs
CREATE LOGIN ApacheLogToDb WITH PASSWORD = '11223344', DEFAULT_DATABASE = apache_logs

USE apache_logs
CREATE USER ApacheLogToDb FOR LOGIN ApacheLogToDb WITH DEFAULT_SCHEMA = dbo
EXEC sp_addrolemember 'db_ddladmin', 'ApacheLogToDb'
EXEC sp_addrolemember 'db_datawriter', 'ApacheLogToDb'

Last edited Aug 23, 2013 at 12:05 PM by CodeDriller, version 6

Comments

No comments yet.