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

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Computed columns

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-02-05 : 09:09:04
Bo writes "Hi SQL-Team

I've seen in SQL server 2000 that it's possible to create a computed column that is not written physically to the database.

Are there any way that it's possible in SQL 7.0 ?

I wan to create a default colummn e.g. one column with firstname and one column with lastname, these to columns should automaticly be computed into one column default.

I know that I can create a stored procedure, which runs on an insert statement, but how to make it default ?

Hope you can help me

Kind regards

Bo"

izaltsman
A custom title

1139 Posts

Posted - 2002-02-05 : 10:03:51
I don't think this is a good use for a computed column (I prefer to do this sort of string concatentation directly in my queries)... But yes, if that's what you really want, you can have a column that combines first and last name into a single field like this:


CREATE TABLE mytable (
f_name varchar(50)
, l_name varchar(50)
, calcd_full_name as isnull(f_name, '')+' '+isnull(l_name, ''))




Edited by - izaltsman on 02/05/2002 10:04:36
Go to Top of Page
   

- Advertisement -