Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

UPDATE PART OF DATA Expand / Collapse
Author
Message
Posted Sunday, March 10, 2013 7:04 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, August 1, 2013 12:41 AM
Points: 44, Visits: 84
I HAVE A TABLE WITH THREE FIELD

COMCOD SIRCODE SIRDESC
3305 180001 KARIM ENTERPRISE
3305 180002 RAHIM ENTERPRISE
3305 180003 JASON G STORE

DATE TYPES COMCOD nchar(4), SIRCODE nvarchar(6) PRIMARY KEY, SERDESC nvarchar(250).

I LIKE TO UPDATE ONLY SIRCODES TO START WITH 19 WHERE SIRCODE FROM THE LEFT STARTED WITH 18 THAT IS NEW TABLE WILL LOOK LIKE

COMCOD SIRCODE SIRDESC
3305 190001 KARIM ENTERPRISE
3305 190002 RAHIM ENTERPRISE
3305 190003 JASON G STORE
Post #1429049
Posted Sunday, March 10, 2013 7:22 PM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Sunday, September 29, 2013 1:24 AM
Points: 429, Visits: 1,721

SELECT
COMCOD
,STUFF(SIRCODE,1,2,'19') AS SIRCODE
,SIRDESC
FROM
[YourTable]
WHERE
LEFT(SIRCODE,2) = '18'





Post #1429052
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse