declare @count as int select @count=ISNULL(COUNT(*),0) from [my_tableName] .... set @parameterName=CAST(@count as varchar(50))
The problem is that some records in the table, have a column (that one which i fill with the @parameterName ) with the value of Null and i don't understand why. It happens one in 100 records, but it happens.
If someone has experienced some similar situation, i would be grateful if he/she would give some help to understand what is wrong.
I wrote the code meaning that @parameter would have the value of 0 or the number or records (Count(*)) of the table.
Thanks a lot