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 can i change name of variable ?

How can i change name of variable ?

Scheduled Pinned Locked Moved Database
questionhelp
3 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.
  • T Offline
    T Offline
    TALHAKOSEN
    wrote on last edited by
    #1

    Hi all, I want to learn that, can i change name of variable, i mean i wanna have @s1, @s2, @s3 ... @s20 but i dont wanna write it wanna use WHILE X<20 BEGIN DECLARE @SX X=X+1; END CAN I DO THAT pls help

    Sampiyon FENERBAHCE

    A W 2 Replies Last reply
    0
    • T TALHAKOSEN

      Hi all, I want to learn that, can i change name of variable, i mean i wanna have @s1, @s2, @s3 ... @s20 but i dont wanna write it wanna use WHILE X<20 BEGIN DECLARE @SX X=X+1; END CAN I DO THAT pls help

      Sampiyon FENERBAHCE

      A Offline
      A Offline
      Ashfield
      wrote on last edited by
      #2

      Can't be done.

      Bob Ashfield Consultants Ltd

      1 Reply Last reply
      0
      • T TALHAKOSEN

        Hi all, I want to learn that, can i change name of variable, i mean i wanna have @s1, @s2, @s3 ... @s20 but i dont wanna write it wanna use WHILE X<20 BEGIN DECLARE @SX X=X+1; END CAN I DO THAT pls help

        Sampiyon FENERBAHCE

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

        When using SQL as the way you described, no. However, if you use dynamic SQL, meaning you create a string that contains the SQL statement and execute it, this can be done.

        The need to optimize rises from a bad design

        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