Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi all,

Please help me out to solve this issue.

Is there any way to convert more than one .sql file to .exe/Executable file .

In our application, we are using more than 400 tables and more than 500 sp's. while releasing time, currently we are giving each sp / table / view / etc are separate file(.sql file) so count of the file is very high.

In client side, client will open each file and execute. its a very heavy task so there is any way to convert the .sql file to executable file?
Posted
Updated 22-May-18 22:47pm
Comments
Maciej Los 18-Jul-13 4:35am    
I'm not sure what you want to achieve, but it sounds like you're giving permission to modify database without any control!
You need to re-think it!
Shanalal Kasim 18-Jul-13 6:56am    
Thanks for your comments. Actually i need, how to execute bulk script file in client side.
My idea is creating a exe that contain all script file, running that in client side.
please provide any suggestion for achieving this
Maciej Los 18-Jul-13 7:28am    
Sorry, but this is a poor idea ;(
If i understand you well, you want to create database and its objects using all those scripts. Am i right?
Shanalal Kasim 18-Jul-13 7:42am    
No. In first time we are executing all script from our side so there no problem. while releasing new version that contain script file related to that release that will executed by client. so we need to simplify the step.
Maciej Los 18-Jul-13 9:06am    
Can't you just use an installer?

May be you could try using SQLPACKAGE.exe and create batch files (.bat) and run them as executable
 
Share this answer
 
Comments
CHill60 23-May-18 8:11am    
I think that you were downvoted because the original question was 5 years old. However I believe your suggestion is a valuable contribution albeit not well explained (.bat vs executable). I've upvoted this solution for that reason.
You can not convert an sql script to executable. This is clear nonsense.
Still, your requirement itself makes sense.
First of all, you can concatenate the scripts, thus you can get a single one.
You can also use sqlcmd utility[^] to execute the scripts. So you can simply create a batch or vbs script that scans a folder for files with sql extension for example and executes them one by one. Or you can use even powershell for that.

Of course, you could convert your sql files to resources, and embed them into an executable that is will execute them against the sql server and the database[^]. But you have to consider if you really need this. It depends on how experienced users will use this at the end for example. If the client could live with executing scripts one by one, a simple batch script would be also a huge leap, but for users without any SYSDBA experience I would make this executable. But again: it is not a "conversion". You need to make one for your own purposes.
 
Share this answer
 
Hi,
what ever i understood by your statement you can achieve your goal in following way...
you can generated script for that.

1) just Right click on your database.
2)go to task
3) select "Generate Scripts"
4) follow the steps as per instructions given on the screen.
and there you go..

for details go through the below link..


http://blog.sqlauthority.com/2011/05/07/sql-server-2008-2008-r2-create-script-to-copy-database-schema-and-all-the-objects-data-schema-stored-procedure-functions-triggers-tables-views-constraints-and-all-other-database-objects/[^]
 
Share this answer
 
Comments
mahadeva vamsi krishna 30-Mar-15 6:45am    
how to generate a msi file for a each sql tables

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900