question

sathishkumar avatar image
sathishkumar asked

Shortcut key for inserting current date in sql 2005 table

Hi, In sql server 2000 we can use "ctrl+;" to insert current date in table(Enterprise Manager) Is there any shortcut key to insert date in Sql server 2005. Thanks
shortcut-key
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
ThomasRushton avatar image
ThomasRushton answered
According to the official [keyboard short-cut list][1], no. However, you do have the opportunity to define your own keyboard shortcuts within SSMS, as is outlined at the top of the page referenced above. Whether or not you'll be able to create a shortcut to do what you want is another matter. The alternative is to [create the table][2] so that the date/time column has a default value of [`getdate()`][3] on the field (see example 'D' on that link). Of course, that'll only work when inserting a new record. If it's something that needs to be updated on an `UPDATE`, then you might want to look into [creating an update trigger][4]. [1]: http://msdn.microsoft.com/en-us/library/ms174205(v=SQL.90).aspx [2]: http://msdn.microsoft.com/en-us/library/ms174979(v=SQL.90).aspx [3]: http://msdn.microsoft.com/en-us/library/ms188383(v=SQL.90).aspx [4]: http://msdn.microsoft.com/en-us/library/ms189799(v=SQL.90).aspx
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.