Creation Time of Schema?

  • Does anyone know how to determine when (DATETIME) a schema was created?

    I've been snooping around INFORMATION_SCHEMA.SCHEMATA, sys.schemas and sys.objects but there does not appear to be a date associated with schema information ...

    Thanks in advance!

  • I keep a log of all DDL changes to all my databases, and I get that kind of information from there. Source control works as well if not better. I'm assuming you don't have options for that.

    I don't know a query to get that. Maybe check backups and see where it started, to get a rough date at least?

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • Thanks for the ideas, GSquared.

    In this case it is more a curiosity than an issue.

    A coworker copied a table [foo].[bar] from database A to database B. I knew the schema "foo" did not exist in database B and was surprised that the schema was automagically created rather than the job failing (import/export tool).

    That could help things to start becoming a bit messy ...

    Have a good one.

  • Yes, the import/export tool will automtically copy schema names over if it doesn't find them. That's by design.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply