Showing posts with label export. Show all posts
Showing posts with label export. Show all posts

Thursday, March 29, 2012

Can I Import/Export Database Designs between Visual Studio 2003 and SQL Server 2005 Tools?

Title says it all, really.

Visual Studio has a "Reverse Engineer" option but the only export option appears to be to a graphics-definition database.

Regards,

Nick Samuel

These designs are just graphical representations of the physical structures, they are stored in a series of tables whose names start with dt. If you then copy that database to SQL 2005 and set the compat level to 90 then the 2005 diagram tool should be able to read it.|||

Hi Euan,

Thank you for your response.

I cannot find an option to set a compat level.

Regards,

Nick Samuel

Sunday, March 25, 2012

can I export view result to excel ?

Good morning all,

I created a view that selects the rows of the records from a table that matches where condition.
I need to export the records to excel so I could send it out...
what is the best way to do?
Please tell me detail, I don't know much about SQL 2000, still learning.

Thank you,
YanorooUse the DTS wizard (import and export data in start menu->Microsoft SQL server).

The wizard will ask you the information needed in order to complete the operation. Select the MS-Excel driver as a destination (as well as the output filename), choose the first options (export tables an views) and select your view in particular.

Shouldn't be too hard.|||yes, I was able to do that!
Thank you!

can I export tables so that existing tables in destination database will be modified?

I'm working on an ASP.Net project where I want to test code on a local
machine using a local database as a back-end, and then export it to
the production machine where it uses the hosting provider's SQL Server
database on the back-end. Is there a way to export tables from one
SQL Server database to another in such a way that if a table already
exists in the destination database, it will be updated to reflect the
changes to the local table, without existing data in the destination
table being lost? e.g. suppose I change some tables in my local
database by adding new fields. Can I "export" these changes to the
destination database so that the new fields will be added to the
destination tables (and filled in with default values), without losing
data in the destination tables?

If I run the DTS Import/Export Wizard that comes with SQL Server and
choose "Copy table(s) and view(s) from the source database" and choose
the tables I want to copy, there is apparently no option *not* to copy
the data, and since I don't want to copy the data, that choice doesn't
work. If instead of "Copy table(s) and view(s) from the source
database", I choose "Copy objects and data between SQL Server
databases", then on the following options I can uncheck the "Copy
Data" box to prevent data being copied. But for the "Create
Destination Objects" choices, I have to uncheck "Drop destination
objects first" since I don't want to lose the existing data. But when
I uncheck that and try to do the copy, I get collisions between the
properties of the local table and the existing destination table,
e.g.:
"Table 'wbuser' already has a primary key defined on it."

Is there no way to do what I want using the DTS Import/Export Wizard?
Can it be done some other way?

-Bennett"Bennett Haselton" <bennett@.peacefire.org> wrote in message
news:e614455c.0411160123.294dfd10@.posting.google.c om...
> I'm working on an ASP.Net project where I want to test code on a local
> machine using a local database as a back-end, and then export it to
> the production machine where it uses the hosting provider's SQL Server
> database on the back-end. Is there a way to export tables from one
> SQL Server database to another in such a way that if a table already
> exists in the destination database, it will be updated to reflect the
> changes to the local table, without existing data in the destination
> table being lost? e.g. suppose I change some tables in my local
> database by adding new fields. Can I "export" these changes to the
> destination database so that the new fields will be added to the
> destination tables (and filled in with default values), without losing
> data in the destination tables?

In a word, no.

I'd suggest take the same version controlled scripts (you are of course
using version control, right? :-) you used to make the changes in Dev and
run those against the Prod server.

> If I run the DTS Import/Export Wizard that comes with SQL Server and
> choose "Copy table(s) and view(s) from the source database" and choose
> the tables I want to copy, there is apparently no option *not* to copy
> the data, and since I don't want to copy the data, that choice doesn't
> work. If instead of "Copy table(s) and view(s) from the source
> database", I choose "Copy objects and data between SQL Server
> databases", then on the following options I can uncheck the "Copy
> Data" box to prevent data being copied. But for the "Create
> Destination Objects" choices, I have to uncheck "Drop destination
> objects first" since I don't want to lose the existing data. But when
> I uncheck that and try to do the copy, I get collisions between the
> properties of the local table and the existing destination table,
> e.g.:
> "Table 'wbuser' already has a primary key defined on it."
> Is there no way to do what I want using the DTS Import/Export Wizard?
> Can it be done some other way?
> -Bennett|||"Greg D. Moore \(Strider\)" <mooregr_deleteth1s@.greenms.com> wrote in message news:<7Mnmd.16$1u.15@.twister.nyroc.rr.com>...
> "Bennett Haselton" <bennett@.peacefire.org> wrote in message
> news:e614455c.0411160123.294dfd10@.posting.google.c om...
> > I'm working on an ASP.Net project where I want to test code on a local
> > machine using a local database as a back-end, and then export it to
> > the production machine where it uses the hosting provider's SQL Server
> > database on the back-end. Is there a way to export tables from one
> > SQL Server database to another in such a way that if a table already
> > exists in the destination database, it will be updated to reflect the
> > changes to the local table, without existing data in the destination
> > table being lost? e.g. suppose I change some tables in my local
> > database by adding new fields. Can I "export" these changes to the
> > destination database so that the new fields will be added to the
> > destination tables (and filled in with default values), without losing
> > data in the destination tables?
> In a word, no.
> I'd suggest take the same version controlled scripts (you are of course
> using version control, right? :-) you used to make the changes in Dev and
> run those against the Prod server.

