Still getting that error on this piece of code?
if (@myvar1-@myvar1) = 5
BEGIN
insert into dbo.test([name])values('String ' + @myvar1 + ' has both string1 and string2 in it')
else
insert into dbo.test([name])values('String ' + @myvar1 + ' only has string2 in it')
END
Not sure if it is above or:
if (@myvar1-@myvar1) = 5
BEGIN
insert into dbo.test([name])values('String ' + @myvar1 + ' has both string1 and string2 in it')
else
BEGIN
insert into dbo.test([name])values('String ' + @myvar1 + ' only has string2 in it')
END
END
Or
if (@myvar1-@myvar1) = 5
BEGIN
insert into dbo.test([name])values('String ' + @myvar1 + ' has both string1 and string2 in it')
END
else
BEGIN
insert into dbo.test([name])values('String ' + @myvar1 + ' only has string2 in it')
END
But every one of these fails
The whole code structure is:
IF Condition
--do things
BEGIN
IF Condition
BEGIN
--do things
END
ELSE
BEGIN
--Do things
END
ELSE
BEGIN
--Do things
END
END