Hello,
I have a database in enterprise manager which has some tables.
I want to change the database name but I can't find a way.
I also tried to create a new database with the desired name and copy all
the tables to it. However I can't find a way to copy tables in
Enterprise Manager.
These things are really simple when using an Access database but I can't
find how to do it in MSSQL.
Can someone help me out?
Thank You,
Miguel
Use Query Analyzer instead of Enterprise Manager. The command you are looking for is ALTER DATABASE
(you find exact syntax in Books Online).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Shapper" <mdmoura*NOSPAM*@.gmail.*DELETE2SEND*com> wrote in message
news:ORYsQtARFHA.2972@.TK2MSFTNGP14.phx.gbl...
> Hello,
> I have a database in enterprise manager which has some tables.
> I want to change the database name but I can't find a way.
> I also tried to create a new database with the desired name and copy all the tables to it. However
> I can't find a way to copy tables in Enterprise Manager.
> These things are really simple when using an Access database but I can't find how to do it in
> MSSQL.
> Can someone help me out?
> Thank You,
> Miguel
>
|||sp_renamedb
Changes the name of a database.
Syntax
sp_renamedb [ @.dbname = ] 'old_name' ,
[ @.newname = ] 'new_name'
"Shapper" wrote:
> Hello,
> I have a database in enterprise manager which has some tables.
> I want to change the database name but I can't find a way.
> I also tried to create a new database with the desired name and copy all
> the tables to it. However I can't find a way to copy tables in
> Enterprise Manager.
> These things are really simple when using an Access database but I can't
> find how to do it in MSSQL.
> Can someone help me out?
> Thank You,
> Miguel
>
|||One reason I prefer ALTER DATABASE to sp_renamedb is that sp_renamedb will be removed in a future
version of SQL server. This is what Books Online for SQL Server 2005 has to say about sp_renamedb:
"This feature will be removed in a future version of SQL Server. Avoid using this feature in new
development work, and plan to modify applications that currently use the feature. Use ALTER DATABASE
MODIFY NAME instead. For more information, see ALTER DATABASE (Transact-SQL)."
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"andsm" <andsm@.discussions.microsoft.com> wrote in message
news:63041744-7DF9-4537-9C9B-B87F4B7CDBE9@.microsoft.com...[vbcol=seagreen]
> sp_renamedb
> Changes the name of a database.
> Syntax
> sp_renamedb [ @.dbname = ] 'old_name' ,
> [ @.newname = ] 'new_name'
>
> "Shapper" wrote:
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment