Friday, March 23, 2012

Script to create and load a database

Dear all,
I am very new to SQL Server but must say I find it and the GUI tools
very good.
I am now in a position where I need to supply a client with a script
file to create a database, create tables within it and then load the
tables.
I have a script that will create the tables and also have exported the
contents to comma separated files.
If someone could supply a sample set of script commands that would:
create a standard database
creat a user in it called "foo" and make this user the db owner
create tables owned by foo
load the data from an export file
I would be very grateful.
Also, how would I run such a script.
Thanks in advance
Ed
PS I am willing to learn - if there is a page or manual where I can
find this out myself tell me to RTFM ;-) (But please let me know where
it is!)> If someone could supply a sample set of script commands that would: (...)
> PS I am willing to learn - if there is a page or manual where I can
> find this out myself tell me to RTFM ;-) (But please let me know where
> it is!)
See SQL Server manual - "SQL Books Online" \Microsoft SQL
Server\80\Tools\BOOKS\SQL80.col
Online MSDN resources on SQL2k -
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnanchor/html/sqlserver2000.asp
> Also, how would I run such a script.
In SQL Query Analyzer
sincerely,
--
Sebastian K. Zaklada
Skilled Software
http://www.skilledsoftware.com
This posting is provided "AS IS" with no warranties, and confers no rights.

No comments:

Post a Comment