问题
I've designed my SQL CE tables using the built-in designer in VS2008. I chose the wrong names for a couple. I am now completely stuck trying to find a way to rename them.
I am refusing to believe that such a feature could have been "forgotten". How do I rename an existing table using the VS2008 designer, or a free stand-alone app?
回答1:
Not sure about doing it via VS2008, but you can use sp_rename
: Changes the name of a user table in the current database. Currently, sp_rename support in SQL Server Compact 3.5 is limited to tables.
sp_rename [ @objname = ] 'object_name',
[ @newname = ] 'new_name'
[ , [ @objtype = ] 'object_type' ]
回答2:
To rename the table oldtable to newtable:
sp_rename 'oldtablename', 'newtablename';
来源:https://stackoverflow.com/questions/1528805/how-do-i-rename-a-table-in-sql-server-compact-edition