We have one varchar field in SQL Server table containing numeric value with Null entries. Now if someone want to update this value how can we do this ?
DECLARE @Table TABLE
(
VAL VARCHAR(100)
)
INSERT INTO @Table
SELECT 1000 UNION ALL
SELECT Null UNION ALL
SELECT 5000
UPDATE @Table
SET
VAL = CAST(VAL AS INT) + 100
SELECT * FROM @Table
Output:
No comments:
Post a Comment