Click here to Skip to main content
15,887,297 members

Comments by vijay kumar sahu (Top 2 by date)

vijay kumar sahu 25-Jan-17 8:02am View    
Ohhh!!! Yes its "because".

I have tried this below code and it's working fine for me.


osql -S GH-85HKG32\SQL2012 -E  -i "C:\path\Test.sql" -o "C:\path\defragIndexesLog.txt"
vijay kumar sahu 24-Jan-17 6:27am View    
After reading all the above comments by the experts I have tried it but seems like
it's not working for me. Could anyone check if I am doing something wrong.

Here is the bat file with command.
sqlcmd -S .\sqlexpress -E -i "C:\Vijay Sahu\Official\DB Queries\MCX_Test.bat" -o "C:\Vijay Sahu\Official\DB Queries\log.txt"


Bat file contains this command
USE [MCX]
insert into test (CurrentDateTime) values (getdate())


And my project ConnectionString=
<add name="MCX" connectionString="Data Source=GH-85HKG32\SQL2012;Initial Catalog=MCX;Integrated Security=True" providerName="System.Data.SqlClient"/>


Can someone help me out as soon as possible bcz of the deadline of the project. Actually
I am looking for this solution bcz my shared webshoting doesn't allow me to create a sql job agent...