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
 select a table to modify previous date

Author  Topic 

amirs
Constraint Violating Yak Guru

260 Posts

Posted - 2010-04-22 : 00:55:43
hi
it is very difficult questions. but i just a get information
it is posible to select record of table to modify last month date.
the table has no any date colomn.
suppose their is one table
emptbl
colomn is emp_cd, emp_nm,emp_age

in last month their is 100 records in table and i have add 10 records in this table but i have select 100 record to last month but don't no which records and their is no date colom in table .

so it is posible to select a records to give a date refrence of sql server modificatin date.

please any suggestion and any one face this problem

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-04-22 : 00:59:42
That is not possible since you do not have a date/time column or any other way to track it. SQL Server isn't tracking it for you.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-04-22 : 04:56:58
do you have any audit tables maintained for this table using triggers?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

amirs
Constraint Violating Yak Guru

260 Posts

Posted - 2010-04-22 : 23:15:20
hi Visakh16
how can i posible this
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-04-23 : 01:57:01
quote:
Originally posted by amirs

hi Visakh16
how can i posible this


you mean audit tables? create a table with reqd column values for which you need to capture change and add a trigger for insert/delete/update which populates it

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-04-23 : 12:23:53
If you're going to implement audit tables via triggers, you might as well add a date/time column with a default of GETDATE().

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -