November 20, 2015 at 2:01 am
Hi All,
Need help with regards to querying AD, i have created a linked server to AD but the AD name e.g ad-domain. So in my query i've used [ ] brackets but still it errors
Msg 102, Level 15, State 1, Line 19
Incorrect syntax near '-'.
Any idea
Thanks
It's better to fail while trying, rather than fail without trying!!!
November 20, 2015 at 2:07 am
Not without seeing the full query, but sounds like you have a syntax error near - on line 19
November 20, 2015 at 3:58 am
Apologies missed the script attachment
It's better to fail while trying, rather than fail without trying!!!
November 20, 2015 at 4:07 am
Looks ok to me, not a case of missing [] around msRTCSIP-PrimaryUserAddress in the OPENQUERY is it?
November 20, 2015 at 4:23 am
That's a good catch, Anthony. In case it isn't that, I'd be tempted to write it out longhand, 26 times, just to avoid all those confounded quotation marks. You can save the data arithmetic to the end to make it more efficient and the code more concise.
John
November 20, 2015 at 5:03 am
Thanks sorted
It's better to fail while trying, rather than fail without trying!!!
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply