How to use SQL formula in table design?

I have two fields in my table - firstname and surname - I would like to have a field named whole name and the value of the previous fields I mentioned put into this as a default value.

How can I go about doing this?
2326acAsked:
Who is Participating?
 
imran_fastConnect With a Mentor Commented:
Yes it can be go to the table go to the design
add a new column name and put
isnull([fname] + ' ') + isnull([lname],'')
in the formula.
0
 
Aneesh RetnakaranDatabase AdministratorCommented:
CREATE TABLE [tablename] (
    [fname] [varchar] (50)  ,
    [lname] [varchar] (50)  ,
    [name] AS (isnull(([fname] + ' '),'') + isnull([lname],''))
) ON [PRIMARY]
GO


0
 
2326acAuthor Commented:
I am new to SQL to server can this be done within the table design using the formula field, sorry im used to MS Access
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
Aneesh RetnakaranDatabase AdministratorCommented:
I think You should have split the points
:(
0
 
2326acAuthor Commented:
Sorry aneeshattingal quite new to this and did not think about that.  I will think more carefully next time
0
 
Aneesh RetnakaranDatabase AdministratorCommented:
0
All Courses

From novice to tech pro — start learning today.