Skip to main content

Posts

Showing posts with the label How to update two tables in one statement in SQL Server 2008

update two tables in one statement in SQL Server

ALTER PROCEDURE [dbo] . [UpdateUserProfile] (   @EmailID NVARCHAR ( 150 )   , @FirstName NVARCHAR ( 100 )   , @LastName NVARCHAR ( 100 )   , @Mobile NVARCHAR ( 15 )   , @AlternateContact NVARCHAR ( 15 )   , @Gender CHAR ( 1 )   , @DOB datetime   , @Address NVARCHAR ( MAX )   , @ShortBio NVARCHAR ( MAX ) ) AS BEGIN DECLARE @REST INT SET @REST = ( SELECT COUNT (*) FROM UserProfile WHERE EmailId = @EmailID ) IF ( @REST = 0 )          INSERT INTO UserProfile (              EmailId             , Gender             , DOB             , Address             , ShortBio   ...