>HI
>
>I have a complicated case structure which is used to format the salutation on a mail file.
>
>If I want to include this case in several stored procedures or sql scripts is there a way I can include it from a single file .
>
>
>Nick
One possibility is to create a scalar UDF. However, scalar UDFs in SQL Server don't perform too well.
The other possibility is to have inline table-valued function returning a row with your salutation. By CROSS APPLYing this function you should get a good performance.
If it's not broken, fix it until it is.
My Blog