Table Modified
Jan 14, 2004Hi all,
Sql server 7
Is there anyway to findout if list of tables that has been modified after august 2003 in a database.
Waiting for ur reply.
TIA
Adil
Hi all,
Sql server 7
Is there anyway to findout if list of tables that has been modified after august 2003 in a database.
Waiting for ur reply.
TIA
Adil
I created am inventory table with few columns say, Servername, version, patching details, etc
I want a tracking of the table.
Let's say people are asked to modify the base table and I want a complete capture of the details modified and the session of the user ( ) who (system_user) is actually modifying the details.
Does anyone know how to get a table's 'last modified date' in SQL 7 ?
Sysobjects contains the 'create date', but I can't find a 'last modified date' anywhere......
Hello All,I would like to get last modified timestamp for a table. Is there any way toget that information using any commands?Thanks in Advance,Muthu.
View 2 Replies View RelatedHi,
How to find out the Last Modified (Structure) in the SQL Table?. Is there any query please let me know.
Regards,
S.Balavenkatesh
Hi Everybody,
i am it sutck when i am writing this sql in sqlserver2005
my requirement is to list all the table name and along with their filed name if some one modified (table definition ) for a specifc date range ?
is there any way to get these information in sql server 2005 ?
regards
sujithf
I am looking for two sql scripts,1. How can i check when a tables structure was last modified? 2. How can i find the structure differences between two databases that were created the same but changed over time individualy?Looking for sql scripts to do this. Any help on either would be great.Thanks
View 2 Replies View RelatedHi
View 9 Replies View RelatedHi all,
What is the best way to show when a table was last MODIFIED?
Thanks,
Stan
Hello again,
Two Short questions this time,
I have a table with several indexes, currently most of them are very narrow (one column), and the question is, when I modify the table by updating a record, does all the indexes are calculated again?? Even if the modified field isn't indexed??? Or the server is smart and knows what indexes to calculate if any.
Second question, can I give to a query a low priority(In dynamic SQL), for example when I don't want my query to exploit too many system resources so it won't interfere the main system ?
Inon.
Is anyone aware of a method of determining when a table was last modified or accessed?
Some of our databases have tables that I am sure are not being used and I would like to generate a list of tables that have not been accessed or modified for some period of time.
I looked for a system procedure but didn't see anything that satisfied my need.
Currently I rename suspect tables and wait for someone or some process to gripe, but I don't care for that method for obvious reasons.
Thanks!
hello everybody,
i have one problem, I want to check the database table modified or not for every five minutes , how can check? please help me
Senthil
I'm curious if there is a quick way to query the date/time a table was lastmodified? I appreciate any tips or suggestions provided!TIA - Rob
View 2 Replies View RelatedThis is my table:
ID AppName DepCode DepName Group ModifiedDate YearlyAmount
1 Nestle NS Foods Products 01/12/14 451
1 Nestle NS Foods Products 01/17/14 495
2 Oracle OR Software Info 01/24/14 279
2 Oracle OR Soft & IT Info 01/26/14 310
2 Oracle ORL Software Info 01/25/14 219
2 Oracle ORL Soft IT 01/28/14 600
MonthlyAmount Funded AppCategory Research
37.5623 Yes NE NA
41.2365 No N NA
23.2568 Yes OR InProgress
25.8333 Yes ORL NA
18.2189 Yes SOF Approved
50.0000 No IT RejectedExpected Output:
ID AppName DepCode DepName Group ModifiedDate YearlyAmount
1 Nestle NS Foods Products 01/17/14 946
2 Oracle OR Soft & IT Info 01/26/14 589
2 Oracle ORL Soft IT 01/28/14 819
MonthlyAmount Funded AppCategory Research
78.7988 No N NA
49.0901 Yes ORL NA
68.2189 No IT Rejected
I want to pick the recent modified date for DepCode and sum Yearly and Monthly Amount. I have tried this query and not able to get the output. This is the single table.
select B1.[ID], B1.[AppName], B1.[DepCode], B1.[DepName], B1.[Group],
B2.ModifiedDate, B2.YearlyAmount, B2.MonthlyAmount,
B1.[FuBded], B1.[AppCategory], B1.[Research]
FROM Business B1
INNER JOIN
(select [ID], MAX(ModifiedDate) as ModifiedDate, SUM(YearlyAmount) as YearlyAmount,
SUM(MonthlyAmount) as MonthlyAmount
from Business
Group by ID) B2
ON B1.ID = B2.ID AND B1.ModifiedDate = B2.ModifiedDate
If I have a view such as: SELECT T.* FROM T
When I add a column to table T the view is not updated to reflect that change.
Furthermore, if there are other columns after the * in the view (for example SELECT T.*, GETDATE() as "My Date" FROM T) the last columns will contain incorrect data.
Is there a work around for this? An "auto-recompile when tables are modified" kind of option?
Thanks
Nick
PS: This is the script I used for testing:
create table tt (
test1 int primary key,
test2 int)
go
insert into tt (test1, test2) values (1,2)
go
create view vw_tt as select *, getdate() as "My Date" from tt
go
select * from vw_tt
go
create view vw_tt2 as select * from tt
go
alter table tt add test3 int
go
select * from vw_tt
select * from vw_tt2
select * from tt
drop table tt
drop view vw_tt
drop view vw_tt2
Hello,
I am using SQL Server 2005 and ASP.NET 2.0. We have a very simple content management system where we have to keep track of date last modified for each row in all of our content tables. I know there's a "timestamp" datatype that is used for replication scenarios, but is there anything similar that I can use to set up a date_modified column for each of my content tables that will automatically update with GETDATE() whenever anything in a given row is updated?
Or do I have to create a date_modified column of smalldatetime datatype and write a trigger on update for EVERY single table of content that I have in the database? It seems there should be an easier way to do this than to write 20 triggers for my 20 content tables.
Thanks!
I've a table with more columns and 1 identifier. I need to write this table when a modified row is detecting respect to the columns not to the identifier.
So I've created a temporary table to put the potential rows to write on the real table, but I want to detect the modified rows. I've thought to use the checksum function, but I don't know how to use it and if it could be useful in this scenario.
Moreover, in the temporary table I've collected daily the rows to write: the first day a row could have a value respect to his columns, the next day a different value and the next one the same value respect to the first day.
Hi
Any one please tell me is there any possible way to identify the table modified date.
I have checked the table created date from sysobjects or by right click properties. my requirement is to identify the exact date of table modification and column creation,alter dates.
Is there any such provision in sql server 2000 or 2005 , My application is in sql server 2000.
I need to confirm this because some database structure modification has affected my application and causing dataloss i need to check with the date of structural change of table and lost data date
can any one help
Is there any way for me to return the row that was last entered? If so, how do I go about accomplishing this?
For example,
Column1-Plant NameColumn2-Creation DateColumn3-Comments
Bayport 12305/24/01 2:51 AMAirflow became unstable
Bayport 12305/24/01 4:00 AM
Bayport 12305/24/01 5:36 AMNo events
Bayport 12305/24/01 1:00 PM
Bayport 12305/26/01 2:45 PMNo events
Bayport 12305/26/01 3:12 PMStarted liquifier 25% LIN
Bayport 405/24/01 2:51 AMSwung liquifier 0% to LIN
Bayport 405/26/01 5:45 AM
Bayport 405/26/01 5:15 PMLiquifuer @ 25% LIN
Coatesville05/24/01 9:32 AM
Coatesville05/26/01 4:25 PMNo events
If I were to query against 5/26, I would want my result to return as:
Bayport 123 5/26/01 3:12 PM (because this was the last row entered on the 26th) Started liquifier 25% LIN.
Bayport 4 5/26/01 5:15 PM (because this was the last row entered on the 26th) Liquifier @ 35% LIN.
Coatesville 5/26/01 4:25 PM No events.
I am taking a "complete backup" of my production db every day using Backupagent of Arcserver 2000. But the Modified Date of .mdf and .ldf files show an older date. Is it normal?
Thanks
Wilson
Does anyone know how to get stored procedure or for that matter any other object last modified time?
View 1 Replies View RelatedHere's an updated version of bigtables.sql that also displays the ratio of index size to data size and the percentage of unused space per table. I've found the index to data ratio particularly helpful for finding and fixing over-indexing.
Cheers
-b
/**************************************************************************************
*
* BigTables.sql
* Bill Graziano (SQLTeam.com)
* graz@sqlteam.com
* v1.11
*
**************************************************************************************/
declare @idint
declare @typecharacter(2)
declare@pagesint
declare @dbname sysname
declare @dbsize dec(15,0)
declare @bytesperpagedec(15,0)
declare @pagesperMBdec(15,0)
create table #spt_space
(
objidint null,
rowsint null,
reserveddec(15) null,
datadec(15) null,
indexpdec(15) null,
unuseddec(15) null
)
set nocount on
-- Create a cursor to loop through the user tables
declare c_tables cursor for
selectid
fromsysobjects
wherextype = 'U'
open c_tables
fetch next from c_tables
into @id
while @@fetch_status = 0
begin
/* Code from sp_spaceused */
insert into #spt_space (objid, reserved)
select objid = @id, sum(reserved)
from sysindexes
where indid in (0, 1, 255)
and id = @id
select @pages = sum(dpages)
from sysindexes
where indid < 2
and id = @id
select @pages = @pages + isnull(sum(used), 0)
from sysindexes
where indid = 255
and id = @id
update #spt_space
set data = @pages
where objid = @id
/* index: sum(used) where indid in (0, 1, 255) - data */
update #spt_space
set indexp = (select sum(used)
from sysindexes
where indid in (0, 1, 255)
and id = @id)
- data
where objid = @id
/* unused: sum(reserved) - sum(used) where indid in (0, 1, 255) */
update #spt_space
set unused = reserved
- (select sum(used)
from sysindexes
where indid in (0, 1, 255)
and id = @id)
where objid = @id
update #spt_space
set rows = i.rows
from sysindexes i
where i.indid < 2
and i.id = @id
and objid = @id
fetch next from c_tables
into @id
end
select top 25
Table_Name = (select left(name,25) from sysobjects where id = objid),
rows = convert(char(11), rows),
reserved_KB = ltrim(str(reserved * d.low / 1024.,15,0) + ' ' + 'KB'),
data_KB = ltrim(str(data * d.low / 1024.,15,0) + ' ' + 'KB'),
index_size_KB = ltrim(str(indexp * d.low / 1024.,15,0) + ' ' + 'KB'),
unused_KB = ltrim(str(unused * d.low / 1024.,15,0) + ' ' + 'KB'),
idx_data_ratio = ltrim(str(indexp*100 /data) + '%'),
unused_pct = ltrim(str(unused * 100 /reserved) + '%')
from #spt_space, master.dbo.spt_values d
where d.number = 1
and d.type = 'E'
order by reserved desc
drop table #spt_space
close c_tables
deallocate c_tables
Edited by graz to add code tags around the code.
dear friends,
iam new to ssql server.i want to find the modified date of stored procedures. can any one help me in this
Is there a way to see the last modified date on the Table structure or a stored Procedure in SQL Server 2000?
Thx
Hello,Is there a way in MSSQL server to find all the objects in the databasebased on the modified date rather than the created date.Thanks in advanceKumu
View 1 Replies View RelatedI have stored procedure to show 10 new record from table:SELECT TOP 10 *FROM tableWHERE (id = @id)ORDER BY id DESC and work fine.I'd like to show 10 new record and include modified record as new record. Wo to do that?
View 5 Replies View RelatedHi all
My manager ask me to provide him with the total number of records which have been added, deleted or modified on a certain database in SQL Server 2000 during the month of September. Is there away to get that information from the transaction log or by any how?
please some one guide me how to do that?
Your help is highly appreciated
hi,
I want to find the modified database objects(Tables, Proc and Fun) in last 3 days in SQL 2000.
With Regards
Praveen (DBA)
Hi,
I have data that sometimes will be modify. when modify the new data will be insert and the old data still remain inside the database. The same item have their own unique id. So I want to query the data that last modified. How?
Thanks
if you all add ID's with your Inserts and Modified (Date) fields. Such as 1 would indicate if the record was inserted manually, whereas 2 might indicate it was update or inserted by a web application.
View 2 Replies View RelatedHi,
I want to retrieve the values from store_geofence table where the timeduration exceeds certain interval
the procedure is as below
CREATE
procedure [dbo].[GeofenceByCustomer]
@regno nvarchar(50),
@frmdate nvarchar(50),
@todate nvarchar(50),
@Geofence nvarchar(50),
@interval int,
@userid nvarchar(50)
as
begin
declare @val int
Declare @strSql as nvarchar(3000)
Select @val=count(*) from basestation where superuserid=@userid and
base_station_name=@Geofence
--if(@val=0)
begin
create table #templ(registrationno nvarchar(50),basestation
nvarchar(50),entry_time datetime,exit_time datetime,duration
int)
select @strSql='
insert into #templ(registrationno,basestation,entry_time,exit_time,duration)
select
registrationno,basestation,entry_time,exit_time,datediff(mi,entry_time,exit_time)
as duration from store_geofence where entry_time>'+@frmdate+' and
exit_time<'+@todate+' and datediff(mi,entry_time,exit_time)>'+@interval+'
and basestation in ('+@Geofence+') order by entry_time,registrationno'
execute (@strSql)
print @strSql
select * from #templ
drop table #templ
end
end
GO
I should specify the duration in int to take affect
datediff(mi,entry_time,exit_time)>'+@interval+'
but i do not know how to rewrite this path
i cannot put as
datediff(mi,entry_time,exit_time)>'+@interval+'
it returns an error
Syntax error converting the nvarchar value '
insert into #templ(registrationno,basestation,entry_time,exit_time,duration)
select
registrationno,basestation,entry_time,exit_time,datediff(mi,entry_time,exit_time)
as duration from store_geofence where entry_time>01/01/2008 and
exit_time<01/01/2008 and datediff(mi,entry_time,exit_time)>' to a column of data type int.
How should i rewrite it
please help
regards
cmrhema
If we want to get the changes happened in database we will get through sys.objects or sys.tables .but we are only getting it table name . But how to get by table name and what the column added to that table or what column has been modified (datatype or constraint) .
For example if i added employee table column called deptid it should be shown in changes in geiven date
SELECT
modify_date
,type_desc
,name
FROM sys.objects
WHERE is_ms_shipped=0
--AND modify_date>='yyyy/mm/dd' <--optionally put in your date here
ORDER BY 1 DESC
How to get column name of a table which is modified...
I have a datetime field in a table want to use to record the date time last the row/field of the row is modified.
Can I do this in SQL Server 2005 without writing any code/trigger?
Thanks
J.