Monday, April 11, 2011

How do you find out how many tables created today in particular database in SQL?


Select Answer:

select count(*) from sys.tables where create_date=getdate()
select count(*) from sys.tables where create_date=convert(varchar,getdate(),101) (Your selection was wrong)
select count(*) from sys.tables where convert(varchar,create_date,101)=getdate()
select count(*) from sys.tables where convert(varchar,create_date,101)=convert(varchar,getdate(),101)