Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How to parse ( in sql server 2008

Author  Topic 

kalyan.cse05
Yak Posting Veteran

74 Posts

Posted - 2011-04-21 : 02:37:23
Hi,

I have a query and it contais first bracket ("(") and second bracket (")"). Could you tell me how i can parse it

Example :
DECLARE @SQL varchar(1200)
-----
select query formed here
-----
SELECT @SQL = @SQL + ' WHERE Advisory.aBase_UOM <> Material.Base_UOM and (aStatus <> 2) and (aStatus <> 3)'

Exec(@SQL)
Now i get error message that "Incorrect syntax near 'a'."


kalyan Ashis Dey

kalyan.cse05
Yak Posting Veteran

74 Posts

Posted - 2011-04-21 : 02:38:39
This did not create any issue when i was uasing SQL server 2005. Now it creates an issue in SQL server 2008

kalyan Ashis Dey
Go to Top of Page

raghuveer125
Constraint Violating Yak Guru

285 Posts

Posted - 2011-04-21 : 02:50:54
Post some table data

Raghu' S
Go to Top of Page

kalyan.cse05
Yak Posting Veteran

74 Posts

Posted - 2011-04-21 : 02:55:04
WHERE Advisory.aBase_UOM <> Material.Base_UOM and (aStatus <> 2) and (aStatus <> 3)----this is the query that creates issue..this query passed as a sting to the variable @SQL. Now I think it is not able to parse the symbol "(" as well as ")". So please let me know how we can parse these symbols

kalyan Ashis Dey
Go to Top of Page

lionofdezert
Aged Yak Warrior

885 Posts

Posted - 2011-04-21 : 02:57:21
quote:
Originally posted by kalyan.cse05
I have a query and it contais first bracket ("(") and second bracket (")"). Could you tell me how i can parse it
Now i get error message that "Incorrect syntax near 'a'."



Whould you like to share this query, especially the line where this error occuring.

--------------------------
http://connectsql.blogspot.com/
Go to Top of Page

raghuveer125
Constraint Violating Yak Guru

285 Posts

Posted - 2011-04-21 : 03:05:34
Hey we cant read your brain what you need.
Could you post your full query.
If possible post some data also.

Or What your @SQL contain?

Raghu' S
Go to Top of Page
   

- Advertisement -