•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the MS SQL section within the Web Development category of DaniWeb, a massive community of 455,974 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,766 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MS SQL advertiser: Programming Forums
Views: 797 | Replies: 3
![]() |
•
•
Join Date: Nov 2007
Posts: 2
Reputation:
Rep Power: 0
Solved Threads: 0
Recently had to re-install all of pc...not a prob as all (except db) was backed up to seperate hd. I develop locally using MSSQL client tools and adp's and then upload new tables as and when ready. I had done quite a bit of work when pc died, and now have to recreate half a dozen tables plus repopulate data.
Can I make a 'create table' sql code which I can then run to restore tables, or is there another way?
Thanks in advance.
Can I make a 'create table' sql code which I can then run to restore tables, or is there another way?
Thanks in advance.
Hi,
There are 2 ways, detach, backup, and attach. Or generate Script.
First the first one you will need to right click database and in all tasks sub menu choose detach database. Now go to the C:\Program Files\Microsoft SQL Server\MSSQL$\Data\ and look for the data base name. You will find two files with different extensions. Copy them to the new computer in the same folder and repeat the first step but this time choose Attach DataBase. you will be prompt for DB path and name. Navigate to the folder and choose the .MDF file and that is it.
The easier way is to right click database choose generate script from All Tasks sub menu and the Press show all to choose out the objects you need to script. Press OK and you will be prompt to save the SQL file in some where. Take this file and run it using SQL query Analyzer on the destination computer and it will work.
There are 2 ways, detach, backup, and attach. Or generate Script.
First the first one you will need to right click database and in all tasks sub menu choose detach database. Now go to the C:\Program Files\Microsoft SQL Server\MSSQL$\Data\ and look for the data base name. You will find two files with different extensions. Copy them to the new computer in the same folder and repeat the first step but this time choose Attach DataBase. you will be prompt for DB path and name. Navigate to the folder and choose the .MDF file and that is it.
The easier way is to right click database choose generate script from All Tasks sub menu and the Press show all to choose out the objects you need to script. Press OK and you will be prompt to save the SQL file in some where. Take this file and run it using SQL query Analyzer on the destination computer and it will work.
It is never about the number of languages you know, you either have the logic of programming or you don't ...
Some of the codes I post are collected from different sites during the past couple of years, so I would like to thank them for their help and for enabling me to help.
Some of the codes I post are collected from different sites during the past couple of years, so I would like to thank them for their help and for enabling me to help.
Hi,
You have to ways either export data from MSSQL to Excel or import it from excel to mssql:
For the first choose the database >> right click >> All tasks >> Export data >> choose the data source (the server and data base name) >> press next and choose the destination (Destination as Excel instead of SQL server and then the file name) >> choose the tables to export and press OK.
The second way is to open the excel file >> choose data >> Import External Data >> Import Data >> choose the data source (in your case New SQL Server Connection.odc) >> choose the database and then the tables and that is it.
You have to ways either export data from MSSQL to Excel or import it from excel to mssql:
For the first choose the database >> right click >> All tasks >> Export data >> choose the data source (the server and data base name) >> press next and choose the destination (Destination as Excel instead of SQL server and then the file name) >> choose the tables to export and press OK.
The second way is to open the excel file >> choose data >> Import External Data >> Import Data >> choose the data source (in your case New SQL Server Connection.odc) >> choose the database and then the tables and that is it.
It is never about the number of languages you know, you either have the logic of programming or you don't ...
Some of the codes I post are collected from different sites during the past couple of years, so I would like to thank them for their help and for enabling me to help.
Some of the codes I post are collected from different sites during the past couple of years, so I would like to thank them for their help and for enabling me to help.
![]() |
•
•
•
•
•
•
•
•
DaniWeb MS SQL Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- RETROSPECT Backup software (Windows Software)
- Backup: External USB Disks or NAS storage? (Storage)
- Files Missing with Maxtor One Touch II USB 200GB External HDD (Storage)
- turning internal drives to external drives (Storage)
- cannot mount external drives (Apple Hardware)
- Documents and Settings failed to backup (properly)...... (Windows NT / 2000 / XP / 2003)
- Convert desktop internal sata drive to external laptop drive (Storage)
- Windows Backup (Windows NT / 2000 / XP / 2003)
Other Threads in the MS SQL Forum
- Previous Thread: performance testing problem
- Next Thread: Unusal upgrade issue


Linear Mode