|
Posted by Erland Sommarskog on 07/13/07 21:45
Limunski Magarac (limunski_magarac@yahoo.com) writes:
> CREATE DATABASE [six] ON (NAME = N'six_Data', FILENAME = N'E:
> \Databasepath\six_Data.MDF' , SIZE = 1, MAXSIZE = 20,
> FILEGROWTH = 10%) LOG ON (NAME = N'six_Log', FILENAME = N'E:
> \Databasepath\six_Log.LDF' , SIZE = 1, MAXSIZE = 20, FILEGROWTH
>= 10%)
> COLLATE SQL_Latin1_General_CP1_CI_AS
> GO
The SIZE and MAXSIZE values, from where did you get these? Out of
thin air? Or is there is a limit of 20 MB in the terms of service?
20 MB is quite small size. Not the least for the log file. And if
20 MB is indeed the size, there is little reason to fiddle with
autogrowth - create it to 20 MB directly.
Also, I would question the choice of collation. Given your name and
that you appear from post from Germany, I think you should pick a
different collation.
> exec sp_dboption N'six', N'autoclose', N'false'
> GO
Good!
> if not exists (select * from dbo.sysusers where name =
> N'guest' and hasdbaccess = 1)
> EXEC sp_grantdbaccess N'guest'
> GO
Eh? Any particular reason you enable guest? Particularly at a web
host, I would not recommend this.
> if not exists (select * from dbo.sysusers where name =
> N'sinisam')
> EXEC sp_grantdbaccess N'magarac', N'magarac'
> GO
>
> exec sp_addrolemember N'db_owner', N'magarac'
> GO
Hm, wouldn't be better to make the user the owner of the database?
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Navigation:
[Reply to this message]
|