Hi community!
How can i execute a sql query like :
INSERT INTO [DestinationTable] (fields)
SELECT field1 field2, field3 ..
FROM [SourceTable]
I can't use ESQ and .Net "SqlCommand" class ask a SqlConnection and not a UserConnection ...
Can you help me?
Best regards,
Davyd
Like
1 comments
11:19 Apr 27, 2018
Hi community!
I finally found the solution!!! : using the Class CustomQuery like this:
var userConnection = Get<UserConnection>("UserConnection");
string sql =" .......";CustomQuery myQuery = new CustomQuery(userConnection);
myQuery .SqlText = sql;
using (DBExecutor dbExecutor = userConnection.EnsureDBConnection())
{
dbExecutor.CommandTimeout = 0;
myQuery .Execute();
}return true;
Show all comments