[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

database recovery of SQL using VB

Posted on 2001-09-14
3
Medium Priority
?
159 Views
Last Modified: 2010-05-02
hi..
my prob is..... i want to make a utility that can recover the database structure and that default data using visual basic and sql server 7 ...i m not so familiar with ms-sql....so i need some help from ur side...
if u think...u can help me...then plz give me the description...and ask me if u have some doubt regarding the que...
and ya if u can give me some logic abt this que and data-back-up utility...then it'll be better..for me

thanks
bye bye
me...
0
Comment
Question by:memyselfandvb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 2

Accepted Solution

by:
TravisHall earned 1200 total points
ID: 6489178
Well, there's no way you could ever recover the database structure without recording what that structure is in the first place, so your utility would have to do that. However, if you are even contemplating this, you must have SQL Server 7 already, and SQL Server 7 has what basically amounts to a built-in utility to do this.

To use this, open the SQL Server Enterprise Manager (management tool installed with SQL Server, basically). Select your database on the left - it's under Console Root -> Microsoft SQL Servers -> [whatever your server group is - probably SQL Server Group] -> <your server name> -> Databases. Check that Taskpad is selected under the View menu. In the right pane, make sure that General is selected at the top. Then click on "generate SQL scripts", under Database on the right.

A spiffy dialog will pop up and ask what you want to script. Just check the "Script All Objects" box to get the entire database. You probably also want to check out the Options tab, to make sure you script triggers and security objects and such. Then just click OK and tell it where to save your script, and it'll do it for you.

What you end up with is an SQL script which will build your entire database structure from scratch. You just need to create the database itself (not anything in it, like tables and such), open the script in Query Analyzer (look in the same place you find Enterprise Manager), and hit the green-arrow go button, and it'll build the whole thing for you.

OTOH, if you want to have some data stored in the tables to start with, this won't work. It just gives the database structure, and I'm not sure if what you mean by "default data" is some starting data in the database. If this is what you want, you should simply make a backup of your database in its original form. Then, to set it up on a different server, just restore from that backup. With SQL Server, you don't have to restore to the same server that to backup came from, and you can create extra copies of a database this way.

If you are working with SQL Server in any serious capacity, you should learn about SQL Server backups. There's far more to it than I can give you here, but it's pretty straightforward. Check it out in SQL Server Books Online.

None of this uses VB, of course, by why use VB when the utilities to do the job come ready-made with MSSQLServer7?
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7208430
Hi memyselfandvb,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept TravisHall's comment(s) as an answer.

memyselfandvb, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 5

Expert Comment

by:Netminder
ID: 7241244
Per recommendation, force-accepted.

Netminder
CS Moderator
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question