Restore Database from MDF & LDF Files in ms-sql

In CategoryMS-Sql
Byadmin

Restore Database from MDF & LDF Files

Note: do not create new database, this command will create new database automatically, if you created database already then suggestion is to delete the database else it will not work

EXEC sp_attach_db @dbname = ‘eshop’,

@filename1 = ‘C:\eshop.mdf’,

@filename2 = ‘C:\eshop_log.ldf’;

 eshop: Replace with your new database name

C:\eshop.mdf: Replace with where your mdf files is located

C:\eshop.ldf: Replace with where your ldf files is located

How to change Table SCHEMA in ms-sql

In CategoryMS-Sql
Byadmin

Change Table SCHEMA

Note: This sql query only works with ver. 2005 & later

“ALTER SCHEMA dbo TRANSFER CMS.Table_Name “

dbo:  Replace with your new table schema

CMS:  Replace with your old table schema

Table_Name: Replace with your table name