0

Hi there I want to create a database .bak file using a sql server script file which I made with schema and data option.

The reason to do the same is that the script file is too larger that my SQL Server version 18 is unable to open this. saying file is too large to open. please help me for the same, or there is another way to do the same, please let me know.

my script file name is scriptWebhookDb_UAT.sql

2
  • Can't see your scriptWebhookDb_UAT.sql file. As far as I know, the length of an SQL script is unlimited, so what exactly do you want to achieve? Creating a backup, hence a .bak file, or an sql script having per convention a .sql suffix?
    – Rainer K.
    May 18, 2023 at 13:32
  • How exactly are you trying to open the file?
    – mustaccio
    May 18, 2023 at 13:39

1 Answer 1

3

[...] I want to create a database .bak file using a sql server script file which I made with schema and data option.

There is no direct way as these are two completely different things. You'd need to use the scripts to create a database on an instance and then backup that database.

[...] the script file is too larger that my SQL Server version 18 is unable to open this. saying file is too large to open.

I'd suggest using something such as SQLCMD with the -i option or splitting up the file into smaller chunks of DDL + DML if you want to use SSMS.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.