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. Abnormal Behavior of SQL Server 2008 Enterprise Store Procedure

Abnormal Behavior of SQL Server 2008 Enterprise Store Procedure

Scheduled Pinned Locked Moved Database
databasesharepointsql-serversysadminquestion
13 Posts 5 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 jugnu_ad

    Dear members, I have recently installed SQL Server 2008 Enterprise Version. I have a database built in SQL SERVER 2000 which I attached in 2008. I have a stored procedure which calculates the Inventory Stock. In some cases the sp deducts qty twice when call from front end (VB 6.0) whereas when I run the sp in SQL Server it returns correct result It was running perfectly in SQL Server 2000 from VB 6.0 What could be the cause of this abnormal behavior? Note: The Compatibility Level of the database is set on SQL Server 2000 (80) Waiting for your kind replies. Thanks & Regards, Syed Adnan Shah

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

    There is a bug in your code, but no one here can guess what your code is doing.

    J 1 Reply Last reply
    0
    • L Lost User

      There is a bug in your code, but no one here can guess what your code is doing.

      J Offline
      J Offline
      jugnu_ad
      wrote on last edited by
      #3

      Dear Richard MacCutchan I have written in my post that it is running perfectly through code (VB 6) using SQL Server 2000. The problem occurred when i attached 2000 database in 2008 Enterprise.

      L 1 Reply Last reply
      0
      • J jugnu_ad

        Dear Richard MacCutchan I have written in my post that it is running perfectly through code (VB 6) using SQL Server 2000. The problem occurred when i attached 2000 database in 2008 Enterprise.

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

        You can write anything you like, it proves nothing. And, as I said before, no one here has the remotest chance of guessing what your code is doing.

        1 Reply Last reply
        0
        • J jugnu_ad

          Dear members, I have recently installed SQL Server 2008 Enterprise Version. I have a database built in SQL SERVER 2000 which I attached in 2008. I have a stored procedure which calculates the Inventory Stock. In some cases the sp deducts qty twice when call from front end (VB 6.0) whereas when I run the sp in SQL Server it returns correct result It was running perfectly in SQL Server 2000 from VB 6.0 What could be the cause of this abnormal behavior? Note: The Compatibility Level of the database is set on SQL Server 2000 (80) Waiting for your kind replies. Thanks & Regards, Syed Adnan Shah

          T Offline
          T Offline
          Tim Carmichael
          wrote on last edited by
          #5

          Turn on Profiler and log what is happening when you call the stored procedure directly versus when you call it from VB 6.

          J 1 Reply Last reply
          0
          • T Tim Carmichael

            Turn on Profiler and log what is happening when you call the stored procedure directly versus when you call it from VB 6.

            J Offline
            J Offline
            jugnu_ad
            wrote on last edited by
            #6

            Thanks for your reply When I call The Stored Procedure directly from Sql Server it adds or subtracts stock qty properly, but when i run it through vb6 code it adds or subtracts qty twice. But its not in every execution of SP. I m running my software for 3 to 4 years it never happened like this in SQL Server 2000

            S 1 Reply Last reply
            0
            • J jugnu_ad

              Thanks for your reply When I call The Stored Procedure directly from Sql Server it adds or subtracts stock qty properly, but when i run it through vb6 code it adds or subtracts qty twice. But its not in every execution of SP. I m running my software for 3 to 4 years it never happened like this in SQL Server 2000

              S Offline
              S Offline
              Simon_Whale
              wrote on last edited by
              #7

              What Tim is trying to suggest 1. Turn on SQL Profiler and start it running against your database 2. execute the stored procedure from the VB application 3. stop the profiler 4. in the results from the profiler you can see what was executed and the values that were passed to the stored procedure http://technet.microsoft.com/en-us/library/ms181091(v=sql.105).aspx[^] you need to be able to prove if it the database at fault or the stored procedure.

              Every day, thousands of innocent plants are killed by vegetarians. Help end the violence EAT BACON

              J 1 Reply Last reply
              0
              • S Simon_Whale

                What Tim is trying to suggest 1. Turn on SQL Profiler and start it running against your database 2. execute the stored procedure from the VB application 3. stop the profiler 4. in the results from the profiler you can see what was executed and the values that were passed to the stored procedure http://technet.microsoft.com/en-us/library/ms181091(v=sql.105).aspx[^] you need to be able to prove if it the database at fault or the stored procedure.

                Every day, thousands of innocent plants are killed by vegetarians. Help end the violence EAT BACON

                J Offline
                J Offline
                jugnu_ad
                wrote on last edited by
                #8

                Thank you Simon for explaining me what Tim has suggested. Let me do what you both have said and let you know. Thanks

                1 Reply Last reply
                0
                • J jugnu_ad

                  Dear members, I have recently installed SQL Server 2008 Enterprise Version. I have a database built in SQL SERVER 2000 which I attached in 2008. I have a stored procedure which calculates the Inventory Stock. In some cases the sp deducts qty twice when call from front end (VB 6.0) whereas when I run the sp in SQL Server it returns correct result It was running perfectly in SQL Server 2000 from VB 6.0 What could be the cause of this abnormal behavior? Note: The Compatibility Level of the database is set on SQL Server 2000 (80) Waiting for your kind replies. Thanks & Regards, Syed Adnan Shah

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

                  jugnu_ad wrote:

                  What could be the cause of this abnormal behavior?

                  VB6. Which existed waaaay before Sql Server 2008. Chances are that most of the code isn't type-safe but late-bound, and VB may be doing all kinds of magic on the background to make it work. Did I mention that VB.NET is available for free?

                  Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

                  M T 2 Replies Last reply
                  0
                  • L Lost User

                    jugnu_ad wrote:

                    What could be the cause of this abnormal behavior?

                    VB6. Which existed waaaay before Sql Server 2008. Chances are that most of the code isn't type-safe but late-bound, and VB may be doing all kinds of magic on the background to make it work. Did I mention that VB.NET is available for free?

                    Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

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

                    Sounds like this may be the issue that finally gets him to update/rewrite his app into a current language. Now there will be a whole lot of pressure while he could have started this a decade ago (so speaks the guy still coding in Silverlight :-O ).

                    Never underestimate the power of human stupidity RAH

                    1 Reply Last reply
                    0
                    • J jugnu_ad

                      Dear members, I have recently installed SQL Server 2008 Enterprise Version. I have a database built in SQL SERVER 2000 which I attached in 2008. I have a stored procedure which calculates the Inventory Stock. In some cases the sp deducts qty twice when call from front end (VB 6.0) whereas when I run the sp in SQL Server it returns correct result It was running perfectly in SQL Server 2000 from VB 6.0 What could be the cause of this abnormal behavior? Note: The Compatibility Level of the database is set on SQL Server 2000 (80) Waiting for your kind replies. Thanks & Regards, Syed Adnan Shah

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

                      When you state that something isn't working, you need to show us what that 'something' is. I mean you haven't included your SP code here without which we will not be able to figure out what is wrong.

                      1 Reply Last reply
                      0
                      • L Lost User

                        jugnu_ad wrote:

                        What could be the cause of this abnormal behavior?

                        VB6. Which existed waaaay before Sql Server 2008. Chances are that most of the code isn't type-safe but late-bound, and VB may be doing all kinds of magic on the background to make it work. Did I mention that VB.NET is available for free?

                        Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

                        T Offline
                        T Offline
                        Tim Carmichael
                        wrote on last edited by
                        #12

                        While VB 6 may have it issues, I have written and used in production many applications written in VB 6 pulling data from SQL Server without issue. If there is a problem, I suspect it is with the coding, not the underlying foundations.

                        L 1 Reply Last reply
                        0
                        • T Tim Carmichael

                          While VB 6 may have it issues, I have written and used in production many applications written in VB 6 pulling data from SQL Server without issue. If there is a problem, I suspect it is with the coding, not the underlying foundations.

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

                          Tim Carmichael wrote:

                          While VB 6 may have it issues, I have written and used in production many applications written in VB 6 pulling data from SQL Server without issue.

                          Ditto. I never claimed that VB6 has issues with SQL Server - merely that it existed before Sql 2008. VB6 does not know about Sql2k8, and I doubt that new released Sql versions are tested for backward compatibility for a discontinued product.

                          Tim Carmichael wrote:

                          I suspect it is with the coding, not the underlying foundations.

                          I agree with the first part of this statement, and explained how the underlying foundation can cause this.

                          Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

                          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