Guest User

Untitled

a guest
Jun 18th, 2018
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. SELECT *
  2. FROM MyTable
  3. WHERE CreatedDate = 'the date you are interested in'
  4.  
  5. SELECT *
  6. FROM MyTable
  7. GROUP BY CreatedDate
  8. HAVING COUNT(*) > 1
  9.  
  10. select
  11. 'select * from '
  12. + t.name
  13. + ' where UpdateDate = ''2009-05-01''' as SelectStatement
  14. from sys.tables as t
  15.  
  16. select
  17. 'select * from ' + t.name
  18. + ' where ' + c.name + ' = ''2009-05-01''' as SelectStatement
  19. from sys.tables as t join sys.columns as c on t.object_id=c.object_id
  20. where c.system_type_id = (select system_type_id from sys.types where name = 'datetime')
Add Comment
Please, Sign In to add comment