The subject describes the error I get on the client side. But the server Application Logs says that SQL Exception occurred. The exception Message says: Cannot declare more than 10000 local variables. This is occurring when I try to load a WI type Definition that has a <FIELD> with 559 <WHEN> elements followed by another field with 2190 <WHEN> elements. So far I've tried removing 500 out of the 2190 but obtained the same error messages... Is tehre a limit on the number of <WHEN> elements I can have in a WITD It was working great when I only had the first 559 on the previous field.
Thanks in advance.

WITIMPORT: Cannot complete the operation. An unexpected error occurred.
&#12506;&#12524;&#12452;&#12521;
Are you using one of the pre-release versions of VS I thought I had fixed this bug in the RTM version.
Anyway, the problem occured when the work item type became too big - and was imported as a single piece for the first time (i.e. no upgrade was happening). This resulted in a huge SQL batch that could not be executed alone.
If you see that on the most recent version of VS, the only workaround is to import your work item type in parts - import basic fields/workflow structure first, then add some extra functionality & import that, etc.
Thanks,
Alex
aek
Thank you. I am using the release version of both, TFS and VS2005. Your solution worked, I did loaded the WI incrementally and it went fine. Whcih raises another question: What is the maximum I could do at a time
Thanks!
Matt B
You've found a bug then. I don't know what the limit is; all I can say is that all of XML statements are translated into corresponding SQL sentences, some of which use temporary SQL variables. In most cases we detect this situation and split big batches implicitly; however, it looks like we forgot about something.
I will file a bug about this; if it gets approved, I will investigate this more and will let you know what the actual limit is.
Anyway, the number of conditional statements in your work item type is very high. Can you explain briefly what are you trying to do
Thanks,
Alex