Entry format for date/time values

Enter datetime and smalldatetime values as character strings, enclosed in single quotation marks.

Replication Server encloses datetime values in single quotation marks when it substitutes datetime values into function-string output templates. Be sure to consider this when you create function strings that include datetime variables.

The date and time portions of the data are recognized separately; therefore, the time can precede or follow the date. If you omit the time, Replication Server assumes midnight (12:00:00:000AM). If you omit the date, Replication Server assumes January 1, 1900.

Enter times according to these general rules:

Here are some examples of time literals:

2:00
14.30
14:30:20
14:30:20:500
4pm
11:41:36 AM
12:48:5.333 pm

Enter dates with the month, day, and year in any order, subject to the following rules:

These examples show how to use bigdatetime and bigtime in a replication definition, a function replication definition, and a subscription. In these examples:

Example 1 Using the datatypes in a replication definition.

create replication definition rep1
with primary at PDS.pdb1
with all tables named tb1
(col1 int, col2 bigdatetime, col3 bigtime)
primary key (col1)

Example 2 Using the datatypes in a function replication definition.

create function replication definition func1
with primary at PDS.pdb1
(@par1 int, @par2 bigdatetime, @par3 bigtime)
searchable parameters (@par1)

Example 3 Using the datatypes in a subscription.

create subscription sub1 for rep1
with replicate at RDS.rdb1
where col3 = ‘14:20:00.010101’
without materialization