Topics Topics Help/Instructions Help Edit Profile Profile Member List Register Paatha Gnyapakaalu - Archives from Old DB  
Search New Posts 1 | 2 | 8 Hours Search New Posts 1 | 3 | 7 Days Search Search Tree View Tree View Latest tweets Live Tweets   Hide Images

Rate this post by selecting a number. 1 is the worst and 5 is the best.

    (Worst)    1    2    3    4    5     (Best)

Author Message
Top of pagePrevious messageNext messageBottom of page Link to this message

Mrbezawada
Pilla Bewarse
Username: Mrbezawada

Post Number: 101
Registered: 10-2011
Posted From: 205.172.134.23

Rating: N/A
Votes: 0

Posted on Thursday, October 15, 2015 - 10:58 am:   


Krishna_jilla:




DROP TABLE #Source

CREATE TABLE #Source
( id INT IDENTITY
, Flag NVARCHAR(10)

)

INSERT INTO #Source VALUES ('Inserted');
INSERT INTO #Source VALUES ('Inserted');
INSERT INTO #Source VALUES ('Inserted');

SELECT * FROM #Source

DECLARE @id INT

SET @id = 3;

IF EXISTS ( SELECT * FROM #Source WHERE id = @id )
UPDATE #Source
SET Flag = 'Updated'
WHERE id = @id
ELSE
INSERT INTO #Source VALUES ('Inserted')

SELECT * FROM #Source
Bezawada Bewarse Batchey

Topics | Last Hour | Last Day | Last Week | Tree View | Search | Help/Instructions | Program Credits Administration