Wrox Programmer Forums
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 6th, 2006, 04:01 AM
Registered User
 
Join Date: Jan 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default System Date

Hi to all,


  Good day to all! Just one question
  How can I change the System date of the SQl server using SQL script, sql function/procedure or sql commands?

Thanks
adyaky
 
Old January 6th, 2006, 05:46 AM
Friend of Wrox
 
Join Date: Sep 2004
Posts: 109
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Anantsharma Send a message via Yahoo to Anantsharma
Default

You can use XP_CMDSHELL from Query Analyzer / your app to execute an executable which will change System date. This executable may be a C module.



B. Anant
 
Old January 6th, 2006, 06:46 PM
Friend of Wrox
 
Join Date: Dec 2005
Posts: 146
Thanks: 0
Thanked 1 Time in 1 Post
Default

Anantsharma is on the right track, as xp_cmdshell is the way to go. Although there is no need to write a C Module when the command shell (Windows -- even back to DOS) provides a command to change the date
EXEC xp_cmdshell 'date 02-01-06' -- This will change the Date on the SQL Server

-- CMD line command date [MM-DD-YY[YY]]

David Lundell
Principal Consultant and Trainer
www.mutuallybeneficial.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert System date and System Time -Form _TextBox cnkumar74 VB How-To 14 February 14th, 2007 10:52 AM
HOW CAN SYSTEM DATE N TIME BE CAPTURED IN A TXTBOX cnkumar74 VB Databases Basics 6 February 14th, 2007 02:09 AM
How to get system login and date Abhinav_jain_mca General .NET 2 August 26th, 2004 01:12 AM
insert system date. no date and time jimmy Access VBA 6 November 20th, 2003 01:11 PM
System date.. arshad mahmood MySQL 2 August 12th, 2003 09:53 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.