Showing posts with label attach. Show all posts
Showing posts with label attach. Show all posts

Friday, March 30, 2012

How to attach/deattach a Express database to a fullblown SQL Server 2005

Hi. I would like to if its possible to take a Express ".mdf" file and attach it to a full blown SQL Server 2005?, to "attach" it to a real SQL Server 2005?. And how do i do this?. or do i have to do it since there is a "DataDirectory" directive that manage this for me in the connectionstring?, im a little newbie about this :)

You have two options both are covered in the thread below, if you have more questions post again. Hope this helps

http://forums.asp.net/1194348/ShowPost.aspx

How to attach some extra PDF document into my report

I neet to attach ( embed ) some extra documents end of my quote form
conditionaly by Quote Products
please help :-)On Apr 18, 11:00 am, ilker tiryaki
<ilkertiry...@.discussions.microsoft.com> wrote:
> I neet to attach ( embed ) some extra documents end of my quote form
> conditionaly by Quote Products
> please help :-)
As far as I know, the only way to do this would be via an image
control; however, this would add a lot of size to the report, etc. The
best way to handle this is to access the PDF, etc from a custom web
application that also has access to the Report Server. Sorry I could
not be of further assistance.
Regards,
Enrique Martinez
Sr. Software Consultant

How to Attach MS Access Database to MSDE

I have a program installation setup that comes with a default MS Access Database. How do I attach this default database into MSDE on my server?
Message posted via http://www.sqlmonster.com
You cannot attach Access databse file (*.mdb/*.mde) to SQL Server/MSDE, they
are completely different thing , except for being called "database" and
being from MS. But you can use any available tools you know to transfer the
Access database (structure and/or data) to a database on MSDE. If you have
Access2K or later, open the Access *.mdb file, click menu "Tools->Database
Utilities->Upsizing Wizard...". It will lead you to "Upsize" your Access
database to SQL Server/MSDE database. After running the wizard, you may
still need to do some manual changes on the newly created database on MSDE
to make sure PK/Index, data types are OK, and since Access queries may not
may not be transferred into the database on MSDE, you definitely have
re-write some or all of queries you used in the Access file with views or
stored procedures in MSDE.
"Cedric Boo via SQLMonster.com" <forum@.SQLMonster.com> wrote in message
news:aa84e44efc594341b542ca374dd4a3df@.SQLMonster.c om...
> I have a program installation setup that comes with a default MS Access
Database. How do I attach this default database into MSDE on my server?
> --
> Message posted via http://www.sqlmonster.com
|||Hello,
the upsizing tool crashed for me with a overflow error. I use MSDE2000a, that doesn't include the dtsrunui tool ,( so any help how i get a access db to msde2000a ? I check dtsrun , but im very confused how to use it. How i get the data from the access db,
which is a file not a server like dtsrun expected.
Message posted via http://www.sqlmonster.com
|||hi Alexander,
Alexander Baumgart via SQLMonster.com wrote:
> Hello,
> the upsizing tool crashed for me with a overflow error. I use
> MSDE2000a, that doesn't include the dtsrunui tool ,( so any help how
> i get a access db to msde2000a ? I check dtsrun , but im very
> confused how to use it. How i get the data from the access db, which
> is a file not a server like dtsrun expected.
regarding Access Upswize Wizard problems, please have a look at
http://support.microsoft.com/default...;EN-US;Q237980
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.10.0 - DbaMgr ver 0.56.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply

How to attach mdf files which are residing on other machine

SQL Server 2005 and the related databases are on one server. Due to

space constraints I have to move one of the database(mdf & ldf) to

second server and access the same from the 1st server.

The following are the steps I ned to follow on the 1st server:

    Detached the database

    Moved the mdf & ldf files to 2nd machine/server

    Attach the database pointing to the 2nd server.

The 1st and 2nd steps went fine, the problem is with the 3rd step.

In the Attach Databases window, I clicked on ADD, it opened LOCATE

DATABASE FILE, the folder structure of the 1st server. Is there any way

I can change the SELECTED PATH and poin to the 2nd server?

I did even mapped network drive to the 2nd server but the mapped drive

is not getting displayed in the LOCATE DATABASE FILE folder structure.

Can we attach mdf/ldf files which reside on other machine?

Thanks in advance.

No - you can't use mdf, ldf or ndf files on devices which are not directly attached to SQL Server. It can't resolve shares, drive mappings, or redirects at this low a level.

Buck Woody

|||Network databases are normally not recommended. Unless your network storage meets strict I/O requirements, it's _not_ supported.

That's said, you can mount a network database if you enable trace flag 1807.

http://support.microsoft.com/kb/304261
http://msdn2.microsoft.com/en-us/library/ms176061.aspx
http://www.microsoft.com/sql/alwayson/default.mspx
http://www.microsoft.com/technet/prodtechnol/sql/2000/maintain/sqlIObasics.mspx

How to attach mdf files which are residing on other machine

SQL Server 2005 and the related databases are on one server. Due to space
constraints I have to move one of the database(mdf & ldf) to second server
and access the same from the 1st server.
The following are the steps I ned to follow on the 1st server:
1. Detached the database
2. Moved the mdf & ldf files to 2nd machine/server
3. Attach the database pointing to the 2nd server.
The 1st and 2nd steps went fine, the problem is with the 3rd step.
In the Attach Databases window, I clicked on ADD, it opened LOCATE DATABASE
FILE, the folder structure of the 1st server. Is there any way I can change
the SELECTED PATH and poin to the 2nd server?
I did even mapped network drive to the 2nd server but the mapped drive is
not getting displayed in the LOCATE DATABASE FILE folder structure.
Can we attach mdf/ldf files which reside on other machine?
Thanks in advance.> Can we attach mdf/ldf files which reside on other machine?
Short answer: No.
Long answer: Yes, with the proper trace flag, but you don't want to do that (trust me). See
http://support.microsoft.com/?id=304261
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"mallykarjun" <mallykarjuna@.mallykarjuna.com> wrote in message
news:5e451cd9d0a042e2b8571d9eee45d779@.ureader.com...
> SQL Server 2005 and the related databases are on one server. Due to space
> constraints I have to move one of the database(mdf & ldf) to second server
> and access the same from the 1st server.
> The following are the steps I ned to follow on the 1st server:
> 1. Detached the database
> 2. Moved the mdf & ldf files to 2nd machine/server
> 3. Attach the database pointing to the 2nd server.
> The 1st and 2nd steps went fine, the problem is with the 3rd step.
> In the Attach Databases window, I clicked on ADD, it opened LOCATE DATABASE
> FILE, the folder structure of the 1st server. Is there any way I can change
> the SELECTED PATH and poin to the 2nd server?
> I did even mapped network drive to the 2nd server but the mapped drive is
> not getting displayed in the LOCATE DATABASE FILE folder structure.
> Can we attach mdf/ldf files which reside on other machine?
> Thanks in advance.

How to attach mdf files which are residing on other machine

SQL Server 2005 and the related databases are on one server. Due to space
constraints I have to move one of the database(mdf & ldf) to second server
and access the same from the 1st server.
The following are the steps I ned to follow on the 1st server:
1. Detached the database
2. Moved the mdf & ldf files to 2nd machine/server
3. Attach the database pointing to the 2nd server.
The 1st and 2nd steps went fine, the problem is with the 3rd step.
In the Attach Databases window, I clicked on ADD, it opened LOCATE DATABASE
FILE, the folder structure of the 1st server. Is there any way I can change
the SELECTED PATH and poin to the 2nd server?
I did even mapped network drive to the 2nd server but the mapped drive is
not getting displayed in the LOCATE DATABASE FILE folder structure.
Can we attach mdf/ldf files which reside on other machine?
Thanks in advance.> Can we attach mdf/ldf files which reside on other machine?
Short answer: No.
Long answer: Yes, with the proper trace flag, but you don't want to do that
(trust me). See
http://support.microsoft.com/?id=304261
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"mallykarjun" <mallykarjuna@.mallykarjuna.com> wrote in message
news:5e451cd9d0a042e2b8571d9eee45d779@.ur
eader.com...
> SQL Server 2005 and the related databases are on one server. Due to space
> constraints I have to move one of the database(mdf & ldf) to second server
> and access the same from the 1st server.
> The following are the steps I ned to follow on the 1st server:
> 1. Detached the database
> 2. Moved the mdf & ldf files to 2nd machine/server
> 3. Attach the database pointing to the 2nd server.
> The 1st and 2nd steps went fine, the problem is with the 3rd step.
> In the Attach Databases window, I clicked on ADD, it opened LOCATE DATABAS
E
> FILE, the folder structure of the 1st server. Is there any way I can chang
e
> the SELECTED PATH and poin to the 2nd server?
> I did even mapped network drive to the 2nd server but the mapped drive is
> not getting displayed in the LOCATE DATABASE FILE folder structure.
> Can we attach mdf/ldf files which reside on other machine?
> Thanks in advance.

How to attach db with missing log file?

I jad detached a larg db with multiple empty log files.
While moving the db to another server, a drive array onthe
first one went bad, taking one of my log files with it.
How can I re-attach the db and have it ignore that its
missing a log file?
Thank you in advance!Hi
You may be able to use sp_attach_single_file_db, although this would not be
guaranteed.
John
"Merlin" <anonymous@.discussions.microsoft.com> wrote in message
news:bc7201c40dfc$f3419e20$a001280a@.phx.gbl...
> I jad detached a larg db with multiple empty log files.
> While moving the db to another server, a drive array onthe
> first one went bad, taking one of my log files with it.
> How can I re-attach the db and have it ignore that its
> missing a log file?
> Thank you in advance!|||Thank you for your help. sp_attach_single_file_db is not
allowing me to get past the missing log file, either. is
there any other way?

>--Original Message--
>Hi
>You may be able to use sp_attach_single_file_db, although
this would not be
>guaranteed.
>John
>"Merlin" <anonymous@.discussions.microsoft.com> wrote in
message
>news:bc7201c40dfc$f3419e20$a001280a@.phx.gbl...
onthe
>
>.
>|||Hi
Not that I know off. You may want to call Microsoft PSS if going back to the
last backup is not a viable option.
John
"Merlin" <anonymous@.discussions.microsoft.com> wrote in message
news:d87301c40e01$69052ec0$a601280a@.phx.gbl...
> Thank you for your help. sp_attach_single_file_db is not
> allowing me to get past the missing log file, either. is
> there any other way?
>
>
> this would not be
> message
> onthe|||Not supported etc and make sure you have a copy of the mdf before starting
this. Also replace the relavent database,drive letters and filenames with
your particulars as this answer was for a specific case.
1) Make sure you have a copy of PowerDVD301_2_Data.MDF
2) Create a new database called fake (default file locations)
3) Stop SQL Service
4) Delete the fake_Data.MDF and copy PowerDVD301_2_Data.MDF
to where fake_Data.MDF used to be and rename the file to fake_Data.MDF
5) Start SQL Service
6) Database fake will appear as suspect in EM
7) Open Query Analyser and in master database run the following :
sp_configure 'allow updates',1
go
reconfigure with override
go
update sysdatabases set
status=-32768 where dbid=DB_ID('fake')
go
sp_configure 'allow updates',0
go
reconfigure with override
go
This will put the database in emergency recovery mode
8) Stop SQL Service
9) Delete the fake_Log.LDF file
10) Restart SQL Service
11) In QA run the following (with correct path for log)
dbcc rebuild_log('fake','h:\fake_log.ldf')
go
dbcc checkdb('fake') -- to check for errors
go
12) Now we need to rename the files, run the following (make sure
there are no connections to it) in Query Analyser
(At this stage you can actually access the database so you could use
DTS or bcp to move the data to another database .)
use master
go
sp_helpdb 'fake'
go
/* Make a note of the names of the files , you will need them
in the next bit of the script to replace datafilename and
logfilename - it might be that they have the right names */
sp_renamedb 'fake','PowerDVD301'
go
alter database PowerDVD301
MODIFY FILE(NAME='datafilename', NEWNAME = 'PowerDVD301_Data')
go
alter database PowerDVD301
MODIFY FILE(NAME='logfilename', NEWNAME = 'PowerDVD301_Log')
go
dbcc checkdb('PowerDVD301')
go
sp_dboption 'PowerDVD301','dbo use only','false'
go
use PowerDVD301
go
sp_updatestats
go
13) You should now have a working database. However the log file
will be small so it will be worth increasing its size
Unfortunately your files will be called fake_Data.MDF and
fake_Log.LDF but you can get round this by detaching the
database properly and then renaming the files and reattaching
it
14) Run the following in QA
sp_detach_db PowerDVD301
--now rename the files then reattach
sp_attach_db 'PowerDVD301','h:\dvd.mdf','h:\DVD.ldf'
HTH
Jasper Smith (SQL Server MVP)
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Merlin" <anonymous@.discussions.microsoft.com> wrote in message
news:d87301c40e01$69052ec0$a601280a@.phx.gbl...
> Thank you for your help. sp_attach_single_file_db is not
> allowing me to get past the missing log file, either. is
> there any other way?
>
>
> this would not be
> message
> onthe|||I fixed this by running dbcc rebuild_log and then running
dbcc checkdb. all is good now. sp_attach_single_file_db
didnt work for me, it was still looking for the missing
log file before letting me attach the db. Thank you for
the help, I appreciated it!!!

