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. Need suggestion for two database inconsistency

Need suggestion for two database inconsistency

Scheduled Pinned Locked Moved Database
databasehelp
6 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.
  • V Offline
    V Offline
    vanillaET
    wrote on last edited by
    #1

    I have a problem of inserting a record which includes data type conversion. There are two databases with the same data structure. One database is ok to insert that record, but another is not ok for data type conversion. I've checked all the data fields.Please give me any suggestion to solve it.

    J L 2 Replies Last reply
    0
    • V vanillaET

      I have a problem of inserting a record which includes data type conversion. There are two databases with the same data structure. One database is ok to insert that record, but another is not ok for data type conversion. I've checked all the data fields.Please give me any suggestion to solve it.

      J Offline
      J Offline
      Jorgen Andersson
      wrote on last edited by
      #2

      What type is it you're trying to insert, and what type is the field? What DB are you using?

      Light moves faster than sound. That is why some people appear bright, until you hear them speak. List of common misconceptions

      V 1 Reply Last reply
      0
      • J Jorgen Andersson

        What type is it you're trying to insert, and what type is the field? What DB are you using?

        Light moves faster than sound. That is why some people appear bright, until you hear them speak. List of common misconceptions

        V Offline
        V Offline
        vanillaET
        wrote on last edited by
        #3

        I'm using MSSQL2005. Inserting includes code such as 'X001' which is varchar and it needs to be incremented automatically. So that I converted varchar to numeric. It's ok for one database, but it's not ok for another one. I've checked all the data fields. It's all the same. Any solution for this? Thanks a lot.

        J 1 Reply Last reply
        0
        • V vanillaET

          I'm using MSSQL2005. Inserting includes code such as 'X001' which is varchar and it needs to be incremented automatically. So that I converted varchar to numeric. It's ok for one database, but it's not ok for another one. I've checked all the data fields. It's all the same. Any solution for this? Thanks a lot.

          J Offline
          J Offline
          Jorgen Andersson
          wrote on last edited by
          #4

          Are both databases having the same globalization settings?

          Light moves faster than sound. That is why some people appear bright, until you hear them speak. List of common misconceptions

          V 1 Reply Last reply
          0
          • J Jorgen Andersson

            Are both databases having the same globalization settings?

            Light moves faster than sound. That is why some people appear bright, until you hear them speak. List of common misconceptions

            V Offline
            V Offline
            vanillaET
            wrote on last edited by
            #5

            Do u mean same database property? Actually, the database is restored but some changes had been made. But any changes had not been made to that data table which I'm trying to insert a record. Thanks for your help..

            1 Reply Last reply
            0
            • V vanillaET

              I have a problem of inserting a record which includes data type conversion. There are two databases with the same data structure. One database is ok to insert that record, but another is not ok for data type conversion. I've checked all the data fields.Please give me any suggestion to solve it.

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              vanillaET wrote:

              There are two databases with the same data structure. One database is ok to insert that record, but another is not ok for data type conversion. I've checked all the data fields.Please give me any suggestion to solve it.

              Check the data-fields again. You're inserting something that cannot be converted, might be a text in a bit or a datetime field. Try logging all values that are going to be inserted, and have the app mail the offending values using a try-catch block. Next, simply try the offending values using your original insert-statement trough the Sql Management Studio.

              Bastard Programmer from Hell :suss:

              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