Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. Alle Rechte vorbehalten.
C:\Users\jin7>sqlcmd -S
localhost\SQLExpress2005 -Usa
Kennwort:
1> SELECT name from sys.databases
2> Go
name
--------------------------------------------------------------------------------
------------------------------------------------
master
tempdb
model
msdb
(4 Zeilen betroffen)
1>
2>
3>
4>
5> CREATE LOGIN myAppOwner
6> WITH PASSWORD = '...';
7> CREATE USER myAppOwner FOR LOGIN myAppOwner;
8> GO
1>
2>
3> grant create database to myAppOwner;
4> GO
1>
2> :connect
localhost\sqlexpress2005 -U myAppOwner
Kennwort: Sqlcmd: Erfolgreich mit Server '
localhost\sqlexpress2005' verbunden.
1> create database myDatabase;
2> GO
1> SELECT name from sys.databases;
2> GO
name
-------------------------------------------
-------------------------------------------
master
tempdb
model
msdb
myDatabase
(5 Zeilen betroffen)
1>