"DBO".sf_GetStateID( @Abbr char(2))
declare @StateID integer;
if @Abbr is null
select MIN(lngStateID) into StateID from "DBA".States where strAbbr=@Abbr;
if @StateID is null
insert into States(strAbbr,strName) values(@Abbr,@Abbr)
if SQLSTATE = '00000'
In this function, I am getting error at SQLSTATE = '00000'. I saw in books online and it says that SQLSTATE is a keyword. It is not recognizing SQLSTATE as a keyword in the function.
Can you help in that?
2nd Error: It is not accepting the statement
select MIN(lngStateID) into StateID from "DBO".States where strAbbr=@Abbr;
I don't see any problem in the above statement. Do help in solving these two problems.