|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Global ConstantsHi all,
I would like to know the ways to make a global constant variable (number, or nvarchar) which all my SP can use it directly. Thanks a lot. Windy No such built-in direct functionality. Insert the value(s) into a table, which all who need can read
from. -- Show quoteTibor Karaszi, SQL Server MVP http://www.karaszi.com/sqlserver/default.asp http://www.solidqualitylearning.com/ "windy" <wi***@gmail.com> wrote in message news:O07J$SjvGHA.4436@TK2MSFTNGP05.phx.gbl... > Hi all, > I would like to know the ways to make a global constant variable (number, or nvarchar) which all > my SP can use it directly. > > Thanks a lot. > Windy > windy wrote:
> Hi all, CREATE TABLE Parameters (...)> I would like to know the ways to make a global constant variable (number, > or nvarchar) which all my SP can use it directly. > > Thanks a lot. > Windy .... SELECT @param1 = param1 FROM Parameters -- David Portas, SQL Server MVP Whenever possible please post enough code to reproduce your problem. Including CREATE TABLE and INSERT statements usually helps. State what version of SQL Server you are using and specify the content of any error messages. SQL Server Books Online: http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx -- windy (wi***@gmail.com) writes:
> I would like to know the ways to make a global constant variable CREATE VIEW MyConstants AS> (number, or nvarchar) which all my SP can use it directly. SELECT MyFirstConstant AS 10, MySecondConstant AS 'Hey Nineteen', MyThirdConstant AS convert(datetime, '20021212') -- Erland Sommarskog, SQL Server MVP, esq***@sommarskog.se Books Online for SQL Server 2005 at http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx Books Online for SQL Server 2000 at http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx |
|||||||||||||||||||||||