Twitter

Follow SQLQuill on Twitter

Subscribe

MN Pass

Script to Create a Script Header….

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--  Creates a header for scripts                                              --
--  Pastes the results of this into a script                                  --
--                                                                            --
--  Have the results returned to text                                         --
--  Change the maximun characters return to 700                               --
--                                                                            --
--  Created by Andy Lohn on 12/15/09                                          --
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

Set nocount on
Declare @Comments1 varchar(74),
	@Comments2 varchar(74),
	@Comments3 varchar(74),
	@Comments4 varchar(74),
	@Comments5 varchar(74),
	@Comments6 varchar(74),
	@Comments7 varchar(74)

Select @Comments1 = 'This creates a simple header for scripts'
Select @Comments2 = '<<<fill in comments/notes here>>>>'
Select @Comments3 = '<<<fill in comments/notes here>>>>'
Select @Comments4 = '<<<fill in comments/notes here>>>>'
Select @Comments5 = '<<<fill in comments/notes here>>>>'
Select @Comments6 = ''
Select @Comments7 = 'Created by Andy Lohn of Lohn Solutions on ' + Convert(varchar(20), Getdate(), 1)

Select '/*' +
	Char(13) + Char(10) +
	Replicate('-', 80) +
	Char(13) + Char(10) +
	'--  ' +  @Comments1 + SPACE(74 - Len(@Comments1)) + '--' +
	Char(13) + Char(10) +
	'--  ' +  @Comments2 + SPACE(74 - Len(@Comments2)) + '--' +
	Char(13) + Char(10) +
	'--  ' +  @Comments3 + SPACE(74 - Len(@Comments3)) + '--' +
	Char(13) + Char(10) +
	'--  ' +  @Comments4 + SPACE(74 - Len(@Comments4)) + '--' +
	Char(13) + Char(10) +
	'--  ' +  @Comments5 + SPACE(74 - Len(@Comments5)) + '--' +
	Char(13) + Char(10) +
	'--  ' +  @Comments6 + SPACE(74 - Len(@Comments6)) + '--' +
	Char(13) + Char(10) +
	'--  ' +  @Comments7 + SPACE(74 - Len(@Comments7)) + '--' +
	Char(13) + Char(10) +
	Replicate('-', 80) +
	Char(13) + Char(10) +
	'*/'

Leave a Reply

  

  

  

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>