Showing posts with label objects. Show all posts
Showing posts with label objects. Show all posts

Thursday, March 29, 2012

Copy objects Wizard - deleted data??

I have not used the copy objects wizard that much. I used it today to copy 4
views from my dev box to production. It copied the views, but also wiped out
my data in all the tables that the views are built around!!! In
production!!!!

Can someone provide me some insight into why this happened?

Thanks,
ChadChad Richardson (chad@.NIXSPAM_chadrichardson.com) writes:
> I have not used the copy objects wizard that much. I used it today to
> copy 4 views from my dev box to production. It copied the views, but
> also wiped out my data in all the tables that the views are built
> around!!! In production!!!!
> Can someone provide me some insight into why this happened?

Extremely nasty. I have not used the wizard in question myself, and I
think you understand why after this experience. It's a bit ironic: the
wizards are there to help, but you can only use them, if you know
exactly what they do, and in such case you may not need them.

Anyway my guess is that the wizard saw reason to recreate the underlying
tables as well; possibly because the defintion in production was different
from your dev box.

The correct way to deploy things in production is through change scripts
that are created from information in the version-control system.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Yes, very nasty. Luckily my hosting company (ReadyHosting) was able to
restore everything from their backup and the transaction logs.

Normally, whenever I make DB table changes I save the scripts and put them
in a "To Promote to Prod" directory, then use SQL Analyzer to apply those
changes to prod. But changes to views don't prompt for you to save these
changes as a script.

What specifically do you mean by "the version control system"? (As you can
tell by my question, I know just enough of SQL Server to be dangerous, so
any insight on how to handle version contol is appreciated.)

Thanks,
Chad

"Erland Sommarskog" <esquel@.sommarskog.se> wrote in message
news:Xns9682EF2F57F5DYazorman@.127.0.0.1...
> Chad Richardson (chad@.NIXSPAM_chadrichardson.com) writes:
>> I have not used the copy objects wizard that much. I used it today to
>> copy 4 views from my dev box to production. It copied the views, but
>> also wiped out my data in all the tables that the views are built
>> around!!! In production!!!!
>>
>> Can someone provide me some insight into why this happened?
> Extremely nasty. I have not used the wizard in question myself, and I
> think you understand why after this experience. It's a bit ironic: the
> wizards are there to help, but you can only use them, if you know
> exactly what they do, and in such case you may not need them.
> Anyway my guess is that the wizard saw reason to recreate the underlying
> tables as well; possibly because the defintion in production was different
> from your dev box.
> The correct way to deploy things in production is through change scripts
> that are created from information in the version-control system.
>
> --
> Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
> Books Online for SQL Server SP3 at
> http://www.microsoft.com/sql/techin.../2000/books.asp|||Chad Richardson (chad@.NIXSPAM_chadrichardson.com) writes:
> Yes, very nasty. Luckily my hosting company (ReadyHosting) was able to
> restore everything from their backup and the transaction logs.
> Normally, whenever I make DB table changes I save the scripts and put them
> in a "To Promote to Prod" directory, then use SQL Analyzer to apply those
> changes to prod. But changes to views don't prompt for you to save these
> changes as a script.
> What specifically do you mean by "the version control system"? (As you can
> tell by my question, I know just enough of SQL Server to be dangerous, so
> any insight on how to handle version contol is appreciated.)

"version control system" or "source code control" is nothing specific
to SQL Server, but fundamentals of software engineering. In a version
control system, developers adds their files. Later a file may be
checked out, maybe by the same developer, maybe by someone else. The
person who checked out the file, performs some changes to it, and
then checks back in again, after proper testing.

When it's getting time to make a build for an integration test, someone
who is a "build master", "configuration manager" or similar puts some
label on all the most recent versions of files, to create a baseline.
During tests, bugs may be uncovered and fixed. The fixes can be inserted
into that baseline, or a new baseline be created.

Eventually, the thing is put into production and a baseline is created for
this. Now, development of 2.0 starts. However, there may be need to
fix bugs in production as well. Say that version 12 of file foo.cs
was in the shipment baseline. By the time a critical bug in production
is discovered, the file at version 14 for 2.0 development. But you
check out version 12, and fix that, and check it in as 12.1 - you
have now created a branch.

The exact terminology for these various actions are different from
product to product. The most commonly used version-control system
in the Microsoft world is Visual SourceSafe. It performs branching
different that about any other product. VSS has a lot of short-comings
as a version-control system, but it's easy to start with, and it's OK
for smaller teams.
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||For a tool that links the drop/create scripts (for ALL database
objects) in any source control system to your development, test and
production databases have a look at DB Ghost (www.dbghost.com).

The approach is to regard the drop/create scripts as the only true
representation of the desired schema i.e. your 'source database'. Once
you have modifed the drop/create scripts DB Ghost will build a brand
new database from them in an extremely fast manner whilst taking care
of any dependencies. This a) verifies that no syntax or dependency
errors have been introduced and b) gives you a real source database to
use as the basis for a compare and upgrade of your actual target i.e.
the test or production database. DB Ghost does this also and creates a
rock solid delta script of the differences that is guaranteed to work
with no hand coded modifications.

