Friday, March 30, 2012

Is there a sample way to define string constant which every stored procedure can use in SQ

Is there a sample way to define string constant which every stored procedure can use in SQL 2005 ?


1. In stored procedure A, there is

select a1,a2,a3,a4 from mytable where usename='qaz'


2. In stored procedure B, there is

select a1,a2,a3,a4 from mytable where VisitNumber>3


3. I hope there is a sample way to define string constant

such as: constant mystring='a1,a2,a3,a4'


4. So I can use this string constant both stored procedure A and stored procedure b

such as:

select mystring from mytable where usename='qaz'

select mystring from mytable where VisitNumber>3


5. How can I do that? is there a sample way? Mnay Thanks!

In my knowledge about stored procedure,you can not do that now.sql

No comments:

Post a Comment