August 27, 2015 at 1:29 am
Hello,
I have approximately 200 .sql scripts of stored procedures. Any way i can create a consolidated script of all from these individual scripts?
August 27, 2015 at 2:46 am
Do you mean view all the scripts collectively?
Right click on the database
Tasks -> Generate Scripts
Just pick Stored Procedures
- Damian
August 27, 2015 at 4:39 am
not from the ssms.. wanted from the individual scripts.
Tried through DOS command.. Its done. Thanks a lot
August 27, 2015 at 5:43 am
I'm sure there are many ways to skin this cat. Initial approaches:
In SSMS, i would query sys.sql_modules and paste the query results into a single file.
select sm.definition
from sys.sql_modules sm
inner join sys.objects so on sm.object_id = so.object_id
where so.type = 'p'
order by sm.object_id;
In the file system, I would use the type command to consolidate them into one file.
type *.sql > consolidated.sql
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply