We have processes that call numerous stored procedures. We are trying to create a SSRS report for our IT department to use so they can easily lookup the stored procedure definition. Some end users do not have access to SQL Server Management Studio.
The dataset query uses a System View... INFORMATION_SCHEMA.ROUTINES. We are joining on theROUTINE_NAME. When running the SQL, it works perfect. We are able to get all the columns we need. The primary column in the INFORMATION_SCHEMA.ROUTINES we need is ROUTINE_DEFINITION (the sql/text of the stored procedure).
In SSRS, we copy/paste the same SQL into the DataSet query. When I test the query in the DataSet window (using red! button), it pulls back the data just fine.
I then drop all the queried columns on the report (see query below). When I run the report all data is display except the ROUTINE_DEFINITION column. Why is this? Is it because it's SQL and SSRS won't display SQL content? How can I get the ROUTINE_DEFINITION column data on the report?
Here is example query I'm using in the SSRS dataset:
SELECT SPECIFIC_CATALOG, SPECIFIC_SCHEMA, SPECIFIC_NAME, ROUTINE_TYPE, CREATED, LAST_ALTERED,ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_NAME = @StoredProcedureName
Andy Kreider | Principal Financial Group | Des Moines, IA, USA