Skip to main content
edited tags
Link
Paul White
  • 90.3k
  • 30
  • 424
  • 663
Closing comments
Source Link
kooker
  • 123
  • 4

Is there a setting in SQLServer 2008 and newer for default data type of date-time columns, i.e. datetime or datetime2? Actually more like something that would tell SQLServer to use datetime2 instead of datetime when creating a table/view even if the latter is requested explicitly.


UPDATE: Thank you everyone. With this issue I am actually on the pitching side, that is creating tables from Java application that are supposed to have datetime columns, but end up having datetime2. Thought it might be due to DBMS configuration, but, probably, it's due to intricacies of one of our frameworks. Oh well, back to digging code :)

P.S. Special thank you goes to @srutzky for detailed response with multiple options, but accepted @John M's answer as being the most spot on.

Is there a setting in SQLServer 2008 and newer for default data type of date-time columns, i.e. datetime or datetime2? Actually more like something that would tell SQLServer to use datetime2 instead of datetime when creating a table/view even if the latter is requested explicitly.

Is there a setting in SQLServer 2008 and newer for default data type of date-time columns, i.e. datetime or datetime2? Actually more like something that would tell SQLServer to use datetime2 instead of datetime when creating a table/view even if the latter is requested explicitly.


UPDATE: Thank you everyone. With this issue I am actually on the pitching side, that is creating tables from Java application that are supposed to have datetime columns, but end up having datetime2. Thought it might be due to DBMS configuration, but, probably, it's due to intricacies of one of our frameworks. Oh well, back to digging code :)

P.S. Special thank you goes to @srutzky for detailed response with multiple options, but accepted @John M's answer as being the most spot on.

Is there a setting in SQLServer 2008 and newer for default data type of date-time columns, i.e. datetimedatetime or datetime2datetime2? Actually more like something that would tell SQLServer to use datetime2datetime2 instead of datetimedatetime when creating a table/view even if the latter is requested explicitly.

Is there a setting in SQLServer 2008 and newer for default data type of date-time columns, i.e. datetime or datetime2? Actually more like something that would tell SQLServer to use datetime2 instead of datetime when creating a table/view even if the latter is requested explicitly.

Is there a setting in SQLServer 2008 and newer for default data type of date-time columns, i.e. datetime or datetime2? Actually more like something that would tell SQLServer to use datetime2 instead of datetime when creating a table/view even if the latter is requested explicitly.

Source Link
kooker
  • 123
  • 4
Loading