question

ravireddy avatar image
ravireddy asked

please help this is very urjent requirment

CREATE TABLE MyTable (COMPLAINTID int identity(1,1) NOT NULL -- See above note) ,ResponsiRble varchar(100) NOT NULL --I'm making an assumption as to length here, change to value /*Other columns here */ ,COMPLAINTID_Display AS (CASE WHEN ResponsiRble = 'MANAGEMENT' THEN 'M' WHEN ResponsiRble = 'NETWORK' THEN 'N' ELSE 'O' END + CONVERT(VARCHAR(15),COMPLAINTID)) ) this gives the output as COMPLAINTID_Display M1 N2 O3 but we want the output as M1 N1 O1
sql-server-2008sql
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers