TSQL Script summarize data in new column

Posted on 2011-10-31
Last Modified: 2012-06-27

I need to summarize the first, last name and the email adress to one column in the sql database
we use Microsoft SQL Server 2008 standard

i want to create a stored procedure that is able to fill the data into the new emty column
so i need to summarize the informations (first + last + mail) in the column for each row

Question by:HelpdeskJBC
    LVL 3

    Accepted Solution

    If I understand you right..

    UPDATE TableX  SET SummarizedName = first + ' ' + last + ' ' + mail

    Open in new window

    Where SummarizedName , first, last, mail are columns in TableX..

    Hope it helps
    LVL 15

    Expert Comment

    CREATE PROCEDURE AlterEmptyField
    	@RowID int
    	update tablename set emptyfield = first + last + mail where ID = @RowID

    Open in new window


    Author Closing Comment

    i tought that i need a do while >eof loop, but this is easy
    works fine!


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
    In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now