I have setup a DDL trigger @ Database level to capture all DDL changes and to log them into a Table.
When I issue a Dynamic SQL statment such as
set @sql="SELECT * INTO __Temp__XLPriceList FROM
OpenDataSource('Microsoft.ACE.OLEDB.12.0','Data Source="\\DEV-v1\d$\DEV-V1\EXCEL_BOOKS\EXPRESSLANE\DISCOUNTS\08Oct10-DISCOUNT-010-141.XLS";
Extended Properties=Excel 12.0;')...CPGROUPS
WHERE CUSTOMER IS NOT NULL ORDER BY NAME"
The statement(@sql) appeares in the EventData() as
--*SELECT INTO-------------------------------------------
Is there a way to capture actual (@sql) statment ?