>--Original Message--
>Hi
>You may be able to use sp_attach_single_file_db, although
this would not be
>guaranteed.
>John
>"Merlin" <anonymous@.discussions.microsoft.com> wrote in
message
>news:bc7201c40dfc$f3419e20$a001280a@.phx.gbl...
onthe
>
>.
>sql

How to attach an .MDF file to another server?

Hi all

I am having trouble moving an .mdf file from a dev machine to a production machine.

On the dev machine(windows xp sp2 login <MyName>) I have an SSE instance - part of VisualStudio installation.
on the production machine I have only one full version SS instance called "PROD"(windows server 2k3, login Administrator) I do have SSMS installed too.

I create a website in VS on my dev machine. C:\Websites\Website1
I add to App_Data a new file: DB1.mdf
I add a couple of tables to DB1.mdf and maybe other objects etc. - all dbo.
Then I detach DB1.mdf and physically copy the file (without the .ldf as suggested in books online) via tha LAN.

from: C:\Websites\Website1\App_Data\DB1.mdf(dev machine)
to: C:\DB1.mdf (production machine)

I then try to attach C:\DB1.mdf to PROD and I get an error. The server is looking for a db by the name of the original path on the dev machine C:\Websites\Website1\App_Data\DB1.mdf There seems to be no way to rename the db.-not in VS before detaching it, not on PROD in the GUI to attach.

Just for kicks, I created the same folders on the production machine, so the file would have the same physical path as its name(which I still cannot change). C:\Websites\Website1\App_Data\DB1.mdf I even pasted the original .ldf file. This time it worked. I was able to attach it.

What is up with this? Is an .mdf file for ever stuck with the name of the path where it was first created?

This seems to be a most common scenario, even though I am not deploying a whole website.

Are we always supposed to execute our own script?

How are you reattaching the file ?

You should be able to use the command:

CREATE DATABASE database_name
ON
(name = logical_file_name,
filename = 'new file location')
FOR ATTACH

You'll need to know the logical_file_name that the mdf file uses. Find that out by running this command in the database before detaching:

select name from sysfiles where filename like '%.mdf'
|||

