We are building a new experience for our SmartBear Community.
This site is now read-only. You can still browse and search as usual. Learn More
This site is now read-only. You can still browse and search as usual. Learn More
Try to run it with this peace of code:
var sql =
`
// sql or procedure
`;
var conn = ADO.CreateCommand();
conn.ActiveConnection = connectionString;
conn.CommandType = adCmdText;
conn.CommandText = sql;
conn.CommandTimeout = 6000;
try {
var exe = conn.Execute();
} catch(exception) {
Log.Message("FAIL");
}Sure Wamboo .
// Adding a return parameter
SProc.Parameters.AddParameter()
SProc.Parameters.Items(0).name = "RETURN_VALUE"
SProc.Parameters.Items(0).DataType = adInteger
SProc.Parameters.Items(0).Direction = adParamReturnValue
SProc.Parameters.Items(0).Value = null
//Adding an in parameter
SProc.Parameters.AddParameter()
SProc.Parameters.Items(1).name = "@timeOfBuild"
SProc.Parameters.Items(1).DataType = adDate
SProc.Parameters.Items(1).Value = aqConvert.strtoDate("2020-05-19")
SProc.CommandTimeout = 75;
SProc.ExecProc();
Microsoft SQL Server
Try to run it with this peace of code:
var sql =
`
// sql or procedure
`;
var conn = ADO.CreateCommand();
conn.ActiveConnection = connectionString;
conn.CommandType = adCmdText;
conn.CommandText = sql;
conn.CommandTimeout = 6000;
try {
var exe = conn.Execute();
} catch(exception) {
Log.Message("FAIL");
}Sorry, I am new to dealing with stored procs.
I assigned stored proc path to sql.
ActiveConnection = Connection String(includes catalog, username/password)
I didn't understand what to place at adCmdText.
I've seen we can execute stored proc using Query and tried executing SQL query
EXEC <stored proc name> @date=N'date';
It returned query timedout wrror as my stored proc takes more than 30 secs (close to one minute to get executed). Is there any way to mention querytimeout as we do commandtimeout in stored proc?
conn.CommandType = adCmdText;
conn.CommandText = sql;
conn.CommandTimeout = 6000;
adCmdText - You don't have to specify this, this parameter is the type of function to be executed.
CommandTimeout - This is the default time to run the script. Increase it as you wish.