by
3,725 13
2
5
3,311
9
Top 1% !
Famous
Tagged
Specified
OpenSource
Popularity: 3700th place

Published on:

DBMSMS SQL Server
Languaget-sql

Rename Logical Name Database SQL Server

Changes the logical name of a database
Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/878146/Rename-Logical-Name-Database-SQL-Server?startLine=0"></iframe>
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
// Enter here the actual content of the snippet. -- Rename logical names (only needed if restoring from a backup for a Different database): ALTER DATABASE MyDatabase MODIFY FILE (NAME = 'OrigDatabase_Data', NEWNAME = 'MyDatabase_data') GO ALTER DATABASE MyDatabase MODIFY FILE (NAME = 'OrigDatabase_Log', NEWNAME = 'MyDatabase_log') GO
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus