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. Database & SysAdmin
  3. Database
  4. how to transfer all data to another database

how to transfer all data to another database

Scheduled Pinned Locked Moved Database
databasequestiontutorial
14 Posts 3 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.
  • H harcaype

    hi. How do you transfer data of a database from another database. I am using MS SQL. I have hundreds of data there and I need to transfer it to another database since I'm having problems with the previous one with regards to attaching it to the dataset with crystal reports. It only recognizes the newly created databases in SQL Express and I don't know why. So I just planned to recreate my recent database and transfer all of the existing data to a new one. How do I do that? Thanks!

    W Offline
    W Offline
    Wendelius
    wrote on last edited by
    #2

    harcaype wrote:

    How do you transfer data of a database from another database

    SSIS is one way if you have to do this continuously but you can also use backup/restore or detach/attach. They would be easier for a single transfer.

    harcaype wrote:

    It only recognizes the newly created databases in SQL Express

    If this is the root problem, I think you should concentrate in this. There's no reason why Crystal would connect only to a new database if the database you're trying to connect to is in good condition.

    The need to optimize rises from a bad design.My articles[^]

    H J 2 Replies Last reply
    0
    • W Wendelius

      harcaype wrote:

      How do you transfer data of a database from another database

      SSIS is one way if you have to do this continuously but you can also use backup/restore or detach/attach. They would be easier for a single transfer.

      harcaype wrote:

      It only recognizes the newly created databases in SQL Express

      If this is the root problem, I think you should concentrate in this. There's no reason why Crystal would connect only to a new database if the database you're trying to connect to is in good condition.

      The need to optimize rises from a bad design.My articles[^]

      H Offline
      H Offline
      harcaype
      wrote on last edited by
      #3

      Root problem? I'm sorry, but what did you mean by root problem? I'm not really sure myself though. A few days ago I was able to attach the tables on the dataset with the same database, and get recognized in the Crystal Report Wizard. Then when I duplicated my project file, and redo what I did in my "backed-up" project file, that started the strange problem. And if you mean that getting and successfully querying the database is a good condition, Yes. My database is in good condition for that part.

      W 1 Reply Last reply
      0
      • H harcaype

        Root problem? I'm sorry, but what did you mean by root problem? I'm not really sure myself though. A few days ago I was able to attach the tables on the dataset with the same database, and get recognized in the Crystal Report Wizard. Then when I duplicated my project file, and redo what I did in my "backed-up" project file, that started the strange problem. And if you mean that getting and successfully querying the database is a good condition, Yes. My database is in good condition for that part.

        W Offline
        W Offline
        Wendelius
        wrote on last edited by
        #4

        harcaype wrote:

        A few days ago I was able to attach the tables on the dataset with the same database, and get recognized in the Crystal Report Wizard. Then when I duplicated my project file, and redo what I did in my "backed-up" project file, that started the strange problem

        Yes that's what I mean by root problem. If your new project acts differently than the previous project I would guess that the problem is actually in the project, not in the database. But then again I don't know enough about the solution so this is merely guessing. Try for example restoring a backup to a new database. If that solves the problem then everything should be ok. If it doesn't it would still give you more information about the problem.

        The need to optimize rises from a bad design.My articles[^]

        H 1 Reply Last reply
        0
        • W Wendelius

          harcaype wrote:

          A few days ago I was able to attach the tables on the dataset with the same database, and get recognized in the Crystal Report Wizard. Then when I duplicated my project file, and redo what I did in my "backed-up" project file, that started the strange problem

          Yes that's what I mean by root problem. If your new project acts differently than the previous project I would guess that the problem is actually in the project, not in the database. But then again I don't know enough about the solution so this is merely guessing. Try for example restoring a backup to a new database. If that solves the problem then everything should be ok. If it doesn't it would still give you more information about the problem.

          The need to optimize rises from a bad design.My articles[^]

          H Offline
          H Offline
          harcaype
          wrote on last edited by
          #5

          I tried attaching the database on a newly created project. Still the same. Not recognized in the crystal report wizard. Sigh.. Oh well. I'll just try this newly created database first. Hopefully it works.

          W 1 Reply Last reply
          0
          • H harcaype

            I tried attaching the database on a newly created project. Still the same. Not recognized in the crystal report wizard. Sigh.. Oh well. I'll just try this newly created database first. Hopefully it works.

            W Offline
            W Offline
            Wendelius
            wrote on last edited by
            #6

            Let's hope so. If not, post what you have found and we'll see if some new ideas come up.

            The need to optimize rises from a bad design.My articles[^]

            1 Reply Last reply
            0
            • W Wendelius

              harcaype wrote:

              How do you transfer data of a database from another database

              SSIS is one way if you have to do this continuously but you can also use backup/restore or detach/attach. They would be easier for a single transfer.

              harcaype wrote:

              It only recognizes the newly created databases in SQL Express

              If this is the root problem, I think you should concentrate in this. There's no reason why Crystal would connect only to a new database if the database you're trying to connect to is in good condition.

              The need to optimize rises from a bad design.My articles[^]

              J Offline
              J Offline
              Jerry Hammond
              wrote on last edited by
              #7

              Mika Wendelius wrote:

              There's no reason why Crystal would connect only to a new database if the database you're trying to connect to is in good condition.

              Unless Crystal Reports is connected to the new instance only. I'm willing to bet he has two instances installed.

              The world is a stage and most of us are desperately unrehearsed. —Sean O’Casey, Playwright

              W 1 Reply Last reply
              0
              • J Jerry Hammond

                Mika Wendelius wrote:

                There's no reason why Crystal would connect only to a new database if the database you're trying to connect to is in good condition.

                Unless Crystal Reports is connected to the new instance only. I'm willing to bet he has two instances installed.

                The world is a stage and most of us are desperately unrehearsed. —Sean O’Casey, Playwright

                W Offline
                W Offline
                Wendelius
                wrote on last edited by
                #8

                Jerry Hammond wrote:

                I'm willing to bet he has two instances installed

                That would explain it, but even though it's a matter of connection string... "Where do want to go today" :)

                The need to optimize rises from a bad design.My articles[^]

                J 1 Reply Last reply
                0
                • W Wendelius

                  Jerry Hammond wrote:

                  I'm willing to bet he has two instances installed

                  That would explain it, but even though it's a matter of connection string... "Where do want to go today" :)

                  The need to optimize rises from a bad design.My articles[^]

                  J Offline
                  J Offline
                  Jerry Hammond
                  wrote on last edited by
                  #9

                  If I remember my Crystal Reports it is even simpler. From within the report he is building he should be able to use the UI to connect to the correct instance/db.

                  The world is a stage and most of us are desperately unrehearsed. —Sean O’Casey, Playwright

                  W 1 Reply Last reply
                  0
                  • J Jerry Hammond

                    If I remember my Crystal Reports it is even simpler. From within the report he is building he should be able to use the UI to connect to the correct instance/db.

                    The world is a stage and most of us are desperately unrehearsed. —Sean O’Casey, Playwright

                    W Offline
                    W Offline
                    Wendelius
                    wrote on last edited by
                    #10

                    It depends if he's letting the dialogs to show up or if he sets credentials in the code. But you're right, at the time when the report is launched, the actual connection is evaluated. And if any information is missing, it will be asked.

                    The need to optimize rises from a bad design.My articles[^]

                    H 1 Reply Last reply
                    0
                    • W Wendelius

                      It depends if he's letting the dialogs to show up or if he sets credentials in the code. But you're right, at the time when the report is launched, the actual connection is evaluated. And if any information is missing, it will be asked.

                      The need to optimize rises from a bad design.My articles[^]

                      H Offline
                      H Offline
                      harcaype
                      wrote on last edited by
                      #11

                      I got it working now. Thanks! I just created a new database however I have a new problem. Yesterday I was able to successfully migrate my data to another database, using this query: "INSERT INTO Records SELECT * FROM MMDAserver.dbo.Records", then being stupid, I accidentally deleted the newly created database from the project file I attached into. Now when I created the new database again with the same name and same everything, I already get this error when I try to copy them again: Msg 8101, Level 16, State 1, Line 1 An explicit value for the identity column in table 'Records' can only be specified when a column list is used and IDENTITY_INSERT is ON.

                      W 1 Reply Last reply
                      0
                      • H harcaype

                        I got it working now. Thanks! I just created a new database however I have a new problem. Yesterday I was able to successfully migrate my data to another database, using this query: "INSERT INTO Records SELECT * FROM MMDAserver.dbo.Records", then being stupid, I accidentally deleted the newly created database from the project file I attached into. Now when I created the new database again with the same name and same everything, I already get this error when I try to copy them again: Msg 8101, Level 16, State 1, Line 1 An explicit value for the identity column in table 'Records' can only be specified when a column list is used and IDENTITY_INSERT is ON.

                        W Offline
                        W Offline
                        Wendelius
                        wrote on last edited by
                        #12

                        This means that you hav an IDENTITY column in records table. Normally you cannot give value to an identity column because SQL Server assigns it. When migrating old data you can set this feature temporarily off. Have a look at: SET IDENTITY_INSERT (Transact-SQL)[^] However if you don't want that SQL Server assigns the value at all, you should remove the identity definition from that table.

                        The need to optimize rises from a bad design.My articles[^]

                        H 1 Reply Last reply
                        0
                        • W Wendelius

                          This means that you hav an IDENTITY column in records table. Normally you cannot give value to an identity column because SQL Server assigns it. When migrating old data you can set this feature temporarily off. Have a look at: SET IDENTITY_INSERT (Transact-SQL)[^] However if you don't want that SQL Server assigns the value at all, you should remove the identity definition from that table.

                          The need to optimize rises from a bad design.My articles[^]

                          H Offline
                          H Offline
                          harcaype
                          wrote on last edited by
                          #13

                          Yeah I just noticed. LOL. I removed the Identity Specification for the newly created tables. THANKS A BUNCH! You guys were a great help! :)

                          W 1 Reply Last reply
                          0
                          • H harcaype

                            Yeah I just noticed. LOL. I removed the Identity Specification for the newly created tables. THANKS A BUNCH! You guys were a great help! :)

                            W Offline
                            W Offline
                            Wendelius
                            wrote on last edited by
                            #14

                            You're welcome :)

                            The need to optimize rises from a bad design.My articles[^]

                            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