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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Database & SysAdmin
  3. Database
  4. declaration of variables

declaration of variables

Scheduled Pinned Locked Moved Database
help
4 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.
  • R Offline
    R Offline
    Ravi Shankar43
    wrote on last edited by
    #1

    iam getting error when setting the value to the variable.

    C M 2 Replies Last reply
    0
    • R Ravi Shankar43

      iam getting error when setting the value to the variable.

      C Offline
      C Offline
      coolestCoder
      wrote on last edited by
      #2

      can you post what you have written along with the error message ?


      "A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder


      coolestCoder

      R 1 Reply Last reply
      0
      • R Ravi Shankar43

        iam getting error when setting the value to the variable.

        M Offline
        M Offline
        Mairaaj Khan
        wrote on last edited by
        #3

        Ravi Shankar43 wrote:

        iam getting error when setting the value to the variable

        Hi, Suppose you have a varchar type variable, named @abc. With T-SQL you can assign value to @abc in two ways. 1- With the SET keyword

        SET @abc='Its varchar typed'

        2- With the SELECT keyword

        SELECT @abc='Its new value'

        However, with the SELECT keyword you can assingn values to multiple variables according to the following syntax. SELECT varialbe1 = value[, variable2 = value, ...]

        ________________________________ Success is not something to wait for, its something to work for.

        1 Reply Last reply
        0
        • C coolestCoder

          can you post what you have written along with the error message ?


          "A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder


          coolestCoder

          R Offline
          R Offline
          Ravi Shankar43
          wrote on last edited by
          #4

          ok i got the solution.i forgot to keep it in single quotes.

          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