SQL
I do most of my DB work here at my work. If I want to make a copy of the DB for home-use, how do I go about it? I did not keep a copy of the SQL scripts used to create the db. I tried making a backup with enterprise manager and restoring it at home, but it did not work - maybe I did something wrong
thanks
[315 byte] By [
Lorna] at [2007-11-15 17:37:37]

# 1 Re: SQL
First of all, what version of SQL server are you using (at work, and at home). Note that backups from SQL Server 6.5 cannot be restored to SQL server 7 or 2000, and the other way around. If both versions are the same, it should work. Make sure that you selected to make a backup of the entire backup.
You can create scripts using Enterprise manager, but these scripts do not copy the data. They only generate the database.
Tom Cannaerts
slisse@planetinternet.be
Moderator on http://www.vbcodelibrary.co.uk/board
A bottomless pit, I'm sure it came with the place, who would dig one on purpose?
Cakkie at 2007-11-10 0:44:05 >

# 2 Re: SQL
I use SQL 7 at home and work.
I'm not really concerned with copying the data itself, more the table structures etc. How do I create scripts from EM - Import/Export?
Lorna at 2007-11-10 0:45:00 >

# 3 Re: SQL
Yes, if I'm not mistaken does this allow you to create scripts.
Tom Cannaerts
slisse@planetinternet.be
Moderator on http://www.vbcodelibrary.co.uk/board
A bottomless pit, I'm sure it came with the place, who would dig one on purpose?
Cakkie at 2007-11-10 0:46:02 >

# 6 Re: SQL
the script is a transact sql batch file (.sql extension). run it from isql (query analyzer). open query analyzer (from programs/sql server/...), login, make sure the database that isql is pointing to is "master" (the default db when isql opens) then execute the script. this should create the db objects that you specified/checked off in the generate scripts dialog box.
********** check the script first to see if it creates the db at the very beginning. if not, you're going to have to create it manually from enterprise manager ******************