Is there a way to check my database and see if tables have been updated or not? I know there has got to be a query that I can run or something to check that. Does anyone have the query. Thanks.
Do you refer to data or schema updates? SQL Server tracks neither. There is no default date column you can check.
For data changes you could add a datetime column to the tables you want to track and update that column each time the table row is updated. Or you could track changes in an audit trail table. You can also purchase 3rd party audit software.
SQL Server does track schema changes but not by date. You can check the schema_ver for a table in the sysobjects table. schema_vers is updated each time an object's schema changes. If you are interested in tracking schema changes, you could create a table to track object schema_ver and a process that runs peridocally and checks for version changes. Terry L. Broadbent FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
So what you are telling me is that without adding columns to my tables, there is no way to see if there have been any updates or changes made to the table or data in the table. Correct?
Correct. There is no built-in audit trail. Terry L. Broadbent FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
On a different note, can you tell me why the following INSERT statement won't work?
CString insert = _T("INSERT INTO IRDDATA (DOT,VIN,TRANSPONDER_NUMBER,CARRIER_NAME,UNIT_NUMBER,GVW,REGISTRATION_EXPIRE_DATE,EXTRA_WEIGHT,EXTRA_LENGTH) VALUES (strDot,strVin,strTransp,strName,strUnit,strGvw,strRegDt,strExWeight,strExLength)"
m_db.ExecuteSQL(insert);
You may not understand all the variables but the statement goes INSERT INTO IRDDATA(column name, column name, ...)VALUES (string variable, string variable, etc.) Is this not the right syntax for the INSERT command? Thanks.
You didn't say what kind of message you get when you run the query so I can only guess. I would think that the problem is that the string variables require single quote delimiters in SQL Server.
Values ('string var1', 'string var2', ...) Terry L. Broadbent FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.