x

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

more ▼

asked Jul 06, 2011 at 11:40 PM in Default

sathishkumar gravatar image

sathishkumar
234 22 24 26

(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first

According to the official keyboard short-cut list, 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 so that the date/time column has a default value of getdate() 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].

[4]: http://msdn.microsoft.com/en-us/library/ms189799(v=SQL.90).aspx
more ▼

answered Jul 07, 2011 at 12:16 AM

ThomasRushton gravatar image

ThomasRushton ♦
33.9k 18 20 44

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x4

asked: Jul 06, 2011 at 11:40 PM

Seen: 1757 times

Last Updated: Jul 06, 2011 at 11:41 PM