• TomThomson (8/27/2014)Neither do I understand why people are claiming that two separate statements are a single query; queries are, properly speaking, dml statements but maybe it's fair enough to count ddl statements too. PRINT <something> is not a query, it's neither DML nor DDL but something else, of the same order as GOTO (but not quite a disqualified as GO). Neither is EXEC(<something>) a query, it's a metastatement. And even if both were queries, calling a batch a query is pure nonsense.

    Strictly speaking about query and batch you are right, but I doubt if that reasoning was on the mind of Shiva.

    But strictly speaking "use" can mean anything, so below a query in which I use both PRINT and EXEC commands.

    SELECT 'Yes I can use the PRINT and EXEC command in a single query'

    😀