What you end up with is a target database that matches a (labelled) set
of scripts under source control. If this approach is used for all
releases then a full audit trail of who changed what, why and when is
maintained in the source control system so it is easy to do reports
such as 'what changed between release X and release Y' or 'who first
changed sproc Z after release X'.

Relying on comments in sprocs etc. is a recipe for disaster in all but
the most disciplined of IT shops. Let your source control system do
the hard work for you and let DB Ghost handle all the SQL Server code.
It's called the DB Ghost Process and it can bring an amazing level of
quality to your deployments and code control in general.|||Erland,

Thanks for the explanation. I do have experience with source control tools
such as VSS and PVCS, but all have been for file/directory based source,
like VB. How do DB developers apply these principles (check in, check out,
etc.) to SQL Server? This is something I've curious about for a while now.

Thanks,
Chad

"Erland Sommarskog" <esquel@.sommarskog.se> wrote in message
news:Xns96833C7C3BFCYazorman@.127.0.0.1...
> Chad Richardson (chad@.NIXSPAM_chadrichardson.com) writes:
>> Yes, very nasty. Luckily my hosting company (ReadyHosting) was able to
>> restore everything from their backup and the transaction logs.
>>
>> Normally, whenever I make DB table changes I save the scripts and put
>> them
>> in a "To Promote to Prod" directory, then use SQL Analyzer to apply those
>> changes to prod. But changes to views don't prompt for you to save these
>> changes as a script.
>>
>> What specifically do you mean by "the version control system"? (As you
>> can
>> tell by my question, I know just enough of SQL Server to be dangerous, so
>> any insight on how to handle version contol is appreciated.)
> "version control system" or "source code control" is nothing specific
> to SQL Server, but fundamentals of software engineering. In a version
> control system, developers adds their files. Later a file may be
> checked out, maybe by the same developer, maybe by someone else. The
> person who checked out the file, performs some changes to it, and
> then checks back in again, after proper testing.
> When it's getting time to make a build for an integration test, someone
> who is a "build master", "configuration manager" or similar puts some
> label on all the most recent versions of files, to create a baseline.
> During tests, bugs may be uncovered and fixed. The fixes can be inserted
> into that baseline, or a new baseline be created.
> Eventually, the thing is put into production and a baseline is created for
> this. Now, development of 2.0 starts. However, there may be need to
> fix bugs in production as well. Say that version 12 of file foo.cs
> was in the shipment baseline. By the time a critical bug in production
> is discovered, the file at version 14 for 2.0 development. But you
> check out version 12, and fix that, and check it in as 12.1 - you
> have now created a branch.
> The exact terminology for these various actions are different from
> product to product. The most commonly used version-control system
> in the Microsoft world is Visual SourceSafe. It performs branching
> different that about any other product. VSS has a lot of short-comings
> as a version-control system, but it's easy to start with, and it's OK
> for smaller teams.
> --
> Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
> Books Online for SQL Server SP3 at
> http://www.microsoft.com/sql/techin.../2000/books.asp|||Chad Richardson (chad@.NIXSPAM_chadrichardson.com) writes:
> Thanks for the explanation. I do have experience with source control tools
> such as VSS and PVCS, but all have been for file/directory based source,
> like VB. How do DB developers apply these principles (check in, check out,
> etc.) to SQL Server? This is something I've curious about for a while now.

They use - or at least should use - files. I've seen a whole lot of
questions on version control of SQL objects as this should be something
difficult or special. It isn't. Source code is source code, and should be
handled as such.

I guess people are tricked by tools that permit you to store things in the
database directly, point-and-click GUI:n for creating tables etc. But all
of that is really files.

The one gotcha there is if you use a tool like Query Analyzer for editing
your SQL objects, is that you disrupt the normal procedure which is
1) check out 2) edit 3) save 4) compile 5) test 6) back to 2 until it
works 7) check in. With a tool like QA, 3 is taken out of the chain, which
can lead to that what you check is not what you tested.

In our shop, we avoid this problem by using a third-party editor, Textpad.
It has no special features for SQL - but it is a better editor than QA.
From Textpad 3 and 4 is one key-click, as we can activate a command-line
from Textpad. We have our own load tool for quite a few bells and whistles,
but the tool could be command-line OSQL.

The thing people seem to want to do, is to take the SQL objects from
the database, but this is actually really wrong when you think of it.
If you work in VB, would get the input for the version-control system
by disassembling the object modules?

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

Copy objects with DTS Import/Export Wizard?

Has the functionality of copying objects using the DTS Import/Export Wizard been removed in SQL Server 2005?

MSDN says this about the wizard:

"With the DTS Import/Export Wizard, you can transfer database objects such as indexes, views, roles, stored procedures, and referential integrity constraints. For more information, see Copy SQL Server Objects Task."

But the "for more imformation" link describes adding a task to a DTS package to copy an object, not how to use the wizard to copy objects.

It's been awhile since I've used SQL Server 2000, but as I recall it was possible to copy objects as well as data using the DTS Import/Export Wizard.

Thanks,

Ron

