
Code
use [Northwind]
if not exists (select * from master.dbo.syslogins where loginname=N'northwindUser')
begin
exec sp_addlogin 'northwindUser','north@wind1','Northwind'
exec sp_grantdbaccess 'northwindUser'
exec sp_addrolemember 'db_owner','northwindUser'