Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2002
    Posts
    192

    Unanswered: Variables in Cursor

    Is there a way to use variables with cursors?

    ie.

    DECLARE @MyVar as NVARCHAR(1000)
    SET @MyVar = 'USA'

    DECLARE curTest FOR SELECT FROM tblCountry WHERE Country = @MyVar

    Etc...

  2. #2
    Join Date
    Sep 2003
    Location
    New York, NY
    Posts
    136
    it should work the way you've written, are you getting error?

Posting Permissions

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