Uh, no... my "script" is that I move the mouse pointer over the
"wbuser" table in Server Explorer in VS .Net, right-click, pick
"Design Table", and add columns that way :)

So I guess I'll just have to remember to run that "script" against the
Prod database whenever I make any changes.

Still, I would have thought that what I was trying, would be a pretty
common thing for people to want to do... surprised it's not built-in.

-Bennett|||Bennett Haselton (bennett@.peacefire.org) writes:
> Uh, no... my "script" is that I move the mouse pointer over the
> "wbuser" table in Server Explorer in VS .Net, right-click, pick
> "Design Table", and add columns that way :)
> So I guess I'll just have to remember to run that "script" against the
> Prod database whenever I make any changes.
> Still, I would have thought that what I was trying, would be a pretty
> common thing for people to want to do... surprised it's not built-in.

There are third-party tools. Red Gate's SQL Compare is popular.

One reason that this is not built-in is that changes to tables is far
from always something that can be performed automatically. In our shop
we keep all table definitions under source control. To generate an update
script we have a tool that reads SourceSafe between two labels to load
all new and changed objects. For changed tables you get a script that
copies data from the old definition to the new, but this script is really
only a template. In many cases I need to change the script, because a
new column is supposed be initiated with some values derived from
other columns or tables. And there might be even wilder changes.

Point and click may be convenient, but for something which is to be
run several times needs to be automized to be sure that all are updates
are carried out the same way. Thus, you need a script.

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

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

Can I export a report as PDF files within a DOS batch file?

Hi,
Is there any command line tool that helps me to export a report into a PDF
file?
I need to do that within a batch file. I am trying to avoid C# coding to do
that.
Any help would be appreciated,
Maxyes, rs.exe should do what you are trying to accomplish.
--
Shaun Beane, MCT, MCDST, MCDBA
dbageek.blogspot.com
"Maxwell2006" <alanalan@.newsgroup.nospam> wrote in message
news:eU8dFLcXGHA.3724@.TK2MSFTNGP02.phx.gbl...
> Hi,
> Is there any command line tool that helps me to export a report into a PDF
> file?
> I need to do that within a batch file. I am trying to avoid C# coding to
> do that.
> Any help would be appreciated,
> Max
>|||Great! Do you know any link to a sample that shows me how to export and save
the report into a PDF file?
"Shaun Beane" <shaun.beane@.gmail.nojunk.com> wrote in message
news:OhIWIZcXGHA.4148@.TK2MSFTNGP03.phx.gbl...
> yes, rs.exe should do what you are trying to accomplish.
> --
> Shaun Beane, MCT, MCDST, MCDBA
> dbageek.blogspot.com
> "Maxwell2006" <alanalan@.newsgroup.nospam> wrote in message
> news:eU8dFLcXGHA.3724@.TK2MSFTNGP02.phx.gbl...
>> Hi,
>> Is there any command line tool that helps me to export a report into a
>> PDF file?
>> I need to do that within a batch file. I am trying to avoid C# coding to
>> do that.
>> Any help would be appreciated,
>> Max
>>
>|||Hi Maxwell,
You can use the RS.exe Utility to export the report to the PDF file.
RS.exe will read a script file which should be written by VB.NET.
Here is a article posted some sample code, you may try to refer.
http://groups.google.com/group/microsoft.public.sqlserver.reportingsvcs/brow
se_frm/thread/e608c8fecc95d08/8a2dcc6ca82bf3fc?tvc=1&q=RS+utility+export+pdf
&hl=zh-CN#8a2dcc6ca82bf3fc
Hope this will be helpful.
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================This posting is provided "AS IS" with no warranties, and confers no rights.

can I export a database from query analyzer?

Is there a command or script I can run from query analyzer to export a
database?
Its a long story but I can only get to the database through query analyzer
and there is one database I need to pull out to another machine.
Thanks,
You can do a couple of things:
1) Backup the database and then restore it on the other server. Refer to SQL Server Books Online for syntax and examples
2) If you have a copy of the database files (data + logs) then you can use sp_attach_db to attach the database files on another server.
3) If you don't have the database files but can take the database offline for sometime then you can take the database offline (one method will be to use sp_dboption) then
copy the files to the new server. Now you can take db online. connect to the new server using QA and use sp_attach_db
HTH,
Best Regards,
Uttam Parui
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.
Are you secure? For information about the Strategic Technology Protection Program and to order your FREE Security Tool Kit, please visit
http://www.microsoft.com/security.
Microsoft highly recommends that users with Internet access update their Microsoft software to better protect against viruses and security vulnerabilities. The easiest way
to do this is to visit the following websites: http://www.microsoft.com/protect
http://www.microsoft.com/security/guidance/default.mspx
|||Great I do have the database files and log. I will just attach those in
another instance.
Thanks for your help.
"Uttam Parui[MS]" wrote:

