visual studio .net ide:
This apparent bug has cropped up a few times in the past, but I finally
decided to pursue it this time. I picked up a query from SQL Profiler and
pasted it into a new text file in Visual Studio 2005. I wanted to economize
on screen space a bit, so I wanted to collapse the select list into a single
line. It looked like this originally:
SELECT j1.Id 't36',
j1.ACCDomain 't37',
j1.ACCSelectLevel 't38',
j1.AccessControlList 't41',
j1.GPersonPolTREvent_Restricted 't19',
j1.ACCModifyLevel 't44',
j1.NACLockInformation 't47',
j1.GPersonPolTREvent_Locked 't20',
j1.GPersonPolTREvent_TemplateProperties 't23',
j1.GPersonPolTREvent_ESSigningPerson1SignType 't25',
j1.GPersonPolTREvent_ESSigningPerson2SignType 't27',
j1.CreUser 't54',
j1.CreTime 't58',
j0.Id 't5',
j0.GPersonPolLegalDoc_AppearanceCourtMandatory 't6',
j0.GPPLDAppearanceCourt_Id 't281',
j0.GPPLDAppearanceCourt_Id 't292',
j0.GPPLDAppearanceCourt_Time 't293',
j0.GPPLDAppearanceCourt_TimeOffset 't296',
j0.GPPLDAppearanceCourt_TimeOffsetName 't299',
j0.GPersonPolLegalDoc_IdNumber 't11',
I highlighted the select list portion of the query and attempted to do a
regular expression search and replace. I wanted to replace "\n\t" with " "
to collapse newlines and the subsequent tab characters with a single space.
The result I got was:
SELECT j1.Id 't36', j1.ACCDomain 't37', j1.ACCSelectLevel 't38',
j1.AccessControlList 't41',
j1.GPersonPolTREvent_Restricted 't19',
j1.ACCModifyLevel 't44',
j1.NACLockInformation 't47',
j1.GPersonPolTREvent_Locked 't20',
j1.GPersonPolTREvent_TemplateProperties 't23',
j1.GPersonPolTREvent_ESSigningPerson1SignType 't25',
j1.GPersonPolTREvent_ESSigningPerson2SignType 't27',
j1.CreUser 't54',
1.CreTime 't58',
.Id 't5',
j0.GPersonPolLegalDoc_AppearanceCourtMandatory 't6',
j0.GPPLDAppearanceCourt_Id 't281',
j0.GPPLDAppearanceCourt_Id 't292',
j0.GPPLDAppearanceCourt_Time 't293',
j0.GPPLDAppearanceCourt_TimeOffset 't296',
j0.GPPLDAppearanceCourt_TimeOffsetName 't299',
j0.GPersonPolLegalDoc_IdNumber 't11',
The first couple of lines collapsed correctly, but then there are a bunch of
lines that are not touched at all. About 2/3 of the way through a couple of
lines are bizarrely mutilated, with missing characters (but no newlines
removed). Even stranger, if I hit undo and then re-run the search and
replace, I get different results. It occurred to me that the problem might
have something to do with inconsistent line endings, so I tried saving the
file and using the "Advanced save options" to set the line endings to both
"Windows (CR LF)" and "Unix (LF)". Neither option made any difference.
My question is whether I am doing something wrong here? Is this a known
issue and if so is there is any workaround? If not, is this a bug I should
be reporting through some channel? Does it even happen to anyone else? I
haven't been able to find reports of similar issues elsewhere on the web.