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: 8392     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: SQL Server

Related Messages

Subscribe to Subscribers
Awards & Gifts
Talk to Webmaster Tony John

Online Members

Tara Prasad
More...
Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India