How can I get a list of tables in a database without a timestamp column?
Any suggestions?
Answers. Yes, your accessement regarding timestamp is correct and you should have it in all tabels in SQL especially if you have Access front end. This will eliminate a possible problem with Access that another user has changed or modified a row since you have opened the record. >>
MyTable) and hit ALT + F1 , you'll get a list of column names, type, length, etc.
Using INFORMATION SCHEMA views:
select * from INFORMATION_SCHEMA.TABLES T where NOT EXISTS
(
select 1
from INFORMATION_SCHEMA.COLUMNS
where TABLE_CATALOG = T.TABLE_CATALOG
and TABLE_SCHEMA = T.TABLE_SCHEMA
and TABLE_NAME = T.TABLE_NAME
and DATA_TYPE = 'timestamp' -- or the literal representing timestamp data type
)
Using SYS.TABLES/SYS.COLUMNS:
SELECT name FROM SYS.TABLES
WHERE object_id NOT IN (select object_id
FROM SYS.COLUMNS
WHERE system_type_id = 189)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With