How to retrieve the Local Date and Time in sql server ? A common task in SQL Server is the retrieval of the local date and time from the server. Usually, it is more appropriate for a database-linked application to obtain the time from the server than from the local machine, as this ensures that all users are using the same basis for the time. If a user's local clock is set incorrectly, the use of the server's clock ensures that an invalid date or time is not stored. Using the CURRENT_TIMESTAMP SQL Server defines a value named CURRENT_TIMESTAMP. This value can be included in aquery using a select statement or can be assigned to a DateTime variable to obtain the current local time. To demonstrate, try the following statements using a SQL Server Management Studio query window. The first will output the local time to the results window, the second will hold the time in a variable before printing the variable's value in the messages window. NB: When the current date ...
This blog is fully for system admins and others who are facing issues with their day to day IT life. Which helps you to learn from your mistakes and issues here you can find lot of troubleshooting techniques and other information which helps you to get some idea to fix your issues..