Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Database build in c#

Database build in c#

Scheduled Pinned Locked Moved C#
databasetutorialquestioncsharpsql-server
6 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    JollyMansArt
    wrote on last edited by
    #1

    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.

    H M J M 4 Replies Last reply
    0
    • J JollyMansArt

      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.

      M Offline
      M Offline
      Md Marufuzzaman
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      • J JollyMansArt

        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.

        H Offline
        H Offline
        Henry Minute
        wrote on last edited by
        #3

        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.”

        1 Reply Last reply
        0
        • J JollyMansArt

          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.

          J Offline
          J Offline
          JollyMansArt
          wrote on last edited by
          #4

          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?

          M 1 Reply Last reply
          0
          • J JollyMansArt

            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?

            M Offline
            M Offline
            Md Marufuzzaman
            wrote on last edited by
            #5

            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.

            1 Reply Last reply
            0
            • J JollyMansArt

              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.

              M Offline
              M Offline
              Mycroft Holmes
              wrote on last edited by
              #6

              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

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups