Posts tagged Tables
List of primary key fields within a database
03 years ago
in Transact-SQL
The query below lists the Table Name, Column Name, and Column ID for all Primary Key columns within a database
SELECT t.name AS TableName, c.name AS ColumnName, c.colid AS ColumnID
FROM sysindexes i
INNER JOIN sysobjects t
ON i.id = t.id
INNER JOIN sysindexkeys k
ON i.indid = [...]
List of table columns, with data types
23 years ago
in Transact-SQL
The Transact-SQL query below, returns the table name, column name, data type, and maximum length. This is useful when producing database documentation
SELECT
schema_name(O.schema_id) + '.' + O.name AS TableName,
C.name AS ColumnName,
T.name AS Type,
C.max_length AS [...]
MS Access – Remove “dbo_” prefix from imported tables
03 years ago
in Access
The procedure below, can be used to remove the “dbo_” prefix from all imported tables within a Microsoft Access Database.
Public Sub Remove_DBO_Prefix()
Dim obj As AccessObject
Dim dbs As Object
Set dbs = Application.CurrentData
'Search for open AccessObject objects in [...]