A severe error occurred on the current command. The results, if any, should be discarded
I am getting an error "A severe error occurred on the current command. The results, if any, should be discarded." when following command is run. I am using SQL server 2005. The script runs for some time and then gives an error. FETCH name_cur INTO @dbName, @tableName WHILE @@Fetch_Status = 0 BEGIN SET @sql -.... insert into [dbo].[Table1] (obj_name, obj_type) EXEC (@sql) UPDATE [dbo].[Table1] SET db_name = @dbName ,table_name = @tableName WHERE db_name IS NULL FETCH name_cur INTO @dbName, @tableName END CLOSE name_cur DEALLOCATE name_cur I am finding dependent objects on a particular table. I have table names and db names in another table. I am fetching them into a cursor and storing dependency in other table. This is the requirement. And I am not sure why this error is occuring.