0 Replies - 1698 Views - Last Post: 07 July 2010 - 07:30 PM

#1 PsychoCoder   User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1659
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

MSSQL user defined function to get an objects creation date

Posted 07 July 2010 - 07:30 PM

Description: MSSQL user defined function to get a database objects creation date
CREATE FUNCTION dbo.udfGetCreationDate
(
	@DatabaseObject SYSNAME
)
RETURNS DATETIME
AS
BEGIN
  DECLARE @Created DATETIME
  
  SELECT 
		@Created = crdate 
  FROM 
		sysobjects 
  WHERE 
		name = @DatabaseObject
		
  RETURN @Created 
END

Is This A Good Question/Topic? 0
  • +

Page 1 of 1