p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   ADO.NET (http://p2p.wrox.com/forumdisplay.php?f=109)
-   -   Creating & Populating Tables (http://p2p.wrox.com/showthread.php?t=13444)

jitu May 26th, 2004 08:35 AM

Creating & Populating Tables
 
Hi

I will be grateful for any help. I am trying to create and populate a table from a dataset.

I am writing a basic reporting tool which loads data from a Sybase Database into a Dataset (done) then I would like to take that data and create and populate a table on a SQL Sever Database.

The Datatypes etc. are not really important.

Thank you in advance

Jitu Tivari

Hal Levy May 26th, 2004 09:32 AM

I'd use a DTS package in SQL server to do something like that

Hal Levy
Web Developer, PDI Inc.

NOT a Wiley/Wrox Employee

melvik May 26th, 2004 10:46 AM

Check [u]Priview DataSet</u> if u get data at disign time?!
Then Check ur Command not at run time!
Do u feel ur DataSet?! Does it give any error?!

Always:),
Hovik Melkomian.

jitu June 2nd, 2004 03:19 AM

Hi

Thank you for replying my topic. I would like to automate this process as much as possible so that the users do not are not required to use DTS from MSSQL. is there a way you can automate a DTS package? for example the select stateent will very from statement to statement and the target table names will also change.

thanks

Jitu

Jitu Tivari

jitu June 2nd, 2004 03:20 AM

Sorry Hovik i have no idea what you are talking about.

but thank you for responding.

Jitu Tivari

melvik June 2nd, 2004 04:47 AM

Sorry I guess I had some typing problem!
Check [u]Priview Data</u> (right click on Adapter) do u get data at disign time?!
Then Check ur Select Command (T-SQL i mean: the command that u run frm Server)
Do u fill ur DataSet?! Does it give any error?!

Quote:

quote:Originally posted by melvik
 Check [u]Priview DataSet</u> if u get data at disign time?!
Then Check ur Command not at run time!
Do u feel ur DataSet?! Does it give any error?!
Always:),
Hovik Melkomian.

jitu June 2nd, 2004 05:36 AM

Hi

I have no problems connecting to Sybase and populating a DataSet i.e. obDataSetTab1.

I would then like to create a table on MSSQL database and then populate it from obDataSetTab1 dataset.

this is where I cannot find the data. I am now looking into writing a wizard using DTS to copy the table from Sybase to MSSQL using a Select Statement.

thank you for your help.


Jitu Tivari

Hal Levy June 2nd, 2004 08:51 AM

OK- lets start over.. What is it your trying to do.. what's the point of the system your writing.. From what you have said, I see no reason to create a dataset from Sybase and then write that same dataset out to SQL server.

So- what's the business problem your trying to solve?


Hal Levy
Web Developer, PDI Inc.

NOT a Wiley/Wrox Employee

jitu June 3rd, 2004 08:31 AM

Hi,

Thank you for your reply.

After reading through many websites I have discovered that the best way to approach the issue is to use DTS from a VB.NET application. Here is a quick summary of what i need to do:

Create an User friendly application to extract data from two different Sybase Databases and export the data into MSSQL and compare the two tables. After generate a report of the differences found.

The user should only provide the data for the two source databases and the SQL statement to extract the data.

Here is some more information:



1) Extract data from Sybase using a select statement from two different Sybase Databases i.e. TEST_1 and TEST_2 using SQL (select * from tblAccounting) and copy them into two tables (i.e. test_1_tblAccounting and test_2_tblAccounting) in a MSSQL Server Database. The tables will also need to be created in MSSQL on the fly as the select statements can be different.

2) once both of the MSSQL tables have been populated with the data, i would like to compare the results between the two tables. for example both tables should have the same invoice numbers, order no., description, amounts, etc. if they are not two things must happen

     a) insert only the invoice number in table that does not have the invoice number.
     b) after (a) create another reporting table with the rows that are different i.e. amount, orderid, etc. along with this data we will need to add another column with the test_1_tblAccounting or test_2_tblAccounting information.

This will allow us to compare both the rows from the different tables in one table.

Then i will be able to write a HTML page to display this data.

I hope the above helps.

thanks


Jitu Tivari

Hal Levy June 3rd, 2004 09:11 AM

There is no reason to get SQL server involved with this proccess at all. Your making this much harder than you need to.

Load two datasets into .NET. Compare the datasets. Update the datasets as required.. write them back to the Sybase databases.

Then, you can update a table in SQL or Sybase with a list of the non-matching records.





Hal Levy
Web Developer, PDI Inc.

NOT a Wiley/Wrox Employee


All times are GMT -4. The time now is 02:03 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.