Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Constant Declaration
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Ask SQLTeam Question

0 Posts

Posted - 02/22/2001 :  23:25:19  Show Profile  Visit AskSQLTeam's Homepage  Reply with Quote
Prathiba writes "How to declare constants in sql server 7.0?"


United Kingdom
12543 Posts

Posted - 02/23/2001 :  09:56:40  Show Profile  Visit nr's Homepage  Reply with Quote
You don't. Put the values in a table and retrieve them when needed. You could call an SP to retrieve the values if needed.
Go to Top of Page

Most Valuable Yak

15732 Posts

Posted - 02/23/2001 :  10:01:46  Show Profile  Visit robvolk's Homepage  Reply with Quote
The DECLARE statement will do it:

DECLARE @variablename datatype [= defaultvalue]
DECLARE @firstname varchar(20)
DECLARE @middleinitial varchar(1)=''
DECLARE @lastname varchar(20)

Variables you declare are only available in the current connection and procedure/query. If you need global variables, you can put them in a regular or global temp table, and SELECT them when needed.

...yeah, what the guy before me said!

Edited by - robvolk on 02/23/2001 10:13:36
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000