Hello all,
I have installed a dummy SQL server in my office and created the database..now i want to copy this database on to clients machine but i dont have a remote access to the clients machine..so all i have to do is copy this database on a disk and restore it on clients machine..I dunoo exactly how this procedure works. I need any help ASAp. Thankyou very much.
RamOriginally posted by sriramkakani
Hello all,
I have installed a dummy SQL server in my office and created the database..now i want to copy this database on to clients machine but i dont have a remote access to the clients machine..so all i have to do is copy this database on a disk and restore it on clients machine..I dunoo exactly how this procedure works. I need any help ASAp. Thankyou very much.
Ram
You want to readup on attaching and detaching a database...also search this forum or read online help.|||If your using MS SQL 2000 , and your client is also using MS SQL 2000, you can do it via "Attach/Detach".
A very simple way. go to enterprise manager, right click on your database, under "All task".select detached database.
Make sure there are not connections to u'r database when u'r doing a detached, or else u can't do it.
Also , be sure that your login id has db owner rights for that table, or u'll have trouble attaching back at the client side.
After detached, you can go to your MS SQL folder and copy your .mdf and .log files into a diskkete. You can even zip it up.
At the client side, just attached it back.
Before u do this, create a test database and play around first.|||You can also just take a backup of the database and copy the .bak file. then restore. It isnt as fast as detatch and reattach, but it IMO less risky, and easier to do. Read up in BOL on backup and restore procedures. very simple.sql
Showing posts with label office. Show all posts
Showing posts with label office. Show all posts
Tuesday, March 20, 2012
Wednesday, March 7, 2012
copying a record within the same table...
Hi. I would like to copy some records within the same table. what happens is we get very similar new cases in our office and we want to apply the same information from one client to the new client.
i looked at:
INSERT INTO ClientSpecs (ClientID, Spec1, Spec2, etc.)
SELECT Spec1, Spec2 from ClientSpecs WHERE ClientID=1234
but i want to use the new client id in place of the old client id. is there a way to do this? does this make sense? we're basically copying one client's file to a new client's file, except we need to use the new client's id.INSERT INTO ClientSpecs (ClientID, Spec1, Spec2)
SELECT '123', Spec1, Spec2 from ClientSpecs WHERE ClientID=1234|||thank you for that cfr! i never thought it was going to be that easy. Now, I have another question.
How do I update a Spec from one client to another client. For example, I have
ClientID Spec1 Spec2
1234 1 23
1234 2 12
And I want to copy the first client's Spec2 information to another client.
ClientID Spec1 Spec2
4567 1 NULL
4567 2 NULL
But, I only want to copy the Spec2 information for the client. How would I do this? Does this even make sense?|||Untested:
UPDATE ClientSpecs destTble
SET destTble.Spec2 = (SELECT srcTbl.Spec2
FROM ClientSpecs srcTbl
WHERE srcTbl.ClientID = destTble.ClientID
AND srcTble.Spec1 = destTble.Spec1)
WHERE destTble.ClientID = '4567'
i looked at:
INSERT INTO ClientSpecs (ClientID, Spec1, Spec2, etc.)
SELECT Spec1, Spec2 from ClientSpecs WHERE ClientID=1234
but i want to use the new client id in place of the old client id. is there a way to do this? does this make sense? we're basically copying one client's file to a new client's file, except we need to use the new client's id.INSERT INTO ClientSpecs (ClientID, Spec1, Spec2)
SELECT '123', Spec1, Spec2 from ClientSpecs WHERE ClientID=1234|||thank you for that cfr! i never thought it was going to be that easy. Now, I have another question.
How do I update a Spec from one client to another client. For example, I have
ClientID Spec1 Spec2
1234 1 23
1234 2 12
And I want to copy the first client's Spec2 information to another client.
ClientID Spec1 Spec2
4567 1 NULL
4567 2 NULL
But, I only want to copy the Spec2 information for the client. How would I do this? Does this even make sense?|||Untested:
UPDATE ClientSpecs destTble
SET destTble.Spec2 = (SELECT srcTbl.Spec2
FROM ClientSpecs srcTbl
WHERE srcTbl.ClientID = destTble.ClientID
AND srcTble.Spec1 = destTble.Spec1)
WHERE destTble.ClientID = '4567'
Subscribe to:
Posts (Atom)