2

I need to exec this sql query on my Windows SQL Server 2005, can i do this with a batch script?

The sql query

UPDATE VI_CURR_INFO SET 
    ends_days = '2005', 
    check_code = '1', 
    memb_name = '123132', 
    memb_guid = '1', 
    sno__numb = '1', 
    Bill_Section = '6', 
    Bill_Value = '3', 
    Bill_Hour = '6', 
    Surplus_Point = '6', 
    Increase_Days = '0' 

The database name is "test1". How to perform a batch script to do that?

Thanks in advance.

1 Answer 1

1

Create a script file that looks like this:

use test1
go

UPDATE VI_CURR_INFO
SET ends_days = '2005', 
    check_code = '1', 
    memb_name = '123132', 
    memb_guid = '1', 
    sno__numb = '1', 
    Bill_Section = '6', 
    Bill_Value = '3', 
    Bill_Hour = '6', 
    Surplus_Point = '6', 
    Increase_Days = '0'

Save this as a script file (Script1.sql for example). And then use SQLCMD to run the script against an instance:

sqlcmd -S YourServerName[\YourInstanceName] -i C:\YourScriptFileDir\Script1.sql
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.