No Intellisense when an XML variable exists
melance
Posts: 4
When an xml variable exists and has xml assigned to it, intellisense no longer works. For example:
DECLARE @xmlData XML = ' <Root> <Value> <Id>1</Id> <SubValue> <Value>A</Value> </SubValue> <SubValue> <Value>B</Value> </SubValue> </Value> <Value> <Id>2</Id> <SubValue> <Value>C</Value> </SubValue> <SubValue> <Value>D</Value> </SubValue> </Value> </Root>' DECLARE @table TABLE ([Id] INT,[SubValues] XML) INSERT @table SELECT r.v.value('Id[1]','INT'), r.v.query('SubValue') FROM @xmlData.nodes('//Root/Value') AS r(v) SELECT [Id], [SubValues] FROM @table
Comments
I'm having difficulty recreating this on the current 6.3 beta.
eg. If I continue with your select statement and type where: I get a popup with the SubValues and Id columns listed, is this not the case for you?
I just retried the example I gave and it appears to work correctly. The code I am actually working with is a lot more complicated and doesn't work:
Thank you,
Lance
Thank you for the script, I can recreate your issue here. It looks like the problem is that Prompt isn't "looking back" far enough to cover the xml string, a work around for now is to change the ParserLookBackDistance to a larger value as described here.
The restriction is there for performance reasons but we are currently investigating a better solution, I'll keep you updated if we get a new build out with this look back removed.
Thanks,
Aaron.
Thank you, that was the solution.
Lance