Subscribe to Subscribers
Talk to Webmaster Tony John


Forums » .NET » SQL Server »

Create Batch file for sql server scripts(2008)


Posted Date: 21 Apr 2011      Posted By:: Anbuselvan     Member Level: Bronze    Member Rank: 7773     Points: 1   Responses: 0



Create batch file for Sql server scripts but batch file is error thrown
Error Details
Sqlcmd: Error: Connection failure. SQL Native Client is not installed correctly.
To correct this, run SQL Server Setup.

Pls see following code
@echo off
cls

set /p SName=HDCHCTDAM36893:
set /p UName=traceuser:
set /p Pwd=123456:
set /p DbName=SampleBatch1:

set /p choice=ARE YOU SURE TO EXECUTE SCRIPTS in Samplebatchfile (y/n) ?

if '%choice%'=='y' goto begin
goto end

:begin
sqlcmd -U traceuser -P 123456 -S HDCHCTDAM36893 -v DbName="SampleBatch1" -i "C:\Scripts\Samletable Delete Query.sql"
PAUSE
:end






Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Post Reply
You must Sign In to post a response.

Next : Convert varchar to float
Previous : SQL server - Cross & Outer Apply
Return to Discussion Forum
Post New Message
Category:

Related Messages



Follow us on Twitter: https://twitter.com/dotnetspider

Active Members
TodayLast 7 Daysmore...

Awards & Gifts
Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India
2005 - 2012 All Rights Reserved.
.NET and other trademarks mentioned in this site belong to Microsoft and other respective trademark owners.
Articles, tutorials and all other content offered here is for educational purpose only.
We are not associated with Microsoft or its partners.