Database build in c#
-
My Objective: Connect to the odbc datasource and recreate it's database, tables, table's fields, and port the data from the Database A (ODBC)to Batabase B (SQL SERVER). Database B being a Microsoft SQL Server 2008 Database. Here Is what I have: ODBC connection to a datasource. What I know how to do is: Connect to SQL Server to it's master database. I can check to see if a database with a given name already exists. Including tables, stored procedures, and views. I can read and write to an existing database. ------------------------------------------------------------------------------ - What I am looking for direction on is: - - How do I query a existing database for it's set of tables. - - Also how to query each set of tables for it's fields and field types. - ------------------------------------------------------------------------------ Because I need to reconstruct the database and it' tables in the sql server database, and I will not know it's layout. To give an example I have a quickbooks, access, and cobol database, and a odbc connection to the databases. All of which need ported to sql server and updated on a specific time frame. I could do this manually, but I wanted to build a service to do this for me. In order to build the service I need to know how to query a database for it's layout and recreate it in the sql server database system. Can someone please help? Any Ideas or websites that could aid me in understanding how to do this. I will post back also if I find some.
-
My Objective: Connect to the odbc datasource and recreate it's database, tables, table's fields, and port the data from the Database A (ODBC)to Batabase B (SQL SERVER). Database B being a Microsoft SQL Server 2008 Database. Here Is what I have: ODBC connection to a datasource. What I know how to do is: Connect to SQL Server to it's master database. I can check to see if a database with a given name already exists. Including tables, stored procedures, and views. I can read and write to an existing database. ------------------------------------------------------------------------------ - What I am looking for direction on is: - - How do I query a existing database for it's set of tables. - - Also how to query each set of tables for it's fields and field types. - ------------------------------------------------------------------------------ Because I need to reconstruct the database and it' tables in the sql server database, and I will not know it's layout. To give an example I have a quickbooks, access, and cobol database, and a odbc connection to the databases. All of which need ported to sql server and updated on a specific time frame. I could do this manually, but I wanted to build a service to do this for me. In order to build the service I need to know how to query a database for it's layout and recreate it in the sql server database system. Can someone please help? Any Ideas or websites that could aid me in understanding how to do this. I will post back also if I find some.
I hope that the following article will help you.... A simple example of SQL server admin tools
Thanks Md. Marufuzzaman
Don't forget to click [Vote] / [Good Answer] on the post(s) that helped you. I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.
-
My Objective: Connect to the odbc datasource and recreate it's database, tables, table's fields, and port the data from the Database A (ODBC)to Batabase B (SQL SERVER). Database B being a Microsoft SQL Server 2008 Database. Here Is what I have: ODBC connection to a datasource. What I know how to do is: Connect to SQL Server to it's master database. I can check to see if a database with a given name already exists. Including tables, stored procedures, and views. I can read and write to an existing database. ------------------------------------------------------------------------------ - What I am looking for direction on is: - - How do I query a existing database for it's set of tables. - - Also how to query each set of tables for it's fields and field types. - ------------------------------------------------------------------------------ Because I need to reconstruct the database and it' tables in the sql server database, and I will not know it's layout. To give an example I have a quickbooks, access, and cobol database, and a odbc connection to the databases. All of which need ported to sql server and updated on a specific time frame. I could do this manually, but I wanted to build a service to do this for me. In order to build the service I need to know how to query a database for it's layout and recreate it in the sql server database system. Can someone please help? Any Ideas or websites that could aid me in understanding how to do this. I will post back also if I find some.
Download the SQL Server 2008 Samples here[^], and extract them. Investigate the code samples in the Samples\Engine folder, particularly the Administration, Data Access and Programmability folders. There are examples of how to do most of the things that you require. Access has its own tool to upscale to SQL server, if you have acess to Access. :) I'm not sure that you can change the database for QuickBooks. I do not know of a tool to create an SQL Server database from a Cobol database.
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”
-
My Objective: Connect to the odbc datasource and recreate it's database, tables, table's fields, and port the data from the Database A (ODBC)to Batabase B (SQL SERVER). Database B being a Microsoft SQL Server 2008 Database. Here Is what I have: ODBC connection to a datasource. What I know how to do is: Connect to SQL Server to it's master database. I can check to see if a database with a given name already exists. Including tables, stored procedures, and views. I can read and write to an existing database. ------------------------------------------------------------------------------ - What I am looking for direction on is: - - How do I query a existing database for it's set of tables. - - Also how to query each set of tables for it's fields and field types. - ------------------------------------------------------------------------------ Because I need to reconstruct the database and it' tables in the sql server database, and I will not know it's layout. To give an example I have a quickbooks, access, and cobol database, and a odbc connection to the databases. All of which need ported to sql server and updated on a specific time frame. I could do this manually, but I wanted to build a service to do this for me. In order to build the service I need to know how to query a database for it's layout and recreate it in the sql server database system. Can someone please help? Any Ideas or websites that could aid me in understanding how to do this. I will post back also if I find some.
I have been researching. So far I have come across. --select * from sys.dm_exec_connections select * from sysobjects where [name] like 'dbo.%' select * from INFORMATION_SCHEMA.TABLES select table_name as Name from INFORMATION_SCHEMA.Tables where TABLE_TYPE = 'BASE TABLE' SELECT * FROM INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = 'tblprweekendingdates' in sql server studio manager. Would it be true to sql I can pass these sql statements to a given database via a odbc connection and return the same results?
-
I have been researching. So far I have come across. --select * from sys.dm_exec_connections select * from sysobjects where [name] like 'dbo.%' select * from INFORMATION_SCHEMA.TABLES select table_name as Name from INFORMATION_SCHEMA.Tables where TABLE_TYPE = 'BASE TABLE' SELECT * FROM INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = 'tblprweekendingdates' in sql server studio manager. Would it be true to sql I can pass these sql statements to a given database via a odbc connection and return the same results?
when you using odbc as connection source then there are some security issue you must concern..for example you are connected with database "A" the you cannot fully access to other database if you are not authorized... You need to check that your loginID is authorized or not to perform transact-sql statement execution to the desire one using odbc.
Thanks Md. Marufuzzaman
Don't forget to click [Vote] / [Good Answer] on the post(s) that helped you. I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.
-
My Objective: Connect to the odbc datasource and recreate it's database, tables, table's fields, and port the data from the Database A (ODBC)to Batabase B (SQL SERVER). Database B being a Microsoft SQL Server 2008 Database. Here Is what I have: ODBC connection to a datasource. What I know how to do is: Connect to SQL Server to it's master database. I can check to see if a database with a given name already exists. Including tables, stored procedures, and views. I can read and write to an existing database. ------------------------------------------------------------------------------ - What I am looking for direction on is: - - How do I query a existing database for it's set of tables. - - Also how to query each set of tables for it's fields and field types. - ------------------------------------------------------------------------------ Because I need to reconstruct the database and it' tables in the sql server database, and I will not know it's layout. To give an example I have a quickbooks, access, and cobol database, and a odbc connection to the databases. All of which need ported to sql server and updated on a specific time frame. I could do this manually, but I wanted to build a service to do this for me. In order to build the service I need to know how to query a database for it's layout and recreate it in the sql server database system. Can someone please help? Any Ideas or websites that could aid me in understanding how to do this. I will post back also if I find some.
Access will be pretty simple, I will be astonished if Quickbooks publish their schema or allow you to query their system tables. As for cobol X| I'm not sure cobol even has the metadata to query!
Never underestimate the power of human stupidity RAH