2

When I create a new database in SSMS either using the creation wizard or the CREATE DATABASE command the database will contain a stored procedure called Searchinall. This procedure has never been added to new databases previously, but since 2 days it will be created in every new database, no matter how I create it. I have tried creating a database from a different Computer on this server as well, but the stored procedure will still appear.

When I tried looking online for a procedure Searchinall I could not find any results, so I suspect it is not a new feature and nothing that should be created by default.

Could someone have maybe accidentally added it as a default stored procedure to be created in every new database on the server? If so, how can I disable it?

1
  • 5
    Check the model database. All newly created Sql Server databases use the MODEL database as a template and any objects (tables, views, stored procedures, etc.) that exists in model be will a part of any new database created on that SQL Server instance. – Scott Hodgin - Retired Jan 28 at 10:21
8

When you create a new database in SQL Server the Model database is used as a template. Your new database will contain any stored procedurethat is in the model database.

From what you are describing it seems that the stored procedure, Searchinall is a custom procedure added to the model database by someone in your organization and then automatically included in any database that you created.

1
  • 2
    TIL what the model system database was for! I've been using SQL Server for 17 years now and I never knew that! – Dai Jan 28 at 19:39
4

Usually, it is placed in the model database, that serves as default template when you create a new database. Try to look into it.

2

Look in the model database. That is where new databases are copied from

1
  • ops, sorry, double answer – MBuschi Jan 28 at 10:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.