Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
aleroot
Starting Member
1 Post |
Posted - 2010-02-14 : 10:41:06
|
I'm new of sql server express, i ever used mysql.with mysql i can dump a database with mysqldump in a text file .SQL and i can import a this dump file directly from mysql ...Can i do the same thing with SQLCMD or OSQL in the SQL Server command line ? |
|
jackv
Master Smack Fu Yak Hacker
2179 Posts |
Posted - 2010-02-14 : 10:51:07
|
bcp would be ok. Also worth exporting structure to reference referential integrityJack Vamvas--------------------http://www.ITjobfeed.com |
 |
|
Kristen
Test
22859 Posts |
Posted - 2010-02-14 : 11:25:22
|
SQL 2008 can create a script for all tables etc., and also all data |
 |
|
Kristen
Test
22859 Posts |
Posted - 2010-02-14 : 11:26:23
|
P.S. If you just want to move a database from A to B (without editing it on the way with a text editor) then just use BACKUP and RESTORE. |
 |
|
haryiips
Starting Member
2 Posts |
Posted - 2010-02-15 : 07:53:50
|
Pretty simple steps to follow :Install SQL server management studio 2005/08 Once configured, connect by providing authetication windows or sqlImportant steps to backup data : example adventurework database1. expand database available2. right click on advanturework dbase3. select option "tasks"4. Select "backup"5. In new pop up window- name the backup file (as you like)6. At the bottom, assign the path for file to be stored on hard disk (Ex : c:/....../desktop)7. Backup created successfully.For script : notice on script icon at top of pop up windowclick on script to generate on new sql windowFor help : A sample script for AdvantureWork database is provided hereBACKUP DATABASE [AdventureWorks] TO DISK = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\AdventureWorks.bak', DISK = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\trial up back' WITH NOFORMAT, NOINIT, NAME = N'AdventureWorks-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10GO"For-warned is For-armed" |
 |
|
haryiips
Starting Member
2 Posts |
Posted - 2010-02-15 : 07:57:02
|
Restore : On the footstep of backing up data - as shown aboveYou can restore database choosing restore option in place of backupA sample script for backup : Sample AdventureWork RESTORE DATABASE [AdventureWorks] FROM DISK = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\AdventureWorks.bak', DISK = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\trial up back' WITH FILE = 1, NOUNLOAD, STATS = 10GO |
 |
|
|
|
|
|
|