HTTP/2 200
date: Thu, 31 Jul 2025 07:20:58 GMT
content-type: text/html; charset=UTF-8
content-length: 36728
vary: Accept-Encoding
server: Pagely-ARES/1.22.2
x-gateway-request-id: 399248cb4878994fb9d48972b00e0938
access-control-allow-methods: GET,POST
access-control-allow-headers: Content-Type, Authorization
content-security-policy: upgrade-insecure-requests;
cross-origin-embedder-policy: unsafe-none; report-to='default'
cross-origin-embedder-policy-report-only: unsafe-none; report-to='default'
cross-origin-opener-policy: unsafe-none
cross-origin-opener-policy-report-only: unsafe-none; report-to='default'
cross-origin-resource-policy: cross-origin
permissions-policy: accelerometer=(), autoplay=(), camera=(), cross-origin-isolated=(), display-capture=(self), encrypted-media=(), fullscreen=*, geolocation=(self), gyroscope=(), keyboard-map=(), magnetometer=(), microphone=(), midi=(), payment=*, picture-in-picture=*, publickey-credentials-get=(), screen-wake-lock=(), sync-xhr=*, usb=(), xr-spatial-tracking=(), gamepad=(), serial=()
referrer-policy: strict-origin-when-cross-origin
strict-transport-security: max-age=31536000; includeSubDomains; preload
x-content-security-policy: default-src 'self'; img-src *; media-src * data:;
x-content-type-options: nosniff
x-frame-options: sameorigin
x-permitted-cross-domain-policies: none
link:
; rel="https://api.w.org/",
; rel="alternate"; title="JSON"; type="application/json", ; rel=shortlink
vary: Accept-Encoding
content-encoding: gzip
x-xss-protection: 1; mode=block
feature-policy: fullscreen 'none'; microphone 'none'
x-gateway-cache-key: 0|standard|https|knowledgebase.apexsql.com|||/how-to-execute-large-sql-scripts/
x-gateway-cache-status: MISS
x-gateway-skip-cache: 0
How to execute large SQL scripts
Applies to
ApexSQL Data Diff , ApexSQL Diff , ApexSQL Log , ApexSQL Recover
Summary This article shows how to execute large scripts created by ApexSQL tools which are too big to be opened or executed by SQL Server Management Studio Query Editor
Description Synchronization scripts, undo and redo scripts, and recovery scripts generated by ApexSQL tools can be so big that SQL Server Management Studio Query Editor can’t open and execute them
To run these scripts use:
The osql command line utility that comes with SQL Server:
osql -H <computer_name> -S <instance_name> -U <username> -P <password> -i <path>
The sqlcmd command line utility that comes with SQL Server:
sqlcmd -S <computer_name\instance_name> -d <database_name> -i <path> -o <output>
ApexSQL Run Script:
Download ApexSQL Run Script
Unzip it into a folder
Use the Command line and navigate to the folder where the file was unzipped
Run the utility with the following parameters:
ApexSqlRunScript <computer_name\instance_name> <database> <path>
Last updated
October 08, 2014