How to find the date and time of last updated table?
Answers were Sorted based on User's Feedback
Answer / monal
USE TRIGGER OR ADD DATETIMESTAMP COLUMN IN A TABLE WITH
DEFAULT VALUE OF GETDATE()
| Is This Answer Correct ? | 9 Yes | 2 No |
Answer / sanjeev kumar
SELECT OBJECT_NAME(OBJECT_ID) AS tablename,
last_user_update
FROM sys.dm_db_index_usage_stats
WHERE database_id = DB_ID( 'your_database_name')
and user_updates>0
order by last_user_seek desc
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / smitha
select name,create_date,modify_date from sys.tables
order by modify_date desc
| Is This Answer Correct ? | 5 Yes | 3 No |
Answer / vidit tyagi
SELECT OBJECT_NAME(OBJECT_ID) AS DatabaseName,
last_user_update,*
FROM sys.dm_db_index_usage_stats
WHERE database_id = DB_ID( 'DataBaseName')
AND OBJECT_ID=OBJECT_ID('TableName')
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / ram
USE TRIGGER OR ADD DATETIMESTAMP COLUMN IN A TABLE WITH
DEFAULT VALUE OF GETDATE()
| Is This Answer Correct ? | 1 Yes | 1 No |
select scn_to_timestamp(max(ora_rowscn)) from <TN>
| Is This Answer Correct ? | 0 Yes | 0 No |
* CREATE TABLE [dbo].[t_Colors]([ColorId] [int] NOT NULL,[ColorName] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [ColorDesc] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,[ColorIndex] [int] NULL) ON [PRIMARY] GO * insert into [t_Colors] values(101,'Red','',1) insert into [t_Colors] values(101,'Red1','',2) insert into [t_Colors] values(102,'Blue','',1) insert into [t_Colors] values(102,'Blue1','',2) insert into [t_Colors] values(102,'Blue2','',3) * In this table i need to delete DELETE FROM t_Colors WHERE ColorIndex=1 AND ColorId=102 After delete above condition i need to update the ColorIndex set to 1 for Blue1[ColorName] and 2 for Blue2[ColorName] select * from [t_Colors] Note:- how can i get updates the ColorIndex values after delete. for example we need to update Blue1 ColorIndex set to 1 and Blue2 ColorIndex set to 2
Why I have to use stored procedures?
What are indexes? When do you need to create Indexes?
4 Answers CarrizalSoft Technologies, HP,
What is a transaction and what are ACID properties?
Write a SQL queries on Self Join and Inner Join.
How to create a login account in ms sql server to access the database engine using "create login" statements?
What stored by the master?
What are the different normalization forms?
What do you mean by the term 'normalization'?
what is joins please explain breffly ??
Can the “if update (colname)” statement be used in a delete trigger?
1. What are the grouping function in SQL ? 2. If base table of a view deleted means, what will happen while we querying on view ? will give any error ? 3. Difference between DROP, DELETE, TRUNCATE table ? 4. What is constraints and types ? 5. What is max size of nchar & nvarchar ? 6. Define ROLLBACK, COMMIT, SAVE POINT 7. How non-clustered better ? or rank the Clustered, Non-Clustered and Table scan in performance wise 8. Select 10 rows from a table ? 9. Define DML, DDL, DCL, DTL commands ? 10. What is mean by NULL value ? NULL means "" or 0 or undefined ? 11. Default constraints ? 12. Can we have more then primary Key in table ? 13. Type of integrity ? Entity, Referential, Domain ?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)