Melkor Posted September 10, 2011 Share 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 Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted September 11, 2011 Moderators Share 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. Link to comment Share on other sites More sharing options...
Zedna Posted September 11, 2011 Share 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 Link to comment Share on other sites More sharing options...
Melkor Posted September 13, 2011 Author Share 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 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now