Sunday, March 25, 2012
copying tables from one server to another
My client runs my app against sql server 2000. I can connect via vpn and
tcp/ip. However, I may need to test from time to time against the current
data. I maintain a copy of the database on my system, but the tables are,
by definition, not up to date. I could of course transfer the database to
my server, but this is practically impossible, as the database is over 3
gigs and via tcp/ip it will take 15 hours.
Is there a way that I can copy individual tables to my server, replacing my
old tables, so I can run tests against current data without having to do so
on the active sql server at my client's location?
Thanks for any help.
Bernie YaegerHi,
You could use either one:-
1. BCP OUT the data, copy the file to destination and in destination use
BCP IN to load it into table
2. USE DTS - Export and Import wizard.
I recommend you to
a. BCP OUT the table data from source server
b. copy the file to your test machine
c. BCP IN the data into your machine
Thanks
Hari
MCDBA
"Bernie Yaeger" <berniey@.cherwellinc.com> wrote in message
news:V_QNc.9183$09.1208788@.news4.srv.hcvlny.cv.net...
> This is a little complicated, so let me explain what I'm after.
> My client runs my app against sql server 2000. I can connect via vpn and
> tcp/ip. However, I may need to test from time to time against the current
> data. I maintain a copy of the database on my system, but the tables are,
> by definition, not up to date. I could of course transfer the database to
> my server, but this is practically impossible, as the database is over 3
> gigs and via tcp/ip it will take 15 hours.
> Is there a way that I can copy individual tables to my server, replacing
my
> old tables, so I can run tests against current data without having to do
so
> on the active sql server at my client's location?
> Thanks for any help.
> Bernie Yaeger
>|||Hi Hari,
Tx for your reply. I did try to work with dts, but I got a bit bogged
down - I think I need to understand its features a bit better. But BCP -
good idea! I'll try it.
Thanks,
Bernie
"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:uynQ5bMdEHA.2408@.tk2msftngp13.phx.gbl...
> Hi,
> You could use either one:-
> 1. BCP OUT the data, copy the file to destination and in destination use
> BCP IN to load it into table
> 2. USE DTS - Export and Import wizard.
> I recommend you to
> a. BCP OUT the table data from source server
> b. copy the file to your test machine
> c. BCP IN the data into your machine
>
> Thanks
> Hari
> MCDBA
> "Bernie Yaeger" <berniey@.cherwellinc.com> wrote in message
> news:V_QNc.9183$09.1208788@.news4.srv.hcvlny.cv.net...
> > This is a little complicated, so let me explain what I'm after.
> >
> > My client runs my app against sql server 2000. I can connect via vpn
and
> > tcp/ip. However, I may need to test from time to time against the
current
> > data. I maintain a copy of the database on my system, but the tables
are,
> > by definition, not up to date. I could of course transfer the database
to
> > my server, but this is practically impossible, as the database is over 3
> > gigs and via tcp/ip it will take 15 hours.
> >
> > Is there a way that I can copy individual tables to my server, replacing
> my
> > old tables, so I can run tests against current data without having to do
> so
> > on the active sql server at my client's location?
> >
> > Thanks for any help.
> >
> > Bernie Yaeger
> >
> >
>
copying tables from one server to another
My client runs my app against sql server 2000. I can connect via vpn and
tcp/ip. However, I may need to test from time to time against the current
data. I maintain a copy of the database on my system, but the tables are,
by definition, not up to date. I could of course transfer the database to
my server, but this is practically impossible, as the database is over 3
gigs and via tcp/ip it will take 15 hours.
Is there a way that I can copy individual tables to my server, replacing my
old tables, so I can run tests against current data without having to do so
on the active sql server at my client's location?
Thanks for any help.
Bernie YaegerHi,
You could use either one:-
1. BCP OUT the data, copy the file to destination and in destination use
BCP IN to load it into table
2. USE DTS - Export and Import wizard.
I recommend you to
a. BCP OUT the table data from source server
b. copy the file to your test machine
c. BCP IN the data into your machine
Thanks
Hari
MCDBA
"Bernie Yaeger" <berniey@.cherwellinc.com> wrote in message
news:V_QNc.9183$09.1208788@.news4.srv.hcvlny.cv.net...
> This is a little complicated, so let me explain what I'm after.
> My client runs my app against sql server 2000. I can connect via vpn and
> tcp/ip. However, I may need to test from time to time against the current
> data. I maintain a copy of the database on my system, but the tables are,
> by definition, not up to date. I could of course transfer the database to
> my server, but this is practically impossible, as the database is over 3
> gigs and via tcp/ip it will take 15 hours.
> Is there a way that I can copy individual tables to my server, replacing
my
> old tables, so I can run tests against current data without having to do
so
> on the active sql server at my client's location?
> Thanks for any help.
> Bernie Yaeger
>|||Hi Hari,
Tx for your reply. I did try to work with dts, but I got a bit bogged
down - I think I need to understand its features a bit better. But BCP -
good idea! I'll try it.
Thanks,
Bernie
"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:uynQ5bMdEHA.2408@.tk2msftngp13.phx.gbl...
> Hi,
> You could use either one:-
> 1. BCP OUT the data, copy the file to destination and in destination use
> BCP IN to load it into table
> 2. USE DTS - Export and Import wizard.
> I recommend you to
> a. BCP OUT the table data from source server
> b. copy the file to your test machine
> c. BCP IN the data into your machine
>
> Thanks
> Hari
> MCDBA
> "Bernie Yaeger" <berniey@.cherwellinc.com> wrote in message
> news:V_QNc.9183$09.1208788@.news4.srv.hcvlny.cv.net...
and[vbcol=seagreen]
current[vbcol=seagreen]
are,[vbcol=seagreen]
to[vbcol=seagreen]
> my
> so
>
copying tables from one server to another
My client runs my app against sql server 2000. I can connect via vpn and
tcp/ip. However, I may need to test from time to time against the current
data. I maintain a copy of the database on my system, but the tables are,
by definition, not up to date. I could of course transfer the database to
my server, but this is practically impossible, as the database is over 3
gigs and via tcp/ip it will take 15 hours.
Is there a way that I can copy individual tables to my server, replacing my
old tables, so I can run tests against current data without having to do so
on the active sql server at my client's location?
Thanks for any help.
Bernie Yaeger
Hi,
You could use either one:-
1. BCP OUT the data, copy the file to destination and in destination use
BCP IN to load it into table
2. USE DTS - Export and Import wizard.
I recommend you to
a. BCP OUT the table data from source server
b. copy the file to your test machine
c. BCP IN the data into your machine
Thanks
Hari
MCDBA
"Bernie Yaeger" <berniey@.cherwellinc.com> wrote in message
news:V_QNc.9183$09.1208788@.news4.srv.hcvlny.cv.net ...
> This is a little complicated, so let me explain what I'm after.
> My client runs my app against sql server 2000. I can connect via vpn and
> tcp/ip. However, I may need to test from time to time against the current
> data. I maintain a copy of the database on my system, but the tables are,
> by definition, not up to date. I could of course transfer the database to
> my server, but this is practically impossible, as the database is over 3
> gigs and via tcp/ip it will take 15 hours.
> Is there a way that I can copy individual tables to my server, replacing
my
> old tables, so I can run tests against current data without having to do
so
> on the active sql server at my client's location?
> Thanks for any help.
> Bernie Yaeger
>
|||Hi Hari,
Tx for your reply. I did try to work with dts, but I got a bit bogged
down - I think I need to understand its features a bit better. But BCP -
good idea! I'll try it.
Thanks,
Bernie
"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:uynQ5bMdEHA.2408@.tk2msftngp13.phx.gbl...[vbcol=seagreen]
> Hi,
> You could use either one:-
> 1. BCP OUT the data, copy the file to destination and in destination use
> BCP IN to load it into table
> 2. USE DTS - Export and Import wizard.
> I recommend you to
> a. BCP OUT the table data from source server
> b. copy the file to your test machine
> c. BCP IN the data into your machine
>
> Thanks
> Hari
> MCDBA
> "Bernie Yaeger" <berniey@.cherwellinc.com> wrote in message
> news:V_QNc.9183$09.1208788@.news4.srv.hcvlny.cv.net ...
and[vbcol=seagreen]
current[vbcol=seagreen]
are,[vbcol=seagreen]
to
> my
> so
>
Friday, February 24, 2012
Copy VS Create
Hello,
We are building a smart client that ships with it an offline db - Sql Express.
I wanted to check if there is a preferred/recommended approach to deploy the database ? I'm essentially asking between
1. Copying a database file and
2. Creating the database file by connecting to Master and issueing create database etc and then running the scripts as we need it.
Any help will be great,
Thanks,
Avinash
PS: The app is a multi user app and may be used by multiple windows users on the same machine. So we currently use the Auto Attach feature in the connection string with database files in the Special Application/User Data folder. So we isolate files b/w users.
Could you clarify your definition of "offline data" with your comment that this is a multi-user application? Do you expect multiple people to be using the same database simultaneously or should each user have a separate offline database?
Thanks for the additional informaiton.
Mike - SQL Express team
|||Hello Mike,Its a multi user application in that - several windows users may use the application installled on one machine. Not at the same time. Currently we have one copy of the database per windows user logging into the machine/application in the User Data special folder.
So, yes its one database file per user but many such files may exist on a machine one per user. And only one user may use the machine/application at a time. However this may be slightly different in a WTS - terminal service environment. But even then the idea of one offline database file per user will not change.
Any advise will be appreciated and will help a lot..
Thanks,
Avinash
|||
Hi Avinash,
Thanks for the additional information. Since you are really looking for each user to have a unique database, I would embed the database into your application and then use User Instances to handle the attach/detach of the database. User Instances are new in SQL Express and are used by VS 2005 when you insert a database into your applciation. Check out the User Instance white paper for more information.
One of the main benefits of User Instances is that the person running the application doesn't have to be an admin user or have sa permissions to deal with things like attach and detach. Normally a user must have elevated permissions to do things such as this.
Once you've embedded a database in your application, you can also use ClickOnce deployment to get your application to your users. You should be able to find out more about ClickOnce in the VS documentation.
Regards,
Mike Wachal
SQL Express team
Hello Mike Wachal,
One last question - if we generate the database file on a particular version of ms sql express and in time to come if there are a few more versions of ms sql express out there with the users - if we continue to package with our app a database file from an older version of sql express will that be a problem with users running a newer version of sql express ?
Also what about the converse scenario - where we ship a database file from a newer version of sql while the customer is still running on an older version.
Thanks,
Avinash
Monday, February 13, 2012
Copy SQL Server Database to another Server
What is the best way to copy the Database? Can I detach it on my Server, make a copy of the file. Copy the file to my Client's Server, and then Attach it?
OR IS THERE A BETTER WAY?
Thanks in advance for your helpDetach, copy, reattach is probably the fastest way to copy a database to another box, although there are plenty of other choices. Using BACKUP / RESTORE is probably the safest, and it doesn't take much longer than detach/copy/reattach does.
-PatP|||the best way (In My Opinion)
is to perform a transfer database task in dts
it copies everything without having to require a detach then copy then attach.
backing up and restoring is comprehensive but takes a while to perform
and the objects are in whatever state they were in when you backed em up
transfering the db is fast and you get brand new objects so for example indexes are created new so they are not fragged..
[Books Online] DTS tasks, transferring database objects
Copy SQL Server 2005 DB to SQL Server Mobile - is it possible?
built and populated a database using SQL Server 2005... and then
realised where I really need it is on the PDA! Without going through
all the pain of setting up SQL replication or writing all the code is there a way to export a
2005 database to SQL Server Mobile so it results in an .SDF file?
I know I can script each table out and run it via the SS2005 management studio when connected to a local .sdf file then copy that to the PDA but the thing is I really want to keep my test data so I don't have to re-enter it again.
TIA for any help... there must be a way to do this but I'm quite new to SQL Server Mobile and 2005.
Mike
you can use Remote Data Access to pull all of the tables from the server or you can use merge replication with AddSubscription(AddOption.CreateDatabase) to dynamically create the SQL Mobile database on your device.
In this MSDN webcast, I demonstrate the latter option: http://msreadiness.com/WS_abstract.asp?eid=15003229
Darren
|||Thanks Darren - but I can't see a link on that to a webcast.... it has details of the event but nothing that I can see to get the webcast - what am I missing? I even went through and registered (for an event that took place last year!) so I'm a bit confused to say the least.
In the meantime I'll google and read up on RDA - I've not used it but it sounds like I'm going to need to work with it to do this app.
Mike|||
after you register, they send you an email with instructions to view the on-demand webcast. digging in to RDA is also a good approach.
Darren
|||
You can use the EXPORT Wizard in SQLServer
Open SQLServer (Full version)
Create a new SDF database for Mobile - no tables required
Click on the database you want to export
Right click on TASKS - EXPORT
Go through the wizard and export to the sdf its all very easy and DOESNT WORK for me
I have founfd that it creates the tables with no problem but when it tries to insert the data into the table it looks for tables called
"table1" complete with the "" round the table!!!
I have let MS know but have not had a reply yet
Can you let me know if it works
You can also get a wizard from PRIMEWORKS.COM that does it all for you
Richar@.bmwdrivers.co.uk
|||Richard,Thanks - but for me when I run the Export Data wizard from the database I need to export to an .sdf file and then go through to the "Choose a destination" dialog there is no option for SQL Server Mobile at all... what option did you use? (BTW , I used SQL server 2005 not SS 2000 - which version did you mean?)
Mike|||
I've never seen the export option Richard describes work but would love to know if someone gets it to work.
Darren
|||
look in SSEV (SqlSrver Everywhere
It adds it to the SQLKExport Wizard
But it doesnt work and MS are not going to get it to work (Bastards)
Try Primeworks.com
|||
Import/Export from/to SQL Server Everywhere Edition (SSEv) is not implemented.
The immediate question would be why is it shown their in the list of data providers?
All the data related tools (ex: SQL Server Management Studio, Microsoft Office Word, Microsoft Office Excel ..etc) show a list of data providers from a OLEDB Provider database of the system. Since, SSEv also registers its OLEDB Provider to system, it gets listed automatically.
Goof-ups like this happen as the product is still in CTP stage. We are taking care to NOT show up in these tools.
Thanks,
Laxmi
Copy SQL Server 2005 DB to SQL Server Mobile - is it possible?
built and populated a database using SQL Server 2005... and then
realised where I really need it is on the PDA! Without going through
all the pain of setting up SQL replication or writing all the code is there a way to export a
2005 database to SQL Server Mobile so it results in an .SDF file?
I know I can script each table out and run it via the SS2005 management studio when connected to a local .sdf file then copy that to the PDA but the thing is I really want to keep my test data so I don't have to re-enter it again.
TIA for any help... there must be a way to do this but I'm quite new to SQL Server Mobile and 2005.
Mike
you can use Remote Data Access to pull all of the tables from the server or you can use merge replication with AddSubscription(AddOption.CreateDatabase) to dynamically create the SQL Mobile database on your device.
In this MSDN webcast, I demonstrate the latter option: http://msreadiness.com/WS_abstract.asp?eid=15003229
Darren
|||Thanks Darren - but I can't see a link on that to a webcast.... it has details of the event but nothing that I can see to get the webcast - what am I missing? I even went through and registered (for an event that took place last year!) so I'm a bit confused to say the least.
In the meantime I'll google and read up on RDA - I've not used it but it sounds like I'm going to need to work with it to do this app.
Mike|||
after you register, they send you an email with instructions to view the on-demand webcast. digging in to RDA is also a good approach.
Darren
|||
You can use the EXPORT Wizard in SQLServer
Open SQLServer (Full version)
Create a new SDF database for Mobile - no tables required
Click on the database you want to export
Right click on TASKS - EXPORT
Go through the wizard and export to the sdf its all very easy and DOESNT WORK for me
I have founfd that it creates the tables with no problem but when it tries to insert the data into the table it looks for tables called
"table1" complete with the "" round the table!!!
I have let MS know but have not had a reply yet
Can you let me know if it works
You can also get a wizard from PRIMEWORKS.COM that does it all for you
Richar@.bmwdrivers.co.uk
|||Richard,Thanks - but for me when I run the Export Data wizard from the database I need to export to an .sdf file and then go through to the "Choose a destination" dialog there is no option for SQL Server Mobile at all... what option did you use? (BTW , I used SQL server 2005 not SS 2000 - which version did you mean?)
Mike|||
I've never seen the export option Richard describes work but would love to know if someone gets it to work.
Darren
|||
look in SSEV (SqlSrver Everywhere
It adds it to the SQLKExport Wizard
But it doesnt work and MS are not going to get it to work (Bastards)
Try Primeworks.com
|||
Import/Export from/to SQL Server Everywhere Edition (SSEv) is not implemented.
The immediate question would be why is it shown their in the list of data providers?
All the data related tools (ex: SQL Server Management Studio, Microsoft Office Word, Microsoft Office Excel ..etc) show a list of data providers from a OLEDB Provider database of the system. Since, SSEv also registers its OLEDB Provider to system, it gets listed automatically.
Goof-ups like this happen as the product is still in CTP stage. We are taking care to NOT show up in these tools.
Thanks,
Laxmi
Copy SQL Server 2005 DB to SQL Server Mobile - is it possible?
built and populated a database using SQL Server 2005... and then
realised where I really need it is on the PDA! Without going through
all the pain of setting up SQL replication or writing all the code is there a way to export a
2005 database to SQL Server Mobile so it results in an .SDF file?
I know I can script each table out and run it via the SS2005 management studio when connected to a local .sdf file then copy that to the PDA but the thing is I really want to keep my test data so I don't have to re-enter it again.
TIA for any help... there must be a way to do this but I'm quite new to SQL Server Mobile and 2005.
Mike
you can use Remote Data Access to pull all of the tables from the server or you can use merge replication with AddSubscription(AddOption.CreateDatabase) to dynamically create the SQL Mobile database on your device.
In this MSDN webcast, I demonstrate the latter option: http://msreadiness.com/WS_abstract.asp?eid=15003229
Darren
|||Thanks Darren - but I can't see a link on that to a webcast.... it has details of the event but nothing that I can see to get the webcast - what am I missing? I even went through and registered (for an event that took place last year!) so I'm a bit confused to say the least.
In the meantime I'll google and read up on RDA - I've not used it but it sounds like I'm going to need to work with it to do this app.
Mike|||
after you register, they send you an email with instructions to view the on-demand webcast. digging in to RDA is also a good approach.
Darren
|||
You can use the EXPORT Wizard in SQLServer
Open SQLServer (Full version)
Create a new SDF database for Mobile - no tables required
Click on the database you want to export
Right click on TASKS - EXPORT
Go through the wizard and export to the sdf its all very easy and DOESNT WORK for me
I have founfd that it creates the tables with no problem but when it tries to insert the data into the table it looks for tables called
"table1" complete with the "" round the table!!!
I have let MS know but have not had a reply yet
Can you let me know if it works
You can also get a wizard from PRIMEWORKS.COM that does it all for you
Richar@.bmwdrivers.co.uk
|||Richard,Thanks - but for me when I run the Export Data wizard from the database I need to export to an .sdf file and then go through to the "Choose a destination" dialog there is no option for SQL Server Mobile at all... what option did you use? (BTW , I used SQL server 2005 not SS 2000 - which version did you mean?)
Mike|||
I've never seen the export option Richard describes work but would love to know if someone gets it to work.
Darren
|||
look in SSEV (SqlSrver Everywhere
It adds it to the SQLKExport Wizard
But it doesnt work and MS are not going to get it to work (Bastards)
Try Primeworks.com
|||
Import/Export from/to SQL Server Everywhere Edition (SSEv) is not implemented.
The immediate question would be why is it shown their in the list of data providers?
All the data related tools (ex: SQL Server Management Studio, Microsoft Office Word, Microsoft Office Excel ..etc) show a list of data providers from a OLEDB Provider database of the system. Since, SSEv also registers its OLEDB Provider to system, it gets listed automatically.
Goof-ups like this happen as the product is still in CTP stage. We are taking care to NOT show up in these tools.
Thanks,
Laxmi