DTS has been enhanced to SSIS(Integration Services) in SQL 2005, so in this case you can use SSIS package to perform that copy SQL Server objects tasks which is similar to the copying the database objects.|||

You have a few options:

Copy Database Wizard:
Use this if you want to copy an entire database.

Right-click on a database in Management Studio, go to "Tasks", and choose "Copy Database...".|||

I also share in their frustrations... When you only have a few objects, in this case tables to transfer; you have very little options in the SQL2005 Import/Export wizard as compared to the SQL2000 DTS (Import/Export) wizard. Copy Database is out of the question for this scenario.

My problem lies in the fact that the SQL2005 Import/Export wizard does not create the indexes and keys when the table needs to be created in the target database, even if the source schema exists on the target database. Is there any way around this without pre-creating the target tables from scripts generated on the source DB? Seems that this manual step should be built into the wizard? Ay suggestions? We are running SP2 for SQL 2005.

There are suggestions that SSIS can be used, thats fine, but given the entirely different interface as compared to DTS, I don't have the time to deal with that when the wizard should be able to do this in a few minutes.

|||That option is fine for SQL2000/2005 to SQL2005, but is there any option to copy to SQL2000?|||I am getting very frustrated, for two days now I've been trying to work out how to copy a database (SQL express version) to my ISP which has the full MS 2005 server. I keep losing keys, stored procedures etc. When you right click on the database as you say and click on tasks there's no copy database there.|||Yey! now I get to spend 2 hours with ssis doing what used to take 2 minutes with dts import wizard.|||

I now use MS Database Publishing wizard which attaches to Database Explorer in Microsoft Developer Express. It works better than DTS Import/Export as I do not lose keys and can copy all object in the database. Great for making backups too.

Copy objects with DTS Import/Export Wizard?

Has the functionality of copying objects using the DTS Import/Export Wizard been removed in SQL Server 2005?

MSDN says this about the wizard:

"With the DTS Import/Export Wizard, you can transfer database objects such as indexes, views, roles, stored procedures, and referential integrity constraints. For more information, see Copy SQL Server Objects Task."

But the "for more imformation" link describes adding a task to a DTS package to copy an object, not how to use the wizard to copy objects.

It's been awhile since I've used SQL Server 2000, but as I recall it was possible to copy objects as well as data using the DTS Import/Export Wizard.

Thanks,

Ron

DTS has been enhanced to SSIS(Integration Services) in SQL 2005, so in this case you can use SSIS package to perform that copy SQL Server objects tasks which is similar to the copying the database objects.|||

You have a few options:

Copy Database Wizard:
Use this if you want to copy an entire database.

Right-click on a database in Management Studio, go to "Tasks", and choose "Copy Database...".|||

I also share in their frustrations... When you only have a few objects, in this case tables to transfer; you have very little options in the SQL2005 Import/Export wizard as compared to the SQL2000 DTS (Import/Export) wizard. Copy Database is out of the question for this scenario.

My problem lies in the fact that the SQL2005 Import/Export wizard does not create the indexes and keys when the table needs to be created in the target database, even if the source schema exists on the target database. Is there any way around this without pre-creating the target tables from scripts generated on the source DB? Seems that this manual step should be built into the wizard? Ay suggestions? We are running SP2 for SQL 2005.

There are suggestions that SSIS can be used, thats fine, but given the entirely different interface as compared to DTS, I don't have the time to deal with that when the wizard should be able to do this in a few minutes.

|||That option is fine for SQL2000/2005 to SQL2005, but is there any option to copy to SQL2000?|||I am getting very frustrated, for two days now I've been trying to work out how to copy a database (SQL express version) to my ISP which has the full MS 2005 server. I keep losing keys, stored procedures etc. When you right click on the database as you say and click on tasks there's no copy database there.|||Yey! now I get to spend 2 hours with ssis doing what used to take 2 minutes with dts import wizard.|||

I now use MS Database Publishing wizard which attaches to Database Explorer in Microsoft Developer Express. It works better than DTS Import/Export as I do not lose keys and can copy all object in the database. Great for making backups too.

sqlsql

Copy objects with DTS Import/Export Wizard?

Has the functionality of copying objects using the DTS Import/Export Wizard been removed in SQL Server 2005?

MSDN says this about the wizard:

"With the DTS Import/Export Wizard, you can transfer database objects such as indexes, views, roles, stored procedures, and referential integrity constraints. For more information, see Copy SQL Server Objects Task."

But the "for more imformation" link describes adding a task to a DTS package to copy an object, not how to use the wizard to copy objects.

It's been awhile since I've used SQL Server 2000, but as I recall it was possible to copy objects as well as data using the DTS Import/Export Wizard.

Thanks,

Ron

DTS has been enhanced to SSIS(Integration Services) in SQL 2005, so in this case you can use SSIS package to perform that copy SQL Server objects tasks which is similar to the copying the database objects.|||

You have a few options:

Copy Database Wizard:
Use this if you want to copy an entire database.

Right-click on a database in Management Studio, go to "Tasks", and choose "Copy Database...".|||

I also share in their frustrations... When you only have a few objects, in this case tables to transfer; you have very little options in the SQL2005 Import/Export wizard as compared to the SQL2000 DTS (Import/Export) wizard. Copy Database is out of the question for this scenario.

