Depending on the language the book was written for. Oracle has a Date format. SQL Server doesn't. SQL Server provides DATETIME (8 bytes) and SMALLDATETIME (4 bytes). SMALLDATETIME is accurate to one minute. SQL Server has no data types that store just DATE or TIME, although they are ANSI standards.
You will want to use SMALLDATETIME when all you really need is the data, or the date and time accurate to the minute. In other words, is it relevant that Jane Doe was hired on 7/12/2007 11:34:45 (DATETIME) or is 7/12/2007 11:34:00 okay? If the second is acceptable, you can save 4 bytes of data per table row.
Main Topics
Browse All Topics





by: appariPosted on 2007-07-18 at 20:45:31ID: 19519236
try
create table employee_pay_tbl
(date_hire datetime);