Sethu's blog

April 4, 2012

Run multiple SQL script files using Invoke-SqlCmd ( SQL Powershell)

Filed under: Uncategorized — sethusrinivasan @ 10:57 am

# Right click on Server in Object Explorer ( SQL Management Studio)

# Select Start Powershell, In Powershell  window, type in following command. replace c:\sqlscripts with  your own folder

dir C:\sqlscripts\*.sql | foreach-object { invoke-sqlcmd -InputFile $_.FullName }

 

Theme: Rubric. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.