Results 1 to 7 of 7
  1. #1
    Join Date
    Feb 2006
    Posts
    3

    Unanswered: MSSQL Mistake (Excercise)

    I have an excercise:

    SET @UserID = @@ROWCOUNT

    it is said that there is mistake, nad to complete it there i no need of knowledge mssql? So where is mistake?

  2. #2
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    @@ROWCOUNT is system variable that returns the number of rows affected by the last sql statement. It is usually used to verify the results of inserts and updates.

    So I do not see how this would return a userid.

    If you want to learn more, I would start here...

    http://www.microsoft.com/downloads/d...displaylang=en
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

  3. #3
    Join Date
    Feb 2006
    Posts
    3
    Quote Originally Posted by Thrasymachus
    @@ROWCOUNT is system variable that returns the number of rows affected by the last sql statement. It is usually used to verify the results of inserts and updates.

    So I do not see how this would return a userid.

    If you want to learn more, I would start here...

    http://www.microsoft.com/downloads/d...displaylang=en
    I know... But how correct it?

  4. #4
    Join Date
    Jan 2006
    Location
    Singapore
    Posts
    47
    if you want the userid use
    select system_user
    -----------------
    KH


  5. #5
    Join Date
    Feb 2006
    Posts
    3
    So it must be
    Select userid
    Set @userid = @@rowcount? :|

  6. #6
    Join Date
    Jan 2006
    Location
    Singapore
    Posts
    47
    should be
    select @userid = system_user
    -----------------
    KH


  7. #7
    Join Date
    Jun 2004
    Posts
    50
    I don't think that you have posted the clearest definition of your problem
    Monk
    The person who confesses ignorance shows it once; the person who conceals it shows it many times.

Posting Permissions

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