Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2001
    Location
    India
    Posts
    25

    Unanswered: Diff Between Select & Set

    Hi,

    I am having a simple question.

    Select @test = 'test'
    Set @test = 'test'

    Can anyone give me the difference between the above
    two statements..

    Selva



  2. #2
    Join Date
    Dec 2001
    Location
    Seattle, WA; USA
    Posts
    9
    Effectively there is no difference. Either will assign the variable a value. Personally, I prefer to use SET whenever I'm just assigning one variable a value and use SELECT when I'm returning a resultset.

  3. #3
    Join Date
    Oct 2001
    Location
    England
    Posts
    426
    not a lot.

    you can only set one variable with set but can set multiple ones with select and have to use a subquery to get a value from a table with set but I think set has less overhead.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •