Readdy Write  
0,00 €
Your View Money
Views: Count
Self 20% 0
Your Content 60% 0

Users by Links 0
u1*(Content+Views) 10% 0
Follow-Follower 0
s2*(Income) 5% 0

Count
Followers 0
Login Register as User

SQL server: DateTime.Now is CURRENT_TIMESTAMP

17.05.2018 (👁2202)


 

Task:

I want to assign the current time to a field in a database. What is the Now or Now () statement called SQL Server Transact.

 

Solution:

With CURRENT_TIMESTAMP you take over the time, which runs on the SQL server.

INSERT INTO [dbo].[tbl_User_Sums]

           ([IDUser]

           ,[dtStart]

           ,[dtEnd]

           ,[SumViews_Content]

           ,[SumViews_Self]

           )

     VALUES

           (123

           ,CURRENT_TIMESTAMP,CURRENT_TIMESTAMP

           ,0,1)

 

In SQL Server Management Studio, the new values are displayed as here

CURRENT_TIMESTAMP = 2018-05-17 13: 44: 59.820 in milliseconds


Transact commands

Sql Synstax