One of the developers in my company had set up a sql profiler with a filter on the database id.
He is telling me that the database id that he is looking for has changed.
The database in question is still there, but instead of 61 it is now 60.
One of the developers in my company had set up a sql profiler with a filter on the database id.
He is telling me that the database id that he is looking for has changed.
The database in question is still there, but instead of 61 it is now 60.
sys.databases.database_id is not assigned like an identity. Rather the lowest positive integer available will be used. Repro is pretty simple:
create database a;
create database x;
create database b;
drop database x;
select *
from sys.databases
where database_id > 4;
In the event you drop and re-create b, the database_id will decrement by 1.
drop database b;
go
create database b;
As for the profiler question - you should probably ask a separate question and include the trace definition at a minimum. Dropping a database while there's a live profiler trace does not create the error you describe.