Hi...
I want to write a IF Condition as follow:
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
Create PROCEDURE [dbo].[abc]
AS
SET NOCOUNT ON;
BEGIN
Declare @add = 0 as int
Declare @change = 0 as int
Declare @remove = 0 as int
Select abc.value as 'Name'
if (History.OLDSTR == '' and History.NEWSTR == [B]value[/B]) then
add++ as [Add]
from History INNER JOIN MetaObjAttrRelations
ON History.MetaObjAttrRelations_Idn = METAOBJATTRRELATIONS.METAOBJATTRRELATIONS_IDN
End
In the above code value is present in the database. So how to write that column name in place of value. Im trying to create a procedure where there is old value and new value. If the old value has change or modified then change variable will increment by 1, if there is no old value in the database and i have added new value in the databse then add variable will increment by 1, if there is value in the old value and i have deleted the old value, then remove variable will increment by 1.
So kindly help me out to solve this issueee...