Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Distributed Query in sql 2000
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00574429
Message ID:
00574436
Views:
16
This message has been marked as the solution to the initial question of the thread.
It looks like you have QUOTED_IDENTIFIER set to ON on SQL 2000. In this case you cannot use double quotes for string literal. See 'Delimited Identifiers' in the BOL for details.
IF @PAGE = 'DIR'
  set @mdxstring = 'select * from openquery(BTolap,
    ''select {[fy].[all fy].[' + @fy1 + ']:[' + @fy2 + '] } on columns,
    non empty [DIR].members on rows from testcube'') '.
>Hi,
>
>This piece of code worked in a stored procedure in SQL 7.0 but
>doesnt work in SQL 2000. Could someone help me?
>Thanx,
>Jamuna
>
>IF @PAGE = "DIR"
>set @mdxstring = "
>select * from openquery(BTolap,
>'select {[fy].[all fy].[" + @fy1 + "]:[" + @fy2 + "] } on columns,
>non empty [DIR].members on rows from testcube') ".
>
>The error messages are:
>Server: Msg 207, Level 16, State 3, Procedure SP_test, Line 20
>Invalid column name 'DIR'.
>Server: Msg 207, Level 16, State 1, Procedure SP_test, Line 21
>Invalid column name '
>select * from openquery(BTolap,
>'select {[fy].[all fy].['.
>Server: Msg 207, Level 16, State 1, Procedure SP_test, Line 21
>Invalid column name ']:['.
>Server: Msg 207, Level 16, State 1, Procedure SP_test, Line 21
>Invalid column name '] } on columns,
>non empty [DIR].members on rows from testcube') '.
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform