3 added note about millisecond precision needing datetime2
source | link

The DateAdd function is what you are looking for.

Use millisecond as the first parameter to the function, to tell it that you are adding milliseconds. Then use 1 as the second parameter, for the number of milliseconds to add.

Here is an example, grabbing the current time into a variable, and then adding one millisecond to it and saving the result as a second variable, and then printing each variable

Declare @RightNow as DateTime2
Declare @RightNowPlusAMillisecond as DateTime2

Select @RightNow = Getdate()
Select @RightNowPlusAMillisecond = DateAdd(millisecond,1,@RightNow)

Print @RightNow
Print @RightNowPlusAMillisecond

Results:

2019-07-23 08:25:38.3500000
2019-07-23 08:25:38.3510000

Note:

As Forrest points out in another answer, the datetime data type does not guarantee millisecond precision. It rounds to increments of .000, .003, or .007 seconds. If you want millisecond precision, use datetime2.

The DateAdd function is what you are looking for.

Use millisecond as the first parameter to the function, to tell it that you are adding milliseconds. Then use 1 as the second parameter, for the number of milliseconds to add.

Here is an example, grabbing the current time into a variable, and then adding one millisecond to it and saving the result as a second variable, and then printing each variable

Declare @RightNow as DateTime2
Declare @RightNowPlusAMillisecond as DateTime2

Select @RightNow = Getdate()
Select @RightNowPlusAMillisecond = DateAdd(millisecond,1,@RightNow)

Print @RightNow
Print @RightNowPlusAMillisecond

Results:

2019-07-23 08:25:38.3500000
2019-07-23 08:25:38.3510000

The DateAdd function is what you are looking for.

Use millisecond as the first parameter to the function, to tell it that you are adding milliseconds. Then use 1 as the second parameter, for the number of milliseconds to add.

Here is an example, grabbing the current time into a variable, and then adding one millisecond to it and saving the result as a second variable, and then printing each variable

Declare @RightNow as DateTime2
Declare @RightNowPlusAMillisecond as DateTime2

Select @RightNow = Getdate()
Select @RightNowPlusAMillisecond = DateAdd(millisecond,1,@RightNow)

Print @RightNow
Print @RightNowPlusAMillisecond

Results:

2019-07-23 08:25:38.3500000
2019-07-23 08:25:38.3510000

Note:

As Forrest points out in another answer, the datetime data type does not guarantee millisecond precision. It rounds to increments of .000, .003, or .007 seconds. If you want millisecond precision, use datetime2.

2 changed to "millisecond" to avoid ambiguity
source | link

The DateAdd function is what you are looking for.

Use msmillisecond as the first parameter to the function, to tell it that you are adding milliseconds. Then use 1 as the second parameter, for the number of milliseconds to add.

Here is an example, grabbing the current time into a variable, and then adding one millisecond to it and saving the result as a second variable, and then printing each variable

Declare @RightNow as DateTime2
Declare @RightNowPlusAMillisecond as DateTime2

Select @RightNow = Getdate()
Select @RightNowPlusAMillisecond = DateAdd(msmillisecond,1,@RightNow)

Print @RightNow
Print @RightNowPlusAMillisecond

Results:

2019-07-23 08:25:38.3500000
2019-07-23 08:25:38.3510000

The DateAdd function is what you are looking for.

Use ms as the first parameter to the function, to tell it that you are adding milliseconds. Then use 1 as the second parameter, for the number of milliseconds to add.

Here is an example, grabbing the current time into a variable, and then adding one millisecond to it and saving the result as a second variable, and then printing each variable

Declare @RightNow as DateTime2
Declare @RightNowPlusAMillisecond as DateTime2

Select @RightNow = Getdate()
Select @RightNowPlusAMillisecond = DateAdd(ms,1,@RightNow)

Print @RightNow
Print @RightNowPlusAMillisecond

Results:

2019-07-23 08:25:38.3500000
2019-07-23 08:25:38.3510000

The DateAdd function is what you are looking for.

Use millisecond as the first parameter to the function, to tell it that you are adding milliseconds. Then use 1 as the second parameter, for the number of milliseconds to add.

Here is an example, grabbing the current time into a variable, and then adding one millisecond to it and saving the result as a second variable, and then printing each variable

Declare @RightNow as DateTime2
Declare @RightNowPlusAMillisecond as DateTime2

Select @RightNow = Getdate()
Select @RightNowPlusAMillisecond = DateAdd(millisecond,1,@RightNow)

Print @RightNow
Print @RightNowPlusAMillisecond

Results:

2019-07-23 08:25:38.3500000
2019-07-23 08:25:38.3510000
1
source | link

The DateAdd function is what you are looking for.

Use ms as the first parameter to the function, to tell it that you are adding milliseconds. Then use 1 as the second parameter, for the number of milliseconds to add.

Here is an example, grabbing the current time into a variable, and then adding one millisecond to it and saving the result as a second variable, and then printing each variable

Declare @RightNow as DateTime2
Declare @RightNowPlusAMillisecond as DateTime2

Select @RightNow = Getdate()
Select @RightNowPlusAMillisecond = DateAdd(ms,1,@RightNow)

Print @RightNow
Print @RightNowPlusAMillisecond

Results:

2019-07-23 08:25:38.3500000
2019-07-23 08:25:38.3510000