Nat Luengnaruemitchai

Geek Blog

  Home  |   Contact  |   Syndication    |   Login
  100 Posts | 0 Stories | 234 Comments | 236 Trackbacks

News

Archives

Post Categories

Blogroll

Sometimes, I have to use function to define a constant in SQL Server. However, it doesn't perform as well as just plugging in constant value in there. Why can't we just have constant value in T-SQL? Don't tell me that there is a deterministic function. Most of the time, SQL Server just keeps calling the function although it does know that the function is deterministic.

posted on Wednesday, April 27, 2005 3:33 AM

Feedback

# re: Can't SQL Server Have Constant? 6/12/2007 6:39 AM Çetin Yılmaz
I prefer using ORACLE, when i started to use SQL Server for a special project, i am very surprised, it just like MS Access, i mean a bit simple, if you have chance to meet oracle you can use packages to hold public constants.

for example:

UPDATE CUSTOMER SET EMAIL = REF_PACKAGE.ADMIN_MAIL;

In addition PLSQL is more efficient from TSQL

# re: Can't SQL Server Have Constant? 9/26/2007 10:12 AM Alex
why do you say PLSQL is more efficient than TSQL?

# re: Can't SQL Server Have Constant? 4/4/2008 3:44 AM novocain68
For starters, PL/SQL has something called relative types (xxx%type), which is a very cool feature... especially if you have to maintain a large SP code base.

Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: