how to assign the integer value to nvarchar or varchar datatype in stored procedure
DECLARE @SQLString nvarchar(max)
SET @SQLString = N'declare @Identifier int;
SELECT COUNT(*) FROM ' + @batch+' where Identifier = @Identifier'
i need to check whether the @SQLString is 0 or not.
i.e i want to check —–> if(@SQLString =0). how to assign a integer val to nvarchar or varchar
You’re setting @SQLString to a query… if you want to see if it’s ‘0’, then you can just do:
But I think you’re trying to find out if there are 0 rows in your batch, in which case, you mean something more like: