MSSQL

Attaching and Detaching a Database

Detaching EXEC sp_detach_db 'SMSsid', 'true' Attaching EXEC sp_attach_db @dbname = N'SMSsid', @filename1 = N'C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\DATA\SMSsid.mdf', @filename2 = N'C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\DATA\SMSsid_log.ldf' Don’t forget to stop all service instances before performing a detach. »

Migrating Data From MSSQL2016server to MSSQL2012server

Right click on Database and select Database > Tasks Select Generate Scripts Proceed with Next until it asks you to specify how the script should be saved or published Click Advanced to fine-tune your requirements Enable SQL Triggers, Indexes and Primary Key (Unique Key) Set script for Server version: SQL Server 2012 Set types of data to script: Schema and Data After fine-tuning, hit next to see a summary. »

comments powered by Disqus