Click here to Skip to main content
15,911,030 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear All,

Please get me knowledge to make .exe or patch installer with support of sql scripts.


Pranav
Posted
Comments
Sandeep Mewara 26-Feb-11 8:55am    
Not clear. Are you looking for an installer (exe)(delivered as a patch) to install some SQL scripts?
pranav82 26-Feb-11 8:56am    
Yes Boss, I want installer to install my sql scripts.

At the simplest level you can create a batch file to run your sql scripts.

Something like:
MSIL
cd "C:\Program Files\Microsoft SQL Server\100\Tools\Binn"
SQLCMD -E -S .\SQLExpress2008 -i "E:\SQLExpress 2008\Publishers\InstPubs.sql" -o "E:\SQLExpress 2008\Publishers\InstPubs.rpt"


Look up SQLCMD[^] here.

You can write a PowerShell script to do it as here[^]

You can use SSMS (Sql Server Management Studio) to schedule a job: as here[^]

Or you can write an application in the language of your choice to do it for you.
 
Share this answer
 
Comments
Espen Harlinn 26-Feb-11 9:52am    
Good advice - my 5
Sergey Alexandrovich Kryukov 26-Feb-11 11:20am    
Agree. My 5.
--SA
You might actually want to create an exe for your entire application and include the sql script install into the project.
 
Share this answer
 

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