Search This Blog

Database creation date

CREATE FUNCTION dbo.DBCreationDate
( @dbname sysname )
RETURNS datetime
AS
BEGIN
DECLARE @crdate datetime
SELECT @crdate = crdate FROM master.dbo.sysdatabases
WHERE name = @dbname
RETURN ( @crdate )
END
GO

No comments: