Skip to Content.
Sympa Menu

freetds - [freetds] MSSQL query not executing....

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Christopher Bielinski <cbielinski AT qualys.com>
  • To: freetds AT lists.ibiblio.org
  • Subject: [freetds] MSSQL query not executing....
  • Date: Wed, 4 Jan 2012 17:41:27 -0700

Hello…





First time on here and I was wondering if I could get a little help with
one of my queries.



The query:



IF EXISTS (select path from sys.traces where id = 1) BEGIN IF EXISTS
(SELECT distinct(e.name) as Event_Name FROM fn_trace_geteventinfo(1) ei
JOIN sys.trace_events e ON ei.eventid = e.trace_event_id JOIN
sys.trace_columns c ON ei.columnid = c.trace_column_id where e.name =
'Audit Statement Permission Event') BEGIN SELECT 'Event is being Audited'
as 'beingAudited' END ELSE BEGIN SELECT 'Event is not being Audited' as
'beingAudited' END END ELSE BEGIN select 'Trace file not found' as
'beingAudited' END



…looks to see if there is a certain event that is being audited within a
MSSQL Trace file. This query runs in the SSMS browser, but doesn’t when I
pipe it through FreeTDS. I was wondering if the query was properly written
(to the specs of FreeTDS), or if I’m missing something. This is the first
query I’m using with the ‘IF EXISTS’ and ‘BEGIN/END’ objects. Could these
present any issues?



Thanks,
Chris Bielinski | cbielinski AT qualys.com
Policy Compliance | Senior Database Compliance Engineer
*Qualys, Inc. *| *On Demand Security* |* **www.qualys.com*
Direct: 650.801.6105 | Fax: 650.801.6101
Mobile: 720.273.9426




Archive powered by MHonArc 2.6.24.

Top of Page