Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Macro substitution
Message
From
09/05/2002 13:39:24
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Macro substitution
Miscellaneous
Thread ID:
00654639
Message ID:
00654639
Views:
81
What is the equivalent of VFP's macro substitution in a SQL Server stored procedure?

I want to pass a parameter to a stored procedure and use this parameter to order a SELECT statement. If I pass the name of a field to the parameter @cOrder and add

ORDER BY @cOrder

to the SELECT statement I get Error 1008:

The SELECT item identified by the ORDER BY number 1 contains a variable as part of the expression identifying a column position. Variables are only allowed when ordering by an expression referencing a column name.

Thanks in advance.
Next
Reply
Map
View

Click here to load this message in the networking platform