[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 299
  • Last Modified:

TSQL Script summarize data in new column


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




0
HelpdeskJBC
Asked:
HelpdeskJBC
1 Solution
 
Srm74Commented:
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
0
 
EyalCommented:
CREATE PROCEDURE AlterEmptyField
	@RowID int
AS
BEGIN
	SET NOCOUNT ON;
	update tablename set emptyfield = first + last + mail where ID = @RowID
END
GO

Open in new window

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

thanks
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now