My problem lies in the fact that the SQL2005 Import/Export wizard does not create the indexes and keys when the table needs to be created in the target database, even if the source schema exists on the target database. Is there any way around this without pre-creating the target tables from scripts generated on the source DB? Seems that this manual step should be built into the wizard? Ay suggestions? We are running SP2 for SQL 2005.

There are suggestions that SSIS can be used, thats fine, but given the entirely different interface as compared to DTS, I don't have the time to deal with that when the wizard should be able to do this in a few minutes.

|||That option is fine for SQL2000/2005 to SQL2005, but is there any option to copy to SQL2000?|||I am getting very frustrated, for two days now I've been trying to work out how to copy a database (SQL express version) to my ISP which has the full MS 2005 server. I keep losing keys, stored procedures etc. When you right click on the database as you say and click on tasks there's no copy database there.|||Yey! now I get to spend 2 hours with ssis doing what used to take 2 minutes with dts import wizard.|||

I now use MS Database Publishing wizard which attaches to Database Explorer in Microsoft Developer Express. It works better than DTS Import/Export as I do not lose keys and can copy all object in the database. Great for making backups too.

Copy objects with DTS Import/Export Wizard?

Has the functionality of copying objects using the DTS Import/Export Wizard been removed in SQL Server 2005?

MSDN says this about the wizard:

"With the DTS Import/Export Wizard, you can transfer database objects such as indexes, views, roles, stored procedures, and referential integrity constraints. For more information, see Copy SQL Server Objects Task."

But the "for more imformation" link describes adding a task to a DTS package to copy an object, not how to use the wizard to copy objects.

It's been awhile since I've used SQL Server 2000, but as I recall it was possible to copy objects as well as data using the DTS Import/Export Wizard.

Thanks,

Ron

DTS has been enhanced to SSIS(Integration Services) in SQL 2005, so in this case you can use SSIS package to perform that copy SQL Server objects tasks which is similar to the copying the database objects.|||

You have a few options:

Copy Database Wizard:
Use this if you want to copy an entire database.

Right-click on a database in Management Studio, go to "Tasks", and choose "Copy Database...".|||

I also share in their frustrations... When you only have a few objects, in this case tables to transfer; you have very little options in the SQL2005 Import/Export wizard as compared to the SQL2000 DTS (Import/Export) wizard. Copy Database is out of the question for this scenario.

My problem lies in the fact that the SQL2005 Import/Export wizard does not create the indexes and keys when the table needs to be created in the target database, even if the source schema exists on the target database. Is there any way around this without pre-creating the target tables from scripts generated on the source DB? Seems that this manual step should be built into the wizard? Ay suggestions? We are running SP2 for SQL 2005.

There are suggestions that SSIS can be used, thats fine, but given the entirely different interface as compared to DTS, I don't have the time to deal with that when the wizard should be able to do this in a few minutes.

|||That option is fine for SQL2000/2005 to SQL2005, but is there any option to copy to SQL2000?|||I am getting very frustrated, for two days now I've been trying to work out how to copy a database (SQL express version) to my ISP which has the full MS 2005 server. I keep losing keys, stored procedures etc. When you right click on the database as you say and click on tasks there's no copy database there.|||Yey! now I get to spend 2 hours with ssis doing what used to take 2 minutes with dts import wizard.|||

I now use MS Database Publishing wizard which attaches to Database Explorer in Microsoft Developer Express. It works better than DTS Import/Export as I do not lose keys and can copy all object in the database. Great for making backups too.

copy objects and data from server to server

I want to copy all objects and data from other SQL 2000 server std. to my
local server(SQL 2000 personal) to test something.
when I do copy wizard I got a message
"SQL Server service is running under localsystem account. To get the
privilege to copy through the network you should change SQL Service
account."(FYI,this may not what you see in Eng version because I translated
it.)
Why?
This time I used "copy wizard", is it the best solution?If you load EM, & select the server in question. Right click & select
properties. Goto the Security tab. At the bottom, you have the option to
start & run SQL server in either the local system account, or another
account...
Cheers,
James Goodman MCSE, MCDBA
http://www.angelfire.com/sports/f1pictures|||HI,
To perform this operation start the SQL server service using a Domain OS
user, which has got access in both servers.
Thanks
Hari
MCDBA
"James Goodman" <j a m e s@.norton-associates.co.u k> wrote in message
news:bvd77v$o53$1@.sparta.btinternet.com...
> If you load EM, & select the server in question. Right click & select
> properties. Goto the Security tab. At the bottom, you have the option to
> start & run SQL server in either the local system account, or another
> account...
>
>
> --
> Cheers,
> James Goodman MCSE, MCDBA
> http://www.angelfire.com/sports/f1pictures
>

copy objects and data from server to server

