0

I have an SQL script file which it has big size " 1.4 GB " when I try to open it in SQL SERVER Management Studio it fails and give me message

The System can't find the file specified

when I try to open it with notepad++

file is too big to be opened by notepad++

so does it there anyway to open this script ?

5
  • You want to run it only or open it to see and work on it in SSMS? Commented Aug 10, 2016 at 7:05
  • You can open it in WordPad... WordPad can open files of up to dozens of GB. Won't be a pleasure though with that size. Commented Aug 10, 2016 at 7:08
  • I want to open it then execute the script Commented Aug 10, 2016 at 7:12
  • @Adwaenyth I'm trying to open it with wordpad right now i don't know how much time does it need I have been waiting about 1 min Commented Aug 10, 2016 at 7:14
  • 1
    User sqlcmd tool for execute the file Check these posts. Commented Aug 10, 2016 at 7:17

1 Answer 1

0

Run this command in Command prompt by providing the required details. This command would execute the SQL file without opening the file.

sqlcmd -S <ServerName> -U <LoginUser> -P <Password> -d <DatabaseName> -i <Inputfilenamewithpath> -o <Outputfilenamewithpath>
Sign up to request clarification or add additional context in comments.

6 Comments

what if I want to change the used database in script because when create the script the use XXXDb command for that DB will be in the first line
Regenerate your SQL script without using "USE" statement Or else you should edit the Use XXXDb with your desired DBname by opening the SQL script.
here's the problem that I can't find a tool can open that file to edit it otherwise i have to read and edit it programmatically
You said you cannot open that file then how do you say that file has Use statement....
because when I create an Sqlscript in management studio the use statement will be in the first line
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.