Melkor 0 Posted September 10, 2011 I have any files with sql expressions(long sql statements)I can with help _sql.au3 run any simple querry( select or update or ..). But if I want to execute complex querry - I get no results.I can run this files(on MsSQL) by osql.exe, but I want to use AutoIt.Does anybody know, how to do it on AutoIt? long sql statements for examle:IF OBJECT_ID('[dbo].[V_OperGang]','V') IS NOT NULL DROP VIEW [dbo].[V_OperGang] GO CREATE VIEW [dbo].[V_OperGang] AS SELECT og.*, CONVERT(decimal(16, 2), 0) AS SummToDayEnd, sr.ReportNumber, fd.FirstChequeDate FROM OperGang og LEFT JOIN ShiftReports sr ON og.ReportID = sr.Id LEFT JOIN ( SELECT MIN(DateOperation) AS FirstChequeDate, shopindex, operday, cash_code, NSmena FROM ChequeHead (NOLOCK) GROUP BY shopindex, operday, cash_code, NSmena ) fd ON fd.shopindex = og.shopindex AND fd.operday = og.operday AND fd.cash_code = og.CashNumber AND fd.NSmena = og.GangNumber GO Luck, Love and PatienceNikita Share this post Link to post Share on other sites
SmOke_N 211 Posted September 11, 2011 replace all the line feeds with a space and try it. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Share this post Link to post Share on other sites
Zedna 291 Posted September 11, 2011 Run each SQL command as separate. Don't use more GO commands in one SQL execute. Also try remove GO command from your SQL. Resources UDF ResourcesEx UDF AutoIt Forum Search Share this post Link to post Share on other sites
Melkor 0 Posted September 13, 2011 Thanks for your advices! I'll try to use it. Scriptes are not mine, but I must run its on database. It means, that I should prepare scriptes... And I think it will be not work, if in script there are variables(for example DECLARE @variable INT). But I'll try Luck, Love and PatienceNikita Share this post Link to post Share on other sites