I want to copy all objects and data from other SQL 2000 server std. to my
local server(SQL 2000 personal) to test something.
when I do copy wizard I got a message
"SQL Server service is running under localsystem account. To get the
privilege to copy through the network you should change SQL Service
account."(FYI,this may not what you see in Eng version because I translated
it.)
Why?
This time I used "copy wizard", is it the best solution?If you load EM, & select the server in question. Right click & select
properties. Goto the Security tab. At the bottom, you have the option to
start & run SQL server in either the local system account, or another
account...
Cheers,
James Goodman MCSE, MCDBA
http://www.angelfire.com/sports/f1pictures|||HI,
To perform this operation start the SQL server service using a Domain OS
user, which has got access in both servers.
Thanks
Hari
MCDBA
"James Goodman" <j a m e s@.norton-associates.co.u k> wrote in message
news:bvd77v$o53$1@.sparta.btinternet.com...
quote:

> If you load EM, & select the server in question. Right click & select
> properties. Goto the Security tab. At the bottom, you have the option to
> start & run SQL server in either the local system account, or another
> account...
>
>
> --
> Cheers,
> James Goodman MCSE, MCDBA
> http://www.angelfire.com/sports/f1pictures
>

Sunday, March 25, 2012

Copy DB from 2005 to 2000

Is there a ligitimate way to copy database (ALL objects, not just tables and
views) from SQL 2005 to SQL 2000?
Thank you for your help!
You could try the instructions in this thread:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=842225&SiteID=1
Look for a posting titled: "How to Downgrade a Database from SQL Server 2005
to SQL Server 2000"
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
You can't help someone get up a hill without getting a little closer to the
top yourself.
- H. Norman Schwarzkopf
"Leon Shargorodsky" <LeonShargorodsky@.discussions.microsoft.com> wrote in
message news:BE2F5E3E-BAA3-49EA-B6A7-1BB69AE581D2@.microsoft.com...
> Is there a ligitimate way to copy database (ALL objects, not just tables
> and
> views) from SQL 2005 to SQL 2000?
> Thank you for your help!
|||DTS and, possibly, BCP.
On Wed, 1 Nov 2006 14:28:02 -0800, Leon Shargorodsky
<LeonShargorodsky@.discussions.microsoft.com> wrote:

>Is there a ligitimate way to copy database (ALL objects, not just tables and
>views) from SQL 2005 to SQL 2000?
>Thank you for your help!
|||bradsbulkmail@.comcast.net wrote:
[vbcol=seagreen]
> DTS and, possibly, BCP.
> On Wed, 1 Nov 2006 14:28:02 -0800, Leon Shargorodsky
> <LeonShargorodsky@.discussions.microsoft.com> wrote:
Try SSIS, BCP or Replication
Regards
Amish Shah
|||You can export your database to SQL 2000 with data . SQL 2005 support this.
All tasks--> export data
"Leon Shargorodsky" <LeonShargorodsky@.discussions.microsoft.com> wrote in
message news:BE2F5E3E-BAA3-49EA-B6A7-1BB69AE581D2@.microsoft.com...
> Is there a ligitimate way to copy database (ALL objects, not just tables
> and
> views) from SQL 2005 to SQL 2000?
> Thank you for your help!
|||Many people seem to mention using SSIS, but when I tried it using the
'Transfer Database task', it wouldn't let me downgrade: 'The source
connection ... must specify a SQL server with a version less than or
equal to the destination connection ... '.
Using SQL Server 2005 Replication works, though it's a bit overkill for
a one-off task.
amish wrote:
> bradsbulkmail@.comcast.net wrote:
>
> Try SSIS, BCP or Replication
> Regards
> Amish Shah
|||No, you can't 'Transfer database'. But you can script out the tables, views,
stored procedures, and the data
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
You can't help someone get up a hill without getting a little closer to the
top yourself.
- H. Norman Schwarzkopf
"decates" <decates@.gmail.com> wrote in message
news:1164387119.010205.146340@.m7g2000cwm.googlegro ups.com...
> Many people seem to mention using SSIS, but when I tried it using the
> 'Transfer Database task', it wouldn't let me downgrade: 'The source
> connection ... must specify a SQL server with a version less than or
> equal to the destination connection ... '.
> Using SQL Server 2005 Replication works, though it's a bit overkill for
> a one-off task.
> amish wrote:
>

Copy DB from 2005 to 2000