If you right click on the databases folder in Object Explorer in SSMS and select Attach... you get a UI to locate the .mdf file. The UI looks for the other files in database (.ndf or .ldf) in the locations specified in the .mdf file. If it doesn't find them there, it displays an error message for the files it can't find.

You can change the location where it is looking for the other files by editing the "Current File Path" in the lower grid. You can also remove the .ldf files from the grid (so it won't try to attach them) by selecting them in the grid and clicking on the Remove button.

Hope this helps,

Steve

|||

Thanks to both of you.

Both ways work now. I can't even duplicate the issue, and I remember I struggled for a while prior to posting a few days ago. It just didn't like that file name. I swear there is a voodoo ghost on the network!

Steven, I also played with some test UDFs and TVFs written in c#. I right-click deployed the assembly in visual studio. The test was to see what all I needed to do when I reattach the .mdf file. Well the functions work on the new machine just like that. So where is the .net assembly? Is the .dll embedded in the .mdf file? Because that is all I transferred.

Carl

how to attach Access database to MSDE

Hello,
what is the procedure to attach a .MDB databse to MSDE?
I don't care using forms or report from the Access database, I just want to
have tables and queries on MSDE then I will analyze data and arrange comments
to them.
Thanks
Rocco
Hi,
You can not attach a Access database to SQL Server MSDE. This is due to
changes in architecture.Methods to transfer:-
1. SQL Server DTS to copy structure and data
2. Upsizing wizard (
http://www.mssqlcity.com/FAQ/General/MigFromAcc.htm )
Thanks
Hari
SQL Server MVP
"rocco" <rocco@.discussions.microsoft.com> wrote in message
news:0D42E485-DCCC-45E8-A2D4-5AE3A298E71A@.microsoft.com...
> Hello,
> what is the procedure to attach a .MDB databse to MSDE?
> I don't care using forms or report from the Access database, I just want
> to
> have tables and queries on MSDE then I will analyze data and arrange
> comments
> to them.
> Thanks
> Rocco
|||OK. ANy tutorial for the DTS? I have opened and since anything is labelled in
that sort of *MicrosoftCreeepingLanguage* I'm not able to use it.
Maybe is not the MicrosoftCreeping thing, but only that I'm not to good at
that!
"Hari Prasad" wrote:

> Hi,
> You can not attach a Access database to SQL Server MSDE. This is due to
> changes in architecture.Methods to transfer:-
> 1. SQL Server DTS to copy structure and data
> 2. Upsizing wizard (
> http://www.mssqlcity.com/FAQ/General/MigFromAcc.htm )
>
> Thanks
> Hari
> SQL Server MVP
>
> "rocco" <rocco@.discussions.microsoft.com> wrote in message
> news:0D42E485-DCCC-45E8-A2D4-5AE3A298E71A@.microsoft.com...
>
>
|||Hi,
This migration is very simple. Just open the Export and Import utility
wizard from SQL Server program group.
Select the source as Access and destination as SQL Server MSDE and select
dbname.
Now select the tables you need to copy. CLick next.
This wizard will automatically drags you till end and will copy the data to
SQL Server. So easy.
Thanks
Hari
SQL Server MVP
"rocco" <rocco@.discussions.microsoft.com> wrote in message
news:4093596D-D547-460D-B761-3F1373169432@.microsoft.com...[vbcol=seagreen]
> OK. ANy tutorial for the DTS? I have opened and since anything is labelled
> in
> that sort of *MicrosoftCreeepingLanguage* I'm not able to use it.
> Maybe is not the MicrosoftCreeping thing, but only that I'm not to good at
> that!
> "Hari Prasad" wrote:

How to attach a MS SQL 2005 database (.mdf) file to MS SQL 2000

I have 2 files from MS SQL 2005, .mdf and .ldf . How am I going to attach it to the MS SQL 2000? Does it need converter? Please guide.
Thanks.

Quote:

Originally Posted by kentwong

I have 2 files from MS SQL 2005, .mdf and .ldf . How am I going to attach it to the MS SQL 2000? Does it need converter? Please guide.
Thanks.


with enterprise tools u can attach the datbase|||You have posted this question in the Articles section. I am moving it to the SQL Server forum.

ADMIN

How to attach a db_file with problems?

A database goes "SUSPECT" the client deatach de DB. later it tries to
reatach it but he gets an error. I tried to copy the file to other disk but
I get an error from windows saying that a cyclic error in the disk prevent
the copy. Is there any way to attach a file with problems? just in order to
save at least some of the data?You can create a new database with the same name, using the same data file
and log file names. Then shut down SQL Server and copy your "bad" files
over the top of these new files. When SQL Server starts the database will
once again be suspect. You can then put the database in emergency mode
(status 32768) and recycle SQL Server. At this point you should be able to
at least salvage some of the data, may be all depending on the rason it
went suspect.
Rand
This posting is provided "as is" with no warranties and confers no rights.|||Hi,
To add on, I had a identical instance where I followed the same procedure as
Rand suggested , after that,
1. The Datbase was able to open in Emergency mode (32768)
2. I was not able to take a backup.
What I did,
1. Create a new database
2. Script out all objects in seperate files
3. Executed the user defined types(UDT) and Table creation script in new
database
4. Run DTS to transfer all data from old to new database ( U can also use
BCP OUT /IN)
5. Executed the Indexe creation script
6. Executed all the other object creation script
After these steps I did a comparison of old and new database and FYI, I lost
few pieces of data which I asked the users to re enter.
Thanks
Hari
MCDBA
"Rand Boyd [MSFT]" <rboyd@.onlinemicrosoft.com> wrote in message
news:M3yLU1E6DHA.2768@.cpmsftngxa07.phx.gbl...
quote:

> You can create a new database with the same name, using the same data file
> and log file names. Then shut down SQL Server and copy your "bad" files
> over the top of these new files. When SQL Server starts the database will
> once again be suspect. You can then put the database in emergency mode
> (status 32768) and recycle SQL Server. At this point you should be able to
> at least salvage some of the data, may be all depending on the rason it
> went suspect.
> Rand
> This posting is provided "as is" with no warranties and confers no rights.
>

How to attach a db_file with problems?

A database goes "SUSPECT" the client deatach de DB. later it tries to
reatach it but he gets an error. I tried to copy the file to other disk but
I get an error from windows saying that a cyclic error in the disk prevent
the copy. Is there any way to attach a file with problems? just in order to
save at least some of the data?You can create a new database with the same name, using the same data file
and log file names. Then shut down SQL Server and copy your "bad" files
over the top of these new files. When SQL Server starts the database will
once again be suspect. You can then put the database in emergency mode
(status 32768) and recycle SQL Server. At this point you should be able to
at least salvage some of the data, may be all depending on the rason it
went suspect.
Rand
This posting is provided "as is" with no warranties and confers no rights.|||Hi,
To add on, I had a identical instance where I followed the same procedure as
Rand suggested , after that,
1. The Datbase was able to open in Emergency mode (32768)
2. I was not able to take a backup.
What I did,
1. Create a new database
2. Script out all objects in seperate files
3. Executed the user defined types(UDT) and Table creation script in new
database
4. Run DTS to transfer all data from old to new database ( U can also use
BCP OUT /IN)
5. Executed the Indexe creation script
6. Executed all the other object creation script
After these steps I did a comparison of old and new database and FYI, I lost
few pieces of data which I asked the users to re enter.
Thanks
Hari
MCDBA
"Rand Boyd [MSFT]" <rboyd@.onlinemicrosoft.com> wrote in message
news:M3yLU1E6DHA.2768@.cpmsftngxa07.phx.gbl...
> You can create a new database with the same name, using the same data file
> and log file names. Then shut down SQL Server and copy your "bad" files
> over the top of these new files. When SQL Server starts the database will
> once again be suspect. You can then put the database in emergency mode
> (status 32768) and recycle SQL Server. At this point you should be able to
> at least salvage some of the data, may be all depending on the rason it
> went suspect.
> Rand
> This posting is provided "as is" with no warranties and confers no rights.
>sql

How to attach a DB that has not been deatached

My SQL is 2KSP3a (8.00.760)
I 've both MSDB datafiles with no backup that comes from a Destroyed Server
and I would like to recover DTS from them
This datafiles have not been detached previosly. Are recovered from original
disks when SQL its stopped.
I've installed a new SQL Server on a new machine
I've put the necessary flags, started SQL detached actual MSDB and...when i
try to do 'sp_attach_db' on a new server with the old MSDB I obtain the KB...
Knowledge Base
FIX: Transaction Log Restore Fails with Message 3456
PSS ID Number: 329487
Article Last Modified on 9/25/2003
How can i obtain the fix or resolve the DTS recovery?
Thansk a lot !!
Germa Guerra
Not sure if this applies to MSDB but it 's probably worth a look:
http://www.sqlservercentral.com/scri...p?scriptid=599
Restoring a .mdf
Andrew J. Kelly SQL MVP
"Germa Guerra" <GermaGuerra@.discussions.microsoft.com> wrote in message
news:A5D3DE5A-4D04-41B5-944E-2E8302621F31@.microsoft.com...
> My SQL is 2KSP3a (8.00.760)
> I 've both MSDB datafiles with no backup that comes from a Destroyed
> Server
> and I would like to recover DTS from them
> This datafiles have not been detached previosly. Are recovered from
> original
> disks when SQL its stopped.
> I've installed a new SQL Server on a new machine
> I've put the necessary flags, started SQL detached actual MSDB and...when
> i
> try to do 'sp_attach_db' on a new server with the old MSDB I obtain the
> KB...
> Knowledge Base
> FIX: Transaction Log Restore Fails with Message 3456
> PSS ID Number: 329487
> Article Last Modified on 9/25/2003
> --
> How can i obtain the fix or resolve the DTS recovery?
> Thansk a lot !!
> --
> Germa Guerra

how to attach a DB

I have database DB1 on Box1 and I have the full backup of that database and also have data file and log file.If I want to restore the database on a diff box How can do that.
1.How can I restore the Database?
2.How ca I attach the data file to the database on new Box?
Thanks.Check out the WITH REPLACE arguement of the RESTORE command.

or if you have a mdf and a ldf look at sp_attach_db.

How to attach a database using SQL Server 2005

Hello
In the full version of SQL Server I can use enterprise manager to attach a
database. I have an SQL Server 2005 database from another machine which I
want to attach to a new computer with SQL Server 2005 Express. Is there a
tool I can use or do I need to run a command?
Angushave you try the sp_attach stored procedure?
"Angus" <nospam@.gmail.com> wrote in message
news:#iTQZL8kHHA.4936@.TK2MSFTNGP03.phx.gbl...
> Hello
> In the full version of SQL Server I can use enterprise manager to attach a
> database. I have an SQL Server 2005 database from another machine which I
> want to attach to a new computer with SQL Server 2005 Express. Is there a
> tool I can use or do I need to run a command?
> Angus
>|||Yes I have found the sp_attach syntax - but how do I run these commands?
Can I run them from the command line? But if I navigate to prog
files\microsoft SQL Server\MSSQL.1\MSSQL\Binn\ - I cannot run eg sp_attach?
Is this not the right path?
Or have I maybe not installed something?
There is a Start menu item, Microsoft SQL Server 2005... Configuration
Tools... SQL Server Configuration Manager - but can't see where I could type
commands in there?
Angus
"Jeje" <willgart@.hotmail.com> wrote in message
news:uGaU5N8kHHA.2272@.TK2MSFTNGP02.phx.gbl...
> have you try the sp_attach stored procedure?
> "Angus" <nospam@.gmail.com> wrote in message
> news:#iTQZL8kHHA.4936@.TK2MSFTNGP03.phx.gbl...
> > Hello
> >
> > In the full version of SQL Server I can use enterprise manager to attach
a
> > database. I have an SQL Server 2005 database from another machine which
I
> > want to attach to a new computer with SQL Server 2005 Express. Is there
a
> > tool I can use or do I need to run a command?
> >
> > Angus
> >
> >|||"Angus" <nospam@.gmail.com> wrote in
news:ecHo7S8kHHA.4188@.TK2MSFTNGP02.phx.gbl:
> Yes I have found the sp_attach syntax - but how do I run these
> commands? Can I run them from the command line? But if I navigate to
> prog files\microsoft SQL Server\MSSQL.1\MSSQL\Binn\ - I cannot run eg
> sp_attach? Is this not the right path?
> Or have I maybe not installed something?
> There is a Start menu item, Microsoft SQL Server 2005... Configuration
> Tools... SQL Server Configuration Manager - but can't see where I
> could type commands in there?
You can use the OSQL command-line utility to run stored procedures. See
BOL for how to use it.
> Angus
> "Jeje" <willgart@.hotmail.com> wrote in message
> news:uGaU5N8kHHA.2272@.TK2MSFTNGP02.phx.gbl...
>> have you try the sp_attach stored procedure?
>> "Angus" <nospam@.gmail.com> wrote in message
>> news:#iTQZL8kHHA.4936@.TK2MSFTNGP03.phx.gbl...
>> > Hello
>> >
>> > In the full version of SQL Server I can use enterprise manager to
>> > attach
> a
>> > database. I have an SQL Server 2005 database from another machine
>> > which
> I
>> > want to attach to a new computer with SQL Server 2005 Express. Is
>> > there
> a
>> > tool I can use or do I need to run a command?
>> >
>> > Angus
>> >
>> >
>|||On Fri, 11 May 2007 12:52:21 +0100, "Angus" <nospam@.gmail.com> wrote:
>Hello
>In the full version of SQL Server I can use enterprise manager to attach a
>database. I have an SQL Server 2005 database from another machine which I
>want to attach to a new computer with SQL Server 2005 Express. Is there a
>tool I can use or do I need to run a command?
>Angus
SQL Server Management Studio Express has an attach command.
Click on Databases, right context mouse click, attach..
Another way to move a database from one machine to another is to make
a backup and then restore the backup to the new machine.|||Hi
CREATE DATABASE ...command has FOR ATTACH option ,please take a look at
BOL.
"Angus" <nospam@.gmail.com> wrote in message
news:%23iTQZL8kHHA.4936@.TK2MSFTNGP03.phx.gbl...
> Hello
> In the full version of SQL Server I can use enterprise manager to attach a
> database. I have an SQL Server 2005 database from another machine which I
> want to attach to a new computer with SQL Server 2005 Express. Is there a
> tool I can use or do I need to run a command?
> Angus
>

How to attach a database using SQL Server 2005

have you try the sp_attach stored procedure?
"Angus" <nospam@.gmail.com> wrote in message
news:#iTQZL8kHHA.4936@.TK2MSFTNGP03.phx.gbl...
> Hello
> In the full version of SQL Server I can use enterprise manager to attach a
> database. I have an SQL Server 2005 database from another machine which I
> want to attach to a new computer with SQL Server 2005 Express. Is there a
> tool I can use or do I need to run a command?
> Angus
>
"Angus" <nospam@.gmail.com> wrote in
news:ecHo7S8kHHA.4188@.TK2MSFTNGP02.phx.gbl:

> Yes I have found the sp_attach syntax - but how do I run these
> commands? Can I run them from the command line? But if I navigate to
> prog files\microsoft SQL Server\MSSQL.1\MSSQL\Binn\ - I cannot run eg
> sp_attach? Is this not the right path?
> Or have I maybe not installed something?
> There is a Start menu item, Microsoft SQL Server 2005... Configuration
> Tools... SQL Server Configuration Manager - but can't see where I
> could type commands in there?
You can use the OSQL command-line utility to run stored procedures. See
BOL for how to use it.

> Angus
> "Jeje" <willgart@.hotmail.com> wrote in message
> news:uGaU5N8kHHA.2272@.TK2MSFTNGP02.phx.gbl...
> a
> I
> a
>

How to attach a database using SQL Server 2005

Hello
In the full version of SQL Server I can use enterprise manager to attach a
database. I have an SQL Server 2005 database from another machine which I
want to attach to a new computer with SQL Server 2005 Express. Is there a
tool I can use or do I need to run a command?
Angushave you try the sp_attach stored procedure?
"Angus" <nospam@.gmail.com> wrote in message
news:#iTQZL8kHHA.4936@.TK2MSFTNGP03.phx.gbl...
> Hello
> In the full version of SQL Server I can use enterprise manager to attach a
> database. I have an SQL Server 2005 database from another machine which I
> want to attach to a new computer with SQL Server 2005 Express. Is there a
> tool I can use or do I need to run a command?
> Angus
>|||Yes I have found the sp_attach syntax - but how do I run these commands?
Can I run them from the command line? But if I navigate to prog
files\microsoft SQL Server\MSSQL.1\MSSQL\Binn\ - I cannot run eg sp_attach?
Is this not the right path?
Or have I maybe not installed something?
There is a Start menu item, Microsoft SQL Server 2005... Configuration
Tools... SQL Server Configuration Manager - but can't see where I could type
commands in there?
Angus
"Jeje" <willgart@.hotmail.com> wrote in message
news:uGaU5N8kHHA.2272@.TK2MSFTNGP02.phx.gbl...[vbcol=seagreen]
> have you try the sp_attach stored procedure?
> "Angus" <nospam@.gmail.com> wrote in message
> news:#iTQZL8kHHA.4936@.TK2MSFTNGP03.phx.gbl...
a[vbcol=seagreen]
I[vbcol=seagreen]
a[vbcol=seagreen]|||"Angus" <nospam@.gmail.com> wrote in
news:ecHo7S8kHHA.4188@.TK2MSFTNGP02.phx.gbl:

> Yes I have found the sp_attach syntax - but how do I run these
> commands? Can I run them from the command line? But if I navigate to
> prog files\microsoft SQL Server\MSSQL.1\MSSQL\Binn\ - I cannot run eg
> sp_attach? Is this not the right path?
> Or have I maybe not installed something?
> There is a Start menu item, Microsoft SQL Server 2005... Configuration
> Tools... SQL Server Configuration Manager - but can't see where I
> could type commands in there?
You can use the OSQL command-line utility to run stored procedures. See
BOL for how to use it.

> Angus
> "Jeje" <willgart@.hotmail.com> wrote in message
> news:uGaU5N8kHHA.2272@.TK2MSFTNGP02.phx.gbl...
> a
> I
> a
>|||On Fri, 11 May 2007 12:52:21 +0100, "Angus" <nospam@.gmail.com> wrote:

>Hello
>In the full version of SQL Server I can use enterprise manager to attach a
>database. I have an SQL Server 2005 database from another machine which I
>want to attach to a new computer with SQL Server 2005 Express. Is there a
>tool I can use or do I need to run a command?
>Angus
SQL Server Management Studio Express has an attach command.
Click on Databases, right context mouse click, attach..
Another way to move a database from one machine to another is to make
a backup and then restore the backup to the new machine.|||Hi
CREATE DATABASE ...command has FOR ATTACH option ,please take a look at
BOL.
"Angus" <nospam@.gmail.com> wrote in message
news:%23iTQZL8kHHA.4936@.TK2MSFTNGP03.phx.gbl...
> Hello
> In the full version of SQL Server I can use enterprise manager to attach a
> database. I have an SQL Server 2005 database from another machine which I
> want to attach to a new computer with SQL Server 2005 Express. Is there a
> tool I can use or do I need to run a command?
> Angus
>sql

How to Attach a database to SQLServer7

OK, I'm an idiot - hopefully, someone will help me out anyway...
How do I "attach" a database to SQLServer 7 ?
I created a database and developed a VB program to use it. I wanted to
demo it to a co-worker of mine. So, I COPIED the database (the .MDF
file and it associated .LDF file) (that's: copied the files with
Windows Explorer - NOT backed-them-up with Enterprise Manager) to a CD
and sent it to him (he's 2000 miles away). He copied it on to his
server (running SQLServer 7) but we can't get SQLServer to see it.
I've read a couple of things about "attaching" a copied database
(mainly Q224071) but I can't figure out how to do that. It tells me to
run a "stored procedure". How? Where is this sp_attach_db stored
procedure? And how do I use it? Can someone give me a clue as to how
to do this?
BTW, this is NOT in a production environment. No one but me uses this
database or even the server itself. So, I'm pretty much free to do
whatever needs to be done.
Thanks for any guidance.INF: Moving SQL Server Databases to a New Location with Detach/Attach
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q224071
> run a "stored procedure". How? Where is this sp_attach_db stored
> procedure? And how do I use it? Can someone give me a clue as to how
> to do this?
Well, sp_attach_db is present in the master database and this is similar to
using any conventional stored procedure. The article contains good
information on how to move a database to different locations.
HTH,
Vinod Kumar
MCSE, DBA, MCAD
www.extremeexperts.com
"Martin" <martinvalley@.comcast.net> wrote in message
news:2f7okvsjllmh0fp4nsrkp4paem59vavms4@.4ax.com...
> OK, I'm an idiot - hopefully, someone will help me out anyway...
> How do I "attach" a database to SQLServer 7 ?
> I created a database and developed a VB program to use it. I wanted to
> demo it to a co-worker of mine. So, I COPIED the database (the .MDF
> file and it associated .LDF file) (that's: copied the files with
> Windows Explorer - NOT backed-them-up with Enterprise Manager) to a CD
> and sent it to him (he's 2000 miles away). He copied it on to his
> server (running SQLServer 7) but we can't get SQLServer to see it.
> I've read a couple of things about "attaching" a copied database
> (mainly Q224071) but I can't figure out how to do that. It tells me to
> run a "stored procedure". How? Where is this sp_attach_db stored
> procedure? And how do I use it? Can someone give me a clue as to how
> to do this?
> BTW, this is NOT in a production environment. No one but me uses this
> database or even the server itself. So, I'm pretty much free to do
> whatever needs to be done.
> Thanks for any guidance.
>|||Thanks, I got it working.
What I didn't understand was HOW to execute the stored procedure. If
some other clueless newbie reads this, run "Query Analyzer" and
execute the query from there.
On Tue, 26 Aug 2003 19:59:25 -0700, Martin <martinvalley@.comcast.net>
wrote:
>OK, I'm an idiot - hopefully, someone will help me out anyway...
>How do I "attach" a database to SQLServer 7 ?
>I created a database and developed a VB program to use it. I wanted to
>demo it to a co-worker of mine. So, I COPIED the database (the .MDF
>file and it associated .LDF file) (that's: copied the files with
>Windows Explorer - NOT backed-them-up with Enterprise Manager) to a CD
>and sent it to him (he's 2000 miles away). He copied it on to his
>server (running SQLServer 7) but we can't get SQLServer to see it.
>I've read a couple of things about "attaching" a copied database
>(mainly Q224071) but I can't figure out how to do that. It tells me to
>run a "stored procedure". How? Where is this sp_attach_db stored
>procedure? And how do I use it? Can someone give me a clue as to how
>to do this?
>BTW, this is NOT in a production environment. No one but me uses this
>database or even the server itself. So, I'm pretty much free to do
>whatever needs to be done.
>Thanks for any guidance.
>|||Martin,
FYI, on SQL Server 2000 from the Enterprise Manager. Connect to the
server. Right click on Databases. Left click on All Tasks. Left click
on Attach Database... Fill in the blanks. This will not work on SQL
7.0, use the Query Analyzer. Also you do not need the ldf for an
attach, it will create a new one, although it will not hurt.
Norman
Martin <martinvalley@.comcast.net> wrote in message news:<kvfpkv4tovnk1id8td6s5i9krtlidtlscf@.4ax.com>...
> Thanks, I got it working.
> What I didn't understand was HOW to execute the stored procedure. If
> some other clueless newbie reads this, run "Query Analyzer" and
> execute the query from there.
>
> On Tue, 26 Aug 2003 19:59:25 -0700, Martin <martinvalley@.comcast.net>
> wrote:
> >OK, I'm an idiot - hopefully, someone will help me out anyway...
> >
> >How do I "attach" a database to SQLServer 7 ?
> >
> >I created a database and developed a VB program to use it. I wanted to
> >demo it to a co-worker of mine. So, I COPIED the database (the .MDF
> >file and it associated .LDF file) (that's: copied the files with
> >Windows Explorer - NOT backed-them-up with Enterprise Manager) to a CD
> >and sent it to him (he's 2000 miles away). He copied it on to his
> >server (running SQLServer 7) but we can't get SQLServer to see it.
> >
> >I've read a couple of things about "attaching" a copied database
> >(mainly Q224071) but I can't figure out how to do that. It tells me to
> >run a "stored procedure". How? Where is this sp_attach_db stored
> >procedure? And how do I use it? Can someone give me a clue as to how
> >to do this?
> >
> >BTW, this is NOT in a production environment. No one but me uses this
> >database or even the server itself. So, I'm pretty much free to do
> >whatever needs to be done.
> >
> >Thanks for any guidance.
> >

How to attach a database from other server

Hi

I have created a test enviroment on my laptop where i have installed SQL server Experss and SSRS.

I already have one production server, and I would like to have a copy of one of its databases linked to my test Server.

How do I do that?

Thansk

Hello,

If you can take the database offline:

Take the database offline, manually copy the data and log files to your test server, then attach the database back on your production server, then on the test server.

If you can not take the database offline:

Create a backup of the database on your production server, then restore it to your test server.

Hope this helps.

Jarret

How to attach a database from other server

Hi

I have created a test enviroment, by installing SQL server express and SSRS on my laptop.

I also have a production server, and i am trying to make a copy of one of its database and linked it to my test server.

How do i do it?

Thanks

Hello,

If you can take the database offline:

Take the database offline, manually copy the data and log files to your test server, then attach the database back on your production server, then on the test server.

If you can not take the database offline:

Create a backup of the database on your production server, then restore it to your test server.

Hope this helps.

Jarret

|||It works. Thanks1