RE: A SELECT statement that assigns a value to a variable must not be

From: David Portas (REMOVE_BEFORE_REPLYING_dportas_at_acm.org)
Date: 10/19/04


Date: Tue, 19 Oct 2004 01:45:05 -0700

A SELECT statement may either assign variables or return results but not
both. The SELECT list of your query must include some columns that you
haven't assigned to variables.

You should avoid using cursors whenever you can. Probably you don't need a
cursor to do what you are doing. Have you conidered any alternatives?

-- 
David Portas
SQL Server MVP
--


Relevant Pages

  • Re: SQL 2000, SP3a "TOP 100%"
    ... The best place to use ORDER BY is when you query the view. ... David Portas ... SQL Server MVP ... Prev by Date: ...
    (microsoft.public.sqlserver)
  • Re: Whats wrong ?
    ... Your query is syntactically valid so the problem is in your ... David Portas ... SQL Server MVP ...
    (microsoft.public.sqlserver)
  • Re: sp3 in sql 2000
    ... Thank's 4 ur attention David Portas. ... BEFORE INSTALLED service pack 2/3, this query result: ... > SQL Server MVP ...
    (microsoft.public.sqlserver.server)
  • setting in server sql2000
    ... Thank's 4 ur attention David Portas. ... BEFORE INSTALLED service pack 2/3, this query result: ... > SQL Server MVP ...
    (microsoft.public.sqlserver.server)
  • Re: Adding lines to a table base on a Quanitity
    ... I suspect that's not what you *need*. ... The best starting point when writing a query ... David Portas ... SQL Server MVP ...
    (microsoft.public.sqlserver.programming)