Is there a ligitimate way to copy database (ALL objects, not just tables and
views) from SQL 2005 to SQL 2000?
Thank you for your help!You could try the instructions in this thread:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=842225&SiteID=1
Look for a posting titled: "How to Downgrade a Database from SQL Server 2005
to SQL Server 2000"
--
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
You can't help someone get up a hill without getting a little closer to the
top yourself.
- H. Norman Schwarzkopf
"Leon Shargorodsky" <LeonShargorodsky@.discussions.microsoft.com> wrote in
message news:BE2F5E3E-BAA3-49EA-B6A7-1BB69AE581D2@.microsoft.com...
> Is there a ligitimate way to copy database (ALL objects, not just tables
> and
> views) from SQL 2005 to SQL 2000?
> Thank you for your help!|||Leon Shargorodsky wrote:
> Is there a ligitimate way to copy database (ALL objects, not just tables and
> views) from SQL 2005 to SQL 2000?
> Thank you for your help!
You can't directly "downgrade" a database from SQL2005 to SQL2000. I
think your only option is to script it all out and the run these scripts
on your SQL2000 database.
Regards
Steen Schlüter Persson
Database Administrator / System Administrator|||DTS and, possibly, BCP.
On Wed, 1 Nov 2006 14:28:02 -0800, Leon Shargorodsky
<LeonShargorodsky@.discussions.microsoft.com> wrote:
>Is there a ligitimate way to copy database (ALL objects, not just tables and
>views) from SQL 2005 to SQL 2000?
>Thank you for your help!|||bradsbulkmail@.comcast.net wrote:
> DTS and, possibly, BCP.
> On Wed, 1 Nov 2006 14:28:02 -0800, Leon Shargorodsky
> <LeonShargorodsky@.discussions.microsoft.com> wrote:
> >Is there a ligitimate way to copy database (ALL objects, not just tables and
> >views) from SQL 2005 to SQL 2000?
> >
> >Thank you for your help!
Try SSIS, BCP or Replication
Regards
Amish Shah|||You can export your database to SQL 2000 with data . SQL 2005 support this.
All tasks--> export data
"Leon Shargorodsky" <LeonShargorodsky@.discussions.microsoft.com> wrote in
message news:BE2F5E3E-BAA3-49EA-B6A7-1BB69AE581D2@.microsoft.com...
> Is there a ligitimate way to copy database (ALL objects, not just tables
> and
> views) from SQL 2005 to SQL 2000?
> Thank you for your help!|||Many people seem to mention using SSIS, but when I tried it using the
'Transfer Database task', it wouldn't let me downgrade: 'The source
connection ... must specify a SQL server with a version less than or
equal to the destination connection ... '.
Using SQL Server 2005 Replication works, though it's a bit overkill for
a one-off task.
amish wrote:
> bradsbulkmail@.comcast.net wrote:
> > DTS and, possibly, BCP.
> >
> > On Wed, 1 Nov 2006 14:28:02 -0800, Leon Shargorodsky
> > <LeonShargorodsky@.discussions.microsoft.com> wrote:
> >
> > >Is there a ligitimate way to copy database (ALL objects, not just tables and
> > >views) from SQL 2005 to SQL 2000?
> > >
> > >Thank you for your help!
> Try SSIS, BCP or Replication
> Regards
> Amish Shah|||No, you can't 'Transfer database'. But you can script out the tables, views,
stored procedures, and the data
--
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
You can't help someone get up a hill without getting a little closer to the
top yourself.
- H. Norman Schwarzkopf
"decates" <decates@.gmail.com> wrote in message
news:1164387119.010205.146340@.m7g2000cwm.googlegroups.com...
> Many people seem to mention using SSIS, but when I tried it using the
> 'Transfer Database task', it wouldn't let me downgrade: 'The source
> connection ... must specify a SQL server with a version less than or
> equal to the destination connection ... '.
> Using SQL Server 2005 Replication works, though it's a bit overkill for
> a one-off task.
> amish wrote:
>> bradsbulkmail@.comcast.net wrote:
>> > DTS and, possibly, BCP.
>> >
>> > On Wed, 1 Nov 2006 14:28:02 -0800, Leon Shargorodsky
>> > <LeonShargorodsky@.discussions.microsoft.com> wrote:
>> >
>> > >Is there a ligitimate way to copy database (ALL objects, not just
>> > >tables and
>> > >views) from SQL 2005 to SQL 2000?
>> > >
>> > >Thank you for your help!
>> Try SSIS, BCP or Replication
>> Regards
>> Amish Shah
>

Copy DB from 2005 to 2000

Is there a ligitimate way to copy database (ALL objects, not just tables and
views) from SQL 2005 to SQL 2000?
Thank you for your help!You could try the instructions in this thread:
http://forums.microsoft.com/MSDN/Sh...842225&SiteID=1
Look for a posting titled: "How to Downgrade a Database from SQL Server 2005
to SQL Server 2000"
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
You can't help someone get up a hill without getting a little closer to the
top yourself.
- H. Norman Schwarzkopf
"Leon Shargorodsky" <LeonShargorodsky@.discussions.microsoft.com> wrote in
message news:BE2F5E3E-BAA3-49EA-B6A7-1BB69AE581D2@.microsoft.com...
> Is there a ligitimate way to copy database (ALL objects, not just tables
> and
> views) from SQL 2005 to SQL 2000?
> Thank you for your help!|||Leon Shargorodsky wrote:
> Is there a ligitimate way to copy database (ALL objects, not just tables a
nd
> views) from SQL 2005 to SQL 2000?
> Thank you for your help!
You can't directly "downgrade" a database from SQL2005 to SQL2000. I
think your only option is to script it all out and the run these scripts
on your SQL2000 database.
Regards
Steen Schlüter Persson
Database Administrator / System Administrator|||DTS and, possibly, BCP.
On Wed, 1 Nov 2006 14:28:02 -0800, Leon Shargorodsky
<LeonShargorodsky@.discussions.microsoft.com> wrote:

