Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How does SQL-Server keeps track?

Status
Not open for further replies.

vbguy805

Programmer
Oct 17, 2006
23
US
I am imporing data using our own utility. Main function of the utility is read data record by record being imported, massage it to fit our requirements if necessary and then import it in our database in one session.During this process hundreds of tables and thousand of rows are affected. sometimes this number can go into millions.

I am trying to write separate utility, that would go and checke whateever data is imported. I want to know what data was impoted in one session.

Anyone have idea, when sql-server insert or update data does it keep track of those transactions in some kinda system table or so? I know there is something "datelastmodified". I am not sure its same what I am looking for.

Any idea?
 

I think you may have to populate the "timestamp" your self. Will every imported record write to 100 tables? Or would a certain type of record write to a few tables and another type of record write to another set of tables.

Not sure if this will help you. From BOL:

@@DBTS
Returns the value of the current timestamp data type for the current database. This timestamp is guaranteed to be unique in the database.

Syntax
@@DBTS

Return Types
varbinary

Remarks
@@DBTS returns the current database's last-used timestamp value. A new timestamp value is generated when a row with a timestamp column is inserted or updated.

Examples
This example returns the current timestamp from the pubs database.

USE pubs
SELECT @@DBTS

 
Thank you for your help.Records are imported according to table.Not all information is picked up from source database.
May be you are right I was looking for better option.
 
You would need to write those checks manually.

SQL doesn't keep track of what loads the data or when it was loaded.

Denny
MCSA (2003) / MCDBA (SQL 2000)
MCTS (SQL 2005 / Microsoft Windows SharePoint Services 3.0: Configuration / Microsoft Office SharePoint Server 2007: Configuration)
MCITP Database Administrator (SQL 2005) / Database Developer (SQL 2005)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top