mssql(3)
-
MSSQL 네트워크 드라이브 연결
Connect only. EXEC sp_configure 'how advanced options',1 RECONFIGURE EXEC sp_configure 'xp_cmdshell',1 RECONFIGURE EXEC XP_CMDSHELL 'net use Z: \\10.0.0.1\m$ password /user:administrator' EXEC XP_CMDSHELL 'dir Z:' Connect 및 Disconnect -- 고급 옵션 활성 EXEC sp_configure 'how advanced options',1 RECONFIGURE -- xp_cmdshell 활성 EXEC sp_configure 'xp_cmdshell',1 RECONFIGURE -- 네트워크 드라이브 연결 EXEC XP_CMDSHELL..
2020.12.04 -
[mssql] Transact-SQL, DB detach attach
version: Microsoft SQL Server 2012 (SP3) ! If the procedure is running or using DB, you can't detach the Database. ! First, you have to check the Service in operation. After that, switching the database offline. use master; GO EXEC sp_detach_db @dbname = N'mydb'; GO ! After detach the databse, you can copy the mdf and ldf file. ! if the file copy is finished normally, you can attach the DB with ..
2020.10.14 -
[mssql] Transact-SQL, DB 파일 경로 이동(DB detach, attach)
version: Microsoft SQL Server 2012 (SP3) ! 사용 중인 프로시저가 있을 경우 detach가 진행 되지 않는다. ! 운영 서비스에 영향이 있는지 확인해보고 오프라인 전환 후 진행. ! If the procedure is running or using DB, you can't detach the Database. ! First, you have to check the Service in operation. After that, switching the database offline. use master; GO EXEC sp_detach_db @dbname = N'mydb'; GO ! detach 후, mdf 및 ldf 파일 복사 진행. ! After detach the dat..
2020.10.14