>Is there a ligitimate way to copy database (ALL objects, not just tables an
d
>views) from SQL 2005 to SQL 2000?
>Thank you for your help!|||bradsbulkmail@.comcast.net wrote:
[vbcol=seagreen]
> DTS and, possibly, BCP.
> On Wed, 1 Nov 2006 14:28:02 -0800, Leon Shargorodsky
> <LeonShargorodsky@.discussions.microsoft.com> wrote:
>
Try SSIS, BCP or Replication
Regards
Amish Shah|||You can export your database to SQL 2000 with data . SQL 2005 support this.
All tasks--> export data
"Leon Shargorodsky" <LeonShargorodsky@.discussions.microsoft.com> wrote in
message news:BE2F5E3E-BAA3-49EA-B6A7-1BB69AE581D2@.microsoft.com...
> Is there a ligitimate way to copy database (ALL objects, not just tables
> and
> views) from SQL 2005 to SQL 2000?
> Thank you for your help!|||Many people seem to mention using SSIS, but when I tried it using the
'Transfer Database task', it wouldn't let me downgrade: 'The source
connection ... must specify a SQL server with a version less than or
equal to the destination connection ... '.
Using SQL Server 2005 Replication works, though it's a bit overkill for
a one-off task.
amish wrote:
> bradsbulkmail@.comcast.net wrote:
>
> Try SSIS, BCP or Replication
> Regards
> Amish Shah|||No, you can't 'Transfer database'. But you can script out the tables, views,
stored procedures, and the data
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
You can't help someone get up a hill without getting a little closer to the
top yourself.
- H. Norman Schwarzkopf
"decates" <decates@.gmail.com> wrote in message
news:1164387119.010205.146340@.m7g2000cwm.googlegroups.com...
> Many people seem to mention using SSIS, but when I tried it using the
> 'Transfer Database task', it wouldn't let me downgrade: 'The source
> connection ... must specify a SQL server with a version less than or
> equal to the destination connection ... '.
> Using SQL Server 2005 Replication works, though it's a bit overkill for
> a one-off task.
> amish wrote:
>

Sunday, March 11, 2012

Copy Database fails

Hi,

I am getting the error below when I try to copy a database.

OnError,SQLSERVER2005,AUTORIDADE NT\SYSTEM,XX_XX_XX_XX_SQLSERVER2005_Transfer Objects Task,{E2404B46-E96F-47DA-91F7-ACBB914BD89D},{6D380D9F-9A9E-42F6-AE14-B8852DF6B8E9},16/6/2007 22:24:02,16/6/2007 22:24:02,0,0x,ERROR : errorCode=0 description=CREATE DATABASE failed. Some file names listed could not be created. Check related errors. helpFile= helpContext=0 idofInterfaceWithError={8BDFE893-E9D8-4D23-9739-DA807BCDC2AC}
StackTrace: em Microsoft.SqlServer.Management.Dts.DtsTransferProvider.ExecuteTransfer()
em Microsoft.SqlServer.Management.Smo.Transfer.TransferData()
em Microsoft.SqlServer.Dts.Tasks.TransferObjectsTask.TransferObjectsTask.TransferDatabasesUsingSMOTransfer()

I am using SQL Server 2005 SP2 (9.0.3042) with Windows XP SP2 inside a virtual machine (Virtual PC 2007 version 6.0.156.0).

I am copying the database to a local drive (C:\) and the error occurs after 45 minutes.

Using SQL Server 2000 takes 40 minutes to copy the same database without problem.

Do you have enough disk space on the virtual hard drive and your physical hard drive?|||

Yes, there is enough space both on the virtual and physical hard drive.

Copy database compability

Hi,

In sql 2000 was possible to copy entire database objects from one db to another. This includes tables, pk, indexes, views, sp, functions, logins and so on.

This is very usefull because at the same time it creates a full log with entire database scripting, it can be used to track changes in databases.

In sql 2005, I can't find a solution like this.

Someone have an idea to this?

Hi

Even in SQL2005 you can copy whole database with complete schema intact using SSIS (Transfer database task).

Thanx

Thursday, March 8, 2012

Copy database

I'm new to SQL and I need help. We have a SQL 2000 server
and I need to copy the database and all its objects
(tables..) to another machine with MSDE version. Thanks
for any info.
you can take help of "backup database"/"restore database" commands. backup
your source database using "backup database" command(which is an online
operation) and restore it on the other databases with "restore database"
command. you can also also use system stored procedures sp_detach_db and
sp_attach_db. Use sp_detach_db procedure to detach the data/transaction log
files from the source database (database will not be available.) and attach
the required databases using sp_attach_db stored procedure.
See more help on above topics in books online.
Vishal Parkar
vgparkar@.yahoo.co.in | vgparkar@.hotmail.com

Copy data and objects between SQL Servers

I have recently moved from a Microsoft SQL Server 2000 to a SQL Server
2005.

In the good old Enterprise Manager, when I imported a table from a SQL
server to another, I could choose "Copy objects and data between SQL
Server
databases". When choosen, all primary keys, and default values was
copied.

My question is:
Is it possible to do the same in Microsoft SQL Server Management Studio
with
SQL Server 2005? And how do I do it?

I have tried using the "SELECT * INTO NewTable FROM OldTable"
statement, but
it just drops all information about primary keys and default values.

