1

On the surface, i know this file is huge and it sounds like i'm out of hdd space. I have over 193gb available. Now here's my question. I have a .sql file that's 65gb in size. I generated it by right clicking the database and generating scripts. I included the schema and data as well.

I want to run this script so I can have a good copy of the database on my local sql server. I try to open the file in sql server management studio 2012 and i get the following error. enter image description here

I cant backup the database and restore it (the preferred method) so I googled this error but I got results about everything but my issue. What do i need to change in order to open and run this ginormous file. Thanks

BoundForGlory
  • 4,114
  • 15
  • 54
  • 81
  • The SSMS ui can't open a file that big. That is ridiculous to open in a visual editor. What are you actually trying to do? – Sean Lange Jul 16 '14 at 19:35
  • you could potentially try the answer from this question: http://stackoverflow.com/questions/431913/how-do-you-run-a-300mb-ms-sql-sql-file though your file size scares me a bit :P – Kritner Jul 16 '14 at 19:40
  • @Sean = "I want to run this script so I can have a good copy of the database on my local sql server." – BoundForGlory Jul 16 '14 at 19:54
  • I would do this a bit differently. If all you are trying to do is get a copy of a database for use locally why not just restore a backup of it? Then you could drop any of the tables you don't want/need locally. – Sean Lange Jul 16 '14 at 20:12
  • Or use the data import wizard to create an on the fly SSIS package to pull your data to your local instance. No matter how you slice it, a 65GB file just is not a viable option. – Sean Lange Jul 16 '14 at 20:13
  • @Sean: "I cant backup the database and restore it (the preferred method)". I do not have permissions to do so. Or at least i dont think i do because when i backup the database, it runs but no .bak file is generated – BoundForGlory Jul 16 '14 at 20:16
  • If you don't have the permission you would get an error. It won't just run and not create a file. How are you creating a backup? – Sean Lange Jul 16 '14 at 20:41
  • @Sean-right clicking on the database, then Tasks>Backup. I point the .bak file to a place on my hdd, it runs but nothing gets generated (no bak file) – BoundForGlory Jul 16 '14 at 21:01

1 Answers1

1

I doubt that sqlcmd will give you any better results, but here is a reference page sqlcmd

here is a sample: sqlcmd -S myServer\instanceName -i C:\myScript.sql

Dbloch
  • 2,326
  • 1
  • 13
  • 15
  • So this probably will not work: http://connect.microsoft.com/SQLServer/feedback/details/272757/sqlcmd-exe-should-not-have-a-limit-to-the-size-of-file-it-will-process – Dbloch Jul 16 '14 at 19:48
  • Thanks for responding...i'm running the command now. I know it will take awhile. Thanks – BoundForGlory Jul 16 '14 at 19:53