Sql-server – Shortest method to upload database to server

backupsql serversql-server-2008-r2

I have a SQL Server script file which ranges size of 3gb and I am in need to upload the script file to an external server.

i generated script for my 6gb database by following these steps

right-clicked the database–>tasks—>genrate scripts–>script entire database and objects and at scripting options i clicked advance –>type of data to script–>set it as schema and data and finished the data..

What are the shortest methods to upload faster into the server?

Best Answer

If by "SQL Server script file" you mean a generated file with lots (and lots) of inserts to recreate your data then I would recommend a different approach.

I'd personally go with a database backup (why aren't you using that), but failing that I'd probably use a BCP extract. As a BCP exports the data in the format its stored you should get a smaller file. You can then compress this too with your choice of compression tool (e.g. zip).

Couple of notes on BCP:

  • You dont get a script with the table definitions - you'll still need to create these. You do get a format file which would help you reconstitute a table structure (to a point - e.g. no index info)
  • You will need to generate an extract per table - you dont get a single extract for all data in the database. Use a database backup for that.
  • BCP isn't the easiest tool in the world to use.