Best Regards

The functionality you refer to is now part of SSIS (SQL Server Integration Services). You can access it from the Management Studio in a number of ways. The simplest is to right click on the database you want to import the data into, select all tasks, then select import data...

If you didn't install SSIS with the Database Engine, I'm not sure if you'll be able to access the import functionalty.

See this article on msdn for more info.

Wednesday, March 7, 2012

Copy All Tables from Server A to Server B

I haven't had any luck using the Transfer SQL Server Objects task and from what I have found in researching the issues I ran into, no else has. I have found the Roll Your Own article but being non-educated in SMO and VB.Net (I know some VB but nothing about C#), I really need an example of a server to server copy/transfer.

Any help would be greatly appreciated.

Did you take a look at this link? It has VB code for copying a database: http://blogs.msdn.com/mattm/archive/2007/04/18/roll-your-own-transfer-sql-server-objects-task.aspx. To copy server to server, you'd just need to modify it to include a source and destination server.|||I know this will sound lame, but that's my problem. I haven't figured out how to add a source and destination server. I've never worked with this before and I haven't found any examples.

Friday, February 24, 2012

Coping Database objects from one database to another blank database.

I want to create a duplicate database in sql 2000 using asp.net from a webform
I created a database using CREATE DATABASE ......
But how to copy tables, views, stored procedures to newly created
database from old using asp.net from webform
Is there any another method to create a duplicate database with another name
from existing database on same server ?

yes you can do have another DB with different name and that has everything the same ....!!!|||One way it can be done is with the backup database command. You can backup a database, create a new database and then restore the backup to the new database. This can all be done in batch scripts and with T-SQL. Take a look at this link on MSDN, also look at the RESTORE links down at the bottom.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_ba-bz_35ww.asp
Hope this helps
|||

The easiest is to use the Restore option of the Backup and Restore wizard, choose the restore from a Device option click on the wizard to locate your .bak file and SQL Server will ask you for a name for the new version. If the restore is not successfull delete it and start again. Hope this helps.

|||Hello,
I have project of a company having 15 branches allover.
I want to create a seperate database for each branch.
When a customer register a new branch new database should be created.
Thank for the reply
|||

If you are just creating Databases all you need are fifteen connection strings in your Web.config by creating new app setting section for each database. If you need the databases in separate servers you have to register all servers in your SQL Server and create the databases. When you are connecting to SQL Server you are accessing none .NET managed resource so I think you should plan and test all options and your users creating databases on login should not be one of them. Hope this helps.

Tuesday, February 14, 2012

Converting tables to Upper case

Hello, we've an Oracle transition in the pipeline and want to convert
all our database objects to upper case. Any one got a script or
technique (other than manual) to do it?

Many thanks, Kevin.The two statements below should get you started. If you need to rename
indexes in addition to tables then you can change the u.type in the
WHERE clause of the first statement. Run these statements in every
database in which you need to do this. It will generate the code that
you need to run, so copy and paste the results in the query window and
run that.

I ran both statements and eyeballed the results and they looked ok, but
I have not actually tested this by running the results, so you should
go over it yourself as well.

HTH,
-Tom.

SELECT 'EXEC sp_rename ''[' + u.name + '].[' + o.name + ']'', ''[' +
UPPER(o.name) + ']'''
FROM sysobjects o
INNER JOIN sysusers u ON u.uid = o.uid
WHERE o.type = 'U'

SELECT 'EXEC sp_rename ''[' + u.name + '].[' + t.name + '].[' + c.name
+ ']'', ''[' + UPPER(c.name) + ']'', ''COLUMN'''
FROM sysobjects t
INNER JOIN sysusers u ON u.uid = t.uid
INNER JOIN syscolumns c ON c.id = t.id
WHERE t.type = 'U'|||Thanks very much, this works a treat and is a great idea. Apologies
for delay in replying.

kevin.

"Thomas R. Hummel" <tom_hummel@.hotmail.com> wrote in message news:<1112379305.650858.281710@.f14g2000cwb.googlegroups. com>...
> The two statements below should get you started. If you need to rename
> indexes in addition to tables then you can change the u.type in the
> WHERE clause of the first statement. Run these statements in every
> database in which you need to do this. It will generate the code that
> you need to run, so copy and paste the results in the query window and
> run that.
> I ran both statements and eyeballed the results and they looked ok, but
> I have not actually tested this by running the results, so you should
> go over it yourself as well.
> HTH,
> -Tom.
> SELECT 'EXEC sp_rename ''[' + u.name + '].[' + o.name + ']'', ''[' +
> UPPER(o.name) + ']'''
> FROM sysobjects o
> INNER JOIN sysusers u ON u.uid = o.uid
> WHERE o.type = 'U'
> SELECT 'EXEC sp_rename ''[' + u.name + '].[' + t.name + '].[' + c.name
> + ']'', ''[' + UPPER(c.name) + ']'', ''COLUMN'''
> FROM sysobjects t
> INNER JOIN sysusers u ON u.uid = t.uid
> INNER JOIN syscolumns c ON c.id = t.id
> WHERE t.type = 'U'