Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Any simple way to get procedure full code?
Message
De
06/08/2008 13:18:27
 
 
À
06/08/2008 13:14:11
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01336897
Message ID:
01336968
Vues:
17
>>Hi everybody,
>>
>>With this code
>>
>>
>>declare @LongName varchar(max)
>>--set @LongName = ''
>>--
>>--select @LongName = @LongName + ' ' + ISNULL(FirstName,'') from Registration
>>--select @LongName as LongName
>>set @LongName = ''
>>select name from sys.procedures order by name
>>SELECT @LongName = @LongName + char(13) + OBJECT_DEFINITION(OBJECT_ID) from sys.procedures where Name Like 'Registration%'
>>print @LongName
>>
>>I only get the first N number of lines. Is there a way to get whole code of my procedures into some convenient text format without opening each one using SSMS?
>>
>>Thanks a lot in advance.
>
>In addition to Borislav's answer, in SMSS
>
>Right click on a DB in ObjecExplorer
>Select 'Tasks'
>Select 'Generate Scripts'
>Select a DB
>Tick 'Stored Procedures'
>Tick the SPs (or All) you want to script, select 'Next'
>Tick 'Script to file'
>Choose 'Single file' or 'File per object' (I like File per object. Makes it easy to create artifacts that can be added to source control)
>Select 'Finish'

Thanks a lot again to both of you.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform