Renaming Linked Tables

D

Dave Ruhl

In a new database I linked about 100 SQL Server tables.
I would like to rename them to remove the "dbo_" that
precedes each name. I tried writing an update query on
the MSysyObjects table, but it is not updateable. Is
there a way to code a procedure to do this ?
 
G

Gerald Stanley

Try

Dim tbl As DAO.TableDef

For Each tbl In CurrentDb.TableDefs
If Left(tbl.Name, 4) = "dbo_" Then
tbl.Name = Mid(tbl.Name, 5)
End If
Next

Hope This Helps
Gerald Stanley MCSD
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top