Showing posts with label Run. Show all posts
Showing posts with label Run. Show all posts

Thursday, April 25, 2013

Run Package in 32 Bit\ 64 Bit Mode from Command Prompt

This is an extension to my earlier post

On a 64 bit OS, the default path to the 64 bit would be "c:\Program Files\Microsoft SQL Server\100\DTS\Binn\DTExec.exe"

Still on 64 bit OS, the path to the 32 version would be "c:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\DTExec.exe"

Following is the code to run an SSIS package from command prompt:

1. RUN In 32 Bit mode:

[code]
"c:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\DTExec.exe" /file C:\PackageFolder\Package.dtsx /CONF C:\ConfigFile.dtsConfig
[/code]

2. RUN In 64 Bit mode:

[code]
"c:\Program Files\Microsoft SQL Server\100\DTS\Binn\DTExec.exe" /file C:\PackageFolder\Package.dtsx /CONF C:\ConfigFile.dtsConfig
[/code]

Sunday, March 31, 2013

Sql Server 2008,2012: Run Sql Script File From Command Line

To Start Sql Command reform following link:
http://msdn.microsoft.com/en-us/library/ms166559(v=sql.105).aspx

Run the following command in the command prompt.

Replace "C:\myScript.sql" with the location of your sql code file location.

[code language="sql"] sqlcmd -S myServer\instanceName -i C:\myScript.sql[/code]

The above command will return the result set in command prompt.

If you prefer the result in a text file use the code below:

[code language="sql"] sqlcmd -S myServer\instanceName -i C:\myScript.sql -o C:\EmpAdds.txt[/code]

Happy Coding :)