> You can do a couple of things:
> 1) Backup the database and then restore it on the other server. Refer to SQL Server Books Online for syntax and examples
> 2) If you have a copy of the database files (data + logs) then you can use sp_attach_db to attach the database files on another server.
> 3) If you don't have the database files but can take the database offline for sometime then you can take the database offline (one method will be to use sp_dboption) then
> copy the files to the new server. Now you can take db online. connect to the new server using QA and use sp_attach_db
> HTH,
> Best Regards,
> Uttam Parui
> Microsoft Corporation
> This posting is provided "AS IS" with no warranties, and confers no rights.
> Are you secure? For information about the Strategic Technology Protection Program and to order your FREE Security Tool Kit, please visit
> http://www.microsoft.com/security.
> Microsoft highly recommends that users with Internet access update their Microsoft software to better protect against viruses and security vulnerabilities. The easiest way
> to do this is to visit the following websites: http://www.microsoft.com/protect
> http://www.microsoft.com/security/guidance/default.mspx
>
>
sql

Sunday, March 11, 2012

Can DTS automatically create primary key values upon export?

I have two practice tables I have created and want to export the values of one into the source table. I want to know if I can export into a table and have the destination table automatically give a primary key value to a record? I haven't been able to figure this out even after fiddling with the "Enable identity insert" checkbox under the Column Mappings tab. I have created source tables with and without primary keys and neither works because of the fact that I need to have a value for a primary key in order to INSERT into the destination.

Do I have to copy the source records into a staging table and assign the PK values myself by hand? This can't be the answer.

ddaveyou have to clear the enable identity insert checkbox if you want to allow the identity values to be poped by you
adding a check indicates that you want to programmatically provide the identity values
try clearing it and setting your identity on the column|||Thanks. I did do as you mention but I also had to create the destination table with a Primary Key with an identity field that incremented automatically by 1. I also had to create a source table that had NO primary key field. I then imported the source into the destination and the incoming rows were assigned Primary Key values in sequence.

ddave

you have to clear the enable identity insert checkbox if you want to allow the identity values to be poped by you
adding a check indicates that you want to programmatically provide the identity values
try clearing it and setting your identity on the column

Can disable DTC or Transactions when I use OLEDB provider for Oracle?

Hi,
I am trying to improve my data export operation. At this point I need to
disable implicit transactions when I use insert into [Linked Table] command.
How can disable transactions when I do a distributed insert or use DTS to
export table data ?
Thank you,
MaxHello Max,
You could disable transaction by right click the
package->Properties->Advanced, uncheck "transaction"
Best Regards,
Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=====================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
>From: "Maxwell2006" <alanalan@.newsgroup.nospam>
>Subject: Can disable DTC or Transactions when I use OLEDB provider for
Oracle?
>Date: Tue, 4 Apr 2006 14:18:01 -0400
>Lines: 19
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 6.00.3790.1830
>X-RFC2646: Format=Flowed; Original
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.1830
>Message-ID: <eES89OBWGHA.5044@.TK2MSFTNGP09.phx.gbl>
>Newsgroups: microsoft.public.sqlserver.server
>NNTP-Posting-Host: mtl-hse-ppp170505.qc.sympatico.ca 65.94.105.17
>Path:
TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP0
9.phx.gbl
>Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.sqlserver.server:426864
>X-Tomcat-NG: microsoft.public.sqlserver.server
>Hi,
>
>I am trying to improve my data export operation. At this point I need to
>disable implicit transactions when I use insert into [Linked Table]
command.
>
>How can disable transactions when I do a distributed insert or use DTS to
>export table data ?
>
>Thank you,
>Max
>
>

Saturday, February 25, 2012

Can anyone Help Me??

Hi gurus,
I have been trying to export my mssql tables into mysql database using DTS. But I get a very strange error for some of my mssql tables which have "text" and "ntext" as field datatypes.The error message that i was gettins is,
"Query based insertion or updating of BLOB values is not supported".
But iam not using any BLOB values in my tables.
So if anyone has any solution for this please let me know.
Thanking you.Are using ODBC to connect the database in ur package?
Try to use SQL Oledb driver.
download latest service pack of SQL Server
download latest MDAC also,if it is not latest.|||I do not think this is going to work. when the error says blob it is talking about the text columns. avoid using text and ntext if at all possible. it usually not really needed. Find the max len of the exisiting data and perhaps change your data type.