Home > Archive > SQL server exams > August 2002 > Coco's Question of the Week:





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Coco's Question of the Week:
cocolocopolo

2002-08-06, 11:16 pm

From ExamCram "SQL Server 2000 Database Design" (ISBN 1588800342, Authors: Richard Alan McMahon, Sr. and Sean Chase, Publisher: Coriolis) page 57, under "The Northwind Database, the second paragraph

"Both the pubs and Northwind databases contain scripts, located in the
\Install directory, that will let you rebuild the databases if they are removed. You can simply execute instpubs.sql or instnwnd.sql to reinitiate the database you want to rebuild. This is a handy feature
because you an experiment freely upon either sample database (or both) with the comfortable knowledge that you can simply rebuild them and start again."

Som I located MSSQL\Install to get instpubs.sql (or insnwnd.sql),
double-click, and got a "caution" window. It says: "You are attempting to open a file of type 'SQL script file' (.sql). These files are used by the operating system and by various programs. Editing or modifying
them could damage your system. If you still want to open the file, click Open With, otherwise, click Cancel." Below these three sentences, there are two buttons: "OPen With" and "Cancel".

Click on "Cancel", everything disappears. But if click on "Open With" button, it comes up "Open With" window with a list of varous
program that you can select to open the .sql.

I tried to get anything related to Microsoft SQL, but nothing with SQL is listed. Now what shall I with abovementioned instruction to rebuild pubs and Northwind ???

1. ^%K*&)@_! Come on. Don't post this stupid thing here.
2. Call Microsoft's technical support.
3. It is only Coco's own problem as my system works this way.
4. There is an answer in ExamNote's Forum.
sallama18

2002-08-07, 3:13 am

use sql query analyzer.Open with notepad then copy all text and paste query windows and press F5 that is okey.

I want to ask how this scrip files created using sql enterprise maneger for rebuild to dtabase...
Ryzor

2002-08-07, 7:00 am

To build your scripts using SQL Server Enterprise Manager highlight the db you want scripted then select Tools/Database Scripting... off of the menu bar.
necrophantasm

2002-08-07, 8:10 am

Looks like Salama is right. I tried to find a way that you could call a script in a stored procedure or external API or something.. but all SQL help has to tell me on them is this:



Transact-SQL Scripts
A script is a series of Transact-SQL statements stored in a file. The file can be used as input to SQL Query Analyzer or the osql and isql utilities. The utilities then execute the SQL statements stored in the file.

Transact-SQL scripts have one or more batches. The GO command signals the end of a batch. If a Transact-SQL script does not have any GO commands, it is executed as a single batch.

Transact-SQL scripts can be used to:

Keep a permanent copy of the steps used to create and populate the databases on your server (a backup mechanism).


Transfer the statements from one computer to another, when necessary.


Quickly educate new employees by enabling them to find problems in the code, understand the code, or change the code.





According to them the only thing they are good for is storage. Looks like copy/paste is the only way to resolve your problem. Good question Coco!
cocolocopolo

2002-08-07, 10:39 pm

Thanks necrophantasm,Ryzor and sallama18 (alphabetical order).

Now I got one more lesson.

Thanks again.
Sponsored Links





Free Braindumps | MCSE braindumps software forum

Copyright 2003 - 2008 examnotes.net