SqlServerDrive

Sunday, August 18, 2013

Renaming the database

in this example I am renaming the test2 database to test3 database

alter database [test2]
set single_user

GO
alter database [test2]
modify name = [test3]

alter database [test3]
set multi_user
Posted by Hari Prasad Ere Tech Blog at 2:07 PM
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

About Me

Hari Prasad Ere Tech Blog
View my complete profile

Blog Archive

  • ►  2015 (2)
    • ►  March (1)
    • ►  February (1)
  • ►  2014 (3)
    • ►  March (2)
    • ►  January (1)
  • ▼  2013 (14)
    • ►  September (1)
    • ▼  August (11)
      • Renaming the database
      • How to rebuild or Restore corrupted master database?
      • Blocking Locks and Deadlocks
      • How do you attach a mdf data file without a log f...
      • Return SQLResult set into a HTML format.(Microsoft...
      • Contained Databases
      • Do you backup tempdb database?
      • How do you create a database in sql server?
      • How many file groups does database contains?
      • why you need to install more than one instance of ...
      • How many SQLserver instance can own on a single ma...
    • ►  July (1)
    • ►  February (1)
  • ►  2012 (3)
    • ►  May (1)
    • ►  April (1)
    • ►  February (1)
Simple theme. Powered by Blogger.