Ult. Alteração: 

Alterado por: 

Attach

Anexa um banco de dados a um servidor, ou seja, se o banco de dados LDF e MDF não existe no gerenciador você pode utilizar a função do Attach. Exemplo para troca de servidor ou reinstalação do SQL.


sp_attach_db @dbname = 'DB_IDE_AllegroLoja',

@filename1 = 'C:\AllegroNet\DB_IDE_AllegroLoja.mdf',

@filename2 = 'C:\AllegroNet\DB_IDE_AllegroLoja_log.ldf'


sp_attach_db @dbname = 'DB_IDE_TabelasPrecos',

@filename1 = 'C:\AllegroNet\DB_IDE_TabelasPrecos.MDF',

@filename2 = 'C:\AllegroNet\DB_IDE_TabelasPrecos_Log.LDF'


O MDF e LDF não dispensa o procedimento de Backup quando for troca de servidor.


Possíveis Problemas

  • “Database 'DB_IDE_AllegroLoja' already exists. Choose a different database name”:

— Banco de dados já existe no gerenciador


  • “The file "C:\AllegroNet\DB_IDE_AllegroLoja.mdf" is compressed but does not reside in a read-only database or filegroup. The file must be decompressed.

The file "C:\AllegroNet\DB_IDE_AllegroLoja_Log.ldf" is compressed but does not reside in a read-only database or filegroup. The file must be decompressed. 

Problems were identified while planning for the RESTORE statement. Previous messages provide details. RESTORE DATABASE is terminating abnormally.":         ]

— Desmarcar a opção "Compactar o conteúdo para economizar espaço em disco" na propriedade da pasta AllegroNet (botão Avançado na aba Geral)

Created with the Personal Edition of HelpNDoc: Effortlessly upgrade your WinHelp HLP help files to CHM with HelpNDoc