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 2012 Forums
 Transact-SQL (2012)
 format a column and insert into other column

Author  Topic 

SQL_SSIS_Dev
Starting Member

10 Posts

Posted - 2014-09-18 : 16:24:12
A column of a table has values in the format - 35106;#Grandbouche-Cropp, Amy

I need to format the column data in such a way that only the text after # (Grandbouche-Cropp, Amy) remain in the column.

The text before ;# (35106) should be inserted in to another column of the same table.

Below is the table structure:

create table [HR_DEV_DM].[CFQ_TEST].sp_CFQ_Commercial_Referrals
(
ID int identity,
PromotionalCode nvarchar(4000),
QuoteNumber nvarchar(100),
CreatedBy nvarchar(100),
Created datetime,
ModifiedBy nvarchar(100),
Modified datetime,
CreatedBy_SalesRepSharePointID int,
ModifiedBy_ModBySharePointID int
)

Please help....

SQL_SSIS_Dev
Starting Member

10 Posts

Posted - 2014-09-18 : 16:30:43
The column CreatedBy has this value and the numeric value needs to be inserted into the column CreatedBy_SalesRepSharePointID.
Go to Top of Page
   

- Advertisement -