locked
format name of file .mdf RRS feed

  • Pergunta

  • Hi I have a problem. I have a directory with 1200 files. mdf which are identified as follows:

     
    Detach_20080501160012_P-WETHR01
     
    Detach_20080502160012_P-WETHR01
    etc.

    where 20080501-20080502 represent the date.
    05/01/2008 02/05/2008 ......

    My problem is that when read with SQL Server Management Studio Express
    it generates the database name "P-WETHR01" .. Therefore I can not attach two files. Mdf at a time because he thinks they have the same name.

    as I can read so that I build the full name of the format?
     
    thanks

    example:
    Detach_20080531160012_P-WETHR01
     
    and P-WETHR01
    • Movido Fernando Reyes terça-feira, 1 de junho de 2010 05:13 Se tratta de una pregunta de SQL (De:General)
    segunda-feira, 31 de maio de 2010 23:11

Respostas

  • Instead of using the menus in SSMSE, you can attach the files from a query window by means of the sp_attach_db stored procedure. This lets you specify both the file names and the database name, so you will be able to attach the different files as different databases.

    sp_attach_db [ @dbname= ] 'dbname'
            , [ @filename1= ] 'filename_n' [ ,...16 ]

     

     

    terça-feira, 1 de junho de 2010 07:56

Todas as Respostas

  • Instead of using the menus in SSMSE, you can attach the files from a query window by means of the sp_attach_db stored procedure. This lets you specify both the file names and the database name, so you will be able to attach the different files as different databases.

    sp_attach_db [ @dbname= ] 'dbname'
            , [ @filename1= ] 'filename_n' [ ,...16 ]

     

     

    terça-feira, 1 de junho de 2010 07:56
  • Hola.

    Este foro es en Español. Por favor, formule la pregunta es este idioma. También podemos mover el hilo a los foros en Inglés, si así lo deseas.


    Alberto López Grande (Visita mi blog en http://qwalgrande.blogspot.es/)
    terça-feira, 1 de junho de 2010 10:13
    Moderador