How to export the field Routine_Definition from SQL Server to Excel??
Posted on 2014-03-03
I'm using this SQL Script to obtain a list of all of my Stored Procedures. This script contains a field that shows the entire TEXT found within each Stored Proc.
The issue is I need to get this data set result exported into EXCEL. When I attempt to COPY and/or IMPORT the data result set into Excel that data in field ROUTINE_DEFINITION will not import correctly. The field itself contains alot of text, commas, carriage returns, tabs etc and so is cauising the issue.
Is it possible to export a data set result such as this from sQL SERVER into EXCEL..?
IF SO, ....HOW????
Here is the script if you'd like to try the export of the data yourself.
select SPECIFIC_CATALOG as [Database], specific_schema as [Schema], SPECIFIC_NAME as [StoredProcedureName], ROUTINE_DEFINITION as [StoredProcLogic],created as [DateCreated], LAST_ALTERED as [LastAltered]
where routine_type = 'PROCEDURE'
and Left(Routine_Name, 3) NOT IN ('sp_', 'xp_', 'ms_')
Any assistance is greatly appreciated!