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. Must Declare Scalar variable

Must Declare Scalar variable

Scheduled Pinned Locked Moved Database
sharepointdatabasesysadminhelp
12 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.
  • A Offline
    A Offline
    Ali Al Omairi Abu AlHassan
    wrote on last edited by
    #1

    Hey guys, i have wroted some sp's on some server and they used to work well on that server. then i took a backup of the database and restored it on another server so when i tried to run my sp's i got the exception "Must Declare Scalar Variable". for instance:

    Declare @BankName int;
    Set @bankname = 1;

    Results in: Must Declare Scalar Variable @bankname. any help. thank you.

    M 1 Reply Last reply
    0
    • A Ali Al Omairi Abu AlHassan

      Hey guys, i have wroted some sp's on some server and they used to work well on that server. then i took a backup of the database and restored it on another server so when i tried to run my sp's i got the exception "Must Declare Scalar Variable". for instance:

      Declare @BankName int;
      Set @bankname = 1;

      Results in: Must Declare Scalar Variable @bankname. any help. thank you.

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

      The SQL Server instance you restored to is set to case sensitive, therefore the you have not declared @bankname

      Never underestimate the power of human stupidity RAH

      A 1 Reply Last reply
      0
      • M Mycroft Holmes

        The SQL Server instance you restored to is set to case sensitive, therefore the you have not declared @bankname

        Never underestimate the power of human stupidity RAH

        A Offline
        A Offline
        Ali Al Omairi Abu AlHassan
        wrote on last edited by
        #3

        ok Sir, i understand that but i want a solution.

        M 1 Reply Last reply
        0
        • A Ali Al Omairi Abu AlHassan

          ok Sir, i understand that but i want a solution.

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

          So think about what I said, your sql server settings need to be changed, go find the setting and change it. Note depending on what database you have installed you may need to reinstall the sql server instance to change that setting. I suggest you prove that I have identified the problem first!

          Never underestimate the power of human stupidity RAH

          A 1 Reply Last reply
          0
          • M Mycroft Holmes

            So think about what I said, your sql server settings need to be changed, go find the setting and change it. Note depending on what database you have installed you may need to reinstall the sql server instance to change that setting. I suggest you prove that I have identified the problem first!

            Never underestimate the power of human stupidity RAH

            A Offline
            A Offline
            Ali Al Omairi Abu AlHassan
            wrote on last edited by
            #5

            yes sir you have identified the problem. My Database is MS SQL 2005 Developer Edition. when I installed it in "Collation Sitting" step of the wisard i checed "Case - sensitive" checkbox.

            M 1 Reply Last reply
            0
            • A Ali Al Omairi Abu AlHassan

              yes sir you have identified the problem. My Database is MS SQL 2005 Developer Edition. when I installed it in "Collation Sitting" step of the wisard i checed "Case - sensitive" checkbox.

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

              I think with 2005 you need to reinstall the instance, you may want to look into changing the collation settings but I don't think you can change the case setting.

              Never underestimate the power of human stupidity RAH

              A 2 Replies Last reply
              0
              • M Mycroft Holmes

                I think with 2005 you need to reinstall the instance, you may want to look into changing the collation settings but I don't think you can change the case setting.

                Never underestimate the power of human stupidity RAH

                A Offline
                A Offline
                Ali Al Omairi Abu AlHassan
                wrote on last edited by
                #7

                Thank you, Sir. 100 :rose:

                H 1 Reply Last reply
                0
                • A Ali Al Omairi Abu AlHassan

                  Thank you, Sir. 100 :rose:

                  H Offline
                  H Offline
                  Hiren solanki
                  wrote on last edited by
                  #8

                  Ali Al Omairi wrote:

                  100

                  What it mean it's a virtual points to Mycroft or bless of 100 year to live.:~

                  Regards, Hiren. be good(Help people in CP),do good(Vote if one finds helpful) all will happen good, In case happens bad(You are getting downvote for your best try to help OP) it will be good for later after(Countered with more points by humble member). - Gita sar in context of CP. -So Guys don't care about downvote believe in you.

                  A 1 Reply Last reply
                  0
                  • H Hiren solanki

                    Ali Al Omairi wrote:

                    100

                    What it mean it's a virtual points to Mycroft or bless of 100 year to live.:~

                    Regards, Hiren. be good(Help people in CP),do good(Vote if one finds helpful) all will happen good, In case happens bad(You are getting downvote for your best try to help OP) it will be good for later after(Countered with more points by humble member). - Gita sar in context of CP. -So Guys don't care about downvote believe in you.

                    A Offline
                    A Offline
                    Ali Al Omairi Abu AlHassan
                    wrote on last edited by
                    #9

                    Sir, In Jordan we use the expression "A hundred of flowers" often to say that every thing is ok. we also use it to thank people and to say hi to them.

                    R H 2 Replies Last reply
                    0
                    • A Ali Al Omairi Abu AlHassan

                      Sir, In Jordan we use the expression "A hundred of flowers" often to say that every thing is ok. we also use it to thank people and to say hi to them.

                      R Offline
                      R Offline
                      Roger Wright
                      wrote on last edited by
                      #10

                      Interesting cultural tidbit, Ali. I never know what I'm going to learn when I stop by CodeProject. :-D

                      Will Rogers never met me.

                      1 Reply Last reply
                      0
                      • A Ali Al Omairi Abu AlHassan

                        Sir, In Jordan we use the expression "A hundred of flowers" often to say that every thing is ok. we also use it to thank people and to say hi to them.

                        H Offline
                        H Offline
                        Hiren solanki
                        wrote on last edited by
                        #11

                        That's good to know, Ali. Thanks 100 :rose: to you too for that.

                        Regards, Hiren. -"I don't know, I don't care, and it doesn't make any difference".

                        1 Reply Last reply
                        0
                        • M Mycroft Holmes

                          I think with 2005 you need to reinstall the instance, you may want to look into changing the collation settings but I don't think you can change the case setting.

                          Never underestimate the power of human stupidity RAH

                          A Offline
                          A Offline
                          Ali Al Omairi Abu AlHassan
                          wrote on last edited by
                          #12

                          Sir, Since you told me so i was trying to reinstall the software but i had some problem with some components 1- MSXML6 2- SQL Server Database Services what can be the reson

                          Call me "Abu AlHassan", Please.

                          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