MsSQL - Export Stored Procedures and Views to Files
Use the Generate Scripts tool in SSMS:
- Right Click Database in Object Explorer.
- Tasks -> Generate Scripts.
- If given the "tutorial" click Next.
- Select "Select specific database objects" and tick "Stored Procedures". Click Next.
- Choose export method. Likely here you want "Save as script file" with "one script file per object" selected. Ensure you choose the export location.
- Click Next and Finish buttons as required.