|
Posted by Limunski Magarac on 07/16/07 11:25
-> Erland Sommarskog ->
Hi Erland,
Thank you for your reply.
Apologies for not responding sooner, but I had a lot on my mind
during weekend time.
> 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.
Actually, I created one database just the way I usually do and
then started 'All Tasks -> Generate SQL Script' to see how .sql
file looks for the newly created databases.
20 MB is just a default size. Many times it's not needed to
increase the size, but if it's necessary, I can always do it
manually.
> 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.
It is the correct one, but I'm glad you noticed :)
> > 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.
Access is granted via group membership. It has 'public' role
membership. But I'll look into this further, thanks for the
heads-up.
> > exec sp_addrolemember N'db_owner', N'magarac'
> > GO
>
> Hm, wouldn't be better to make the user the owner of the database?
Isn't this the exact thing this line does? Sets the user as the
owner?
So in the end, I guess this can be used to script a database
creation?
When the script is called with DBname and username, it should
create the database and a new SQL server login (and set default
database for this login to DBname).
I'm afraid I really do not know how to script a creation of a
new login. I've managed to go this far with scripted creation
of database, and with your help I went even further.
But if you have any advice on adding new SQL logins, link or
any other hint, I'd be more than happy to do more researching.
Thank you for your time,
Six
Navigation:
[Reply to this message]
|