Last post Aug 21, 2019 03:54 PM by limno
Aug 19, 2019 11:47 PM|oneillj|LINK
Years ago, I uploaded a web site to my old hosting service. It renamed the tables to UserName_admin.TableName. I have a new hosting service now, and I'd like to upload it with just the default schema in case they want to rename the table. To access the tables
with my local workstation, I have to refer to them by the full schema name. So, there might be some potential problems when I upload the old tables. So, how do I change the default schema in SQL Server 2008?
Aug 20, 2019 08:39 AM|Yongqing Yu|LINK
According to your description, I am not very clear about what you want to change about the default schema?
And what's the potential problems when you upload tables?
There is a link about how to change the default schema in Sql Server 2008, you can refer to it:
Default Schema for Windows Group in SQL Server
Aug 21, 2019 03:36 AM|oneillj|LINK
This is an old table and when I uploaded the database to my hosting service years ago, the names of the tables changed my username_admin.tablename. I guess it was so they can name the tables by what account owned them. I'm about to upload the same table
to another hosting service. If I use the fully qualified name, and this hosting service does the same thing, there's now telling what the name will be. If push comes to shove, I suppose I can just export it and reimport it to another database with the original
name. I was just hoping for an easier way to do it. I'm using the default schema of dbo.tablename now.
Aug 21, 2019 03:54 PM|limno|LINK
You can transfer all tables' schema to a different schema with this non-supported MS stored procedure:
exec sp_MSforeachtable 'ALTER SCHEMA testSchema TRANSFER ?'