Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 get date & time

Author  Topic 

jonekim
Starting Member

35 Posts

Posted - 2011-04-14 : 08:14:22
I've created database table where on of the record is of storing the data & time of user account creation. I've set the data value for that record as datetime.
Now every time entering date & time for each and every creation of user account is a tedious job. Is there any way of automatic storing of date & time of user account creation?

nigelrivett
Master Smack Fu Yak Hacker

3385 Posts

Posted - 2011-04-14 : 08:17:15
If it's an insert into the same table you can use a default. If it's set by and insert into another tabe or an update you can use a trigger.

==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

jonekim
Starting Member

35 Posts

Posted - 2011-04-14 : 08:23:50
@nigelrivett-"thanks for the reply"
Please elaborate ur reply. I am novice to database. I've created a table User_Account and under it I've one record for storing the date & time of account creation.
Go to Top of Page

nigelrivett
Master Smack Fu Yak Hacker

3385 Posts

Posted - 2011-04-14 : 08:27:02
What happens when you create an account? How do you do it?



==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

jonekim
Starting Member

35 Posts

Posted - 2011-04-14 : 10:08:11
I just clicked the database->tables->(right clicked)new table. And created the table named "USER" with one of the field as user_date_activation. In this entry I need to store the date of the user_account created. Every time entering date & time of the user_account is tedious. So is there any other way of doing this?
Go to Top of Page
   

- Advertisement -