Is there a way for tsqlt to assert all the columns returned from a stored procedure have a certain column name? I need to check if Employee_lname column actually returns as 'Employee_lname' instead of (no column name)
TSQLT Asserting stored procedure column names
158 Views Asked by Phanzy Phan At
2
You could try using one of these DMV's. They are designed to output in table form a description of the first result set returned by a query/object.
Documentation:
It should be noted that if you have dynamic output, for example by using
IF/THEN/ELSE
or by using dynamic SQL, this won't work for you. These DMV's do not actually run the query and parse the output.Example of dynamic output:
You'll see it only outputs a single blank row.