<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->

<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->




<div class=Section1>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Thank you Jackie.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Can you help me with connection string? Seems like FDO toolbox
missing simple example of connection string for SQL 2008.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Thank you,<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Jackie Ng (via
Nabble) [mailto:<a href="http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2356875&i=0" target="_top" rel="nofollow">ml-user+64137-1002950291@...</a>] <br>
<b>Sent:</b> Thursday, February 19, 2009 5:15 PM<br>
<b>To:</b> Sinelnikov, Andrei<br>
<b>Subject:</b> Re: [fdo-users] SQL 2008. View with JOINS. Not able to select
features on the layer.<o:p></o:p></span></p>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal style='margin-bottom:12.0pt'>Maybe try looking at this data
source through FDO Toolbox (<a href="http://fdotoolbox.googlecode.com" target="_top" rel="nofollow">http://fdotoolbox.googlecode.com</a>), and take a look at the
feature classes, and see if the view (with the join) is structurally different
from the view (without the join). <br>
<br>
For example, I could foresee some problem if the view (without the join) has an
Identity Property and the view (with the join) doesn't. <br>
<br>
- Jackie <o:p></o:p></p>

<div>

<div>

<p class=MsoNormal><b>miansi wrote:<o:p></o:p></b></p>

</div>

<div>

<p class=MsoNormal>Hello, <br>
<br>
Please advise what, where and how should I poke <img border=0 id="_x0000_i1025" src="http://n2.nabble.com/images/smiley/anim_confused.gif"><br>
<br>
Here is the issue: <br>
<br>
I have SQL 2008 table with geospatial data. I created Dataconnection, Layer,
Map and am able to see data from view, which selecting everything from my
geospatial table: <br>
<br>
<b>TABLE:</b><br>
/****** Object: &nbsp;Table [dbo].[Sanit_GM] &nbsp; &nbsp;Script Date:
02/19/2009 16:14:56 ******/ <br>
SET ANSI_NULLS ON <br>
GO <br>
<br>
SET QUOTED_IDENTIFIER ON <br>
GO <br>
<br>
SET ANSI_PADDING ON <br>
GO <br>
<br>
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Sanit_GM]')
AND type in (N'U')) <br>
BEGIN <br>
CREATE TABLE [dbo].[Sanit_GM]( <br>
&nbsp; &nbsp; &nbsp; &nbsp; [GeometryItem] [geometry] NULL, <br>
&nbsp; &nbsp; &nbsp; &nbsp; [GeometryIndex] [int] IDENTITY(1,1) NOT NULL, <br>
&nbsp; &nbsp; &nbsp; &nbsp; [AssetID] [varchar](10) NULL, <br>
&nbsp; &nbsp; &nbsp; &nbsp; [InstallYea] [int] NULL, <br>
&nbsp; &nbsp; &nbsp; &nbsp; [LifeStatus] [varchar](50) NULL, <br>
&nbsp; &nbsp; &nbsp; &nbsp; [LocDesc] [varchar](50) NULL, <br>
&nbsp; &nbsp; &nbsp; &nbsp; [MaterialID] [varchar](50) NULL, <br>
&nbsp; &nbsp; &nbsp; &nbsp; [SpatialKey] [varchar](10) NULL, <br>
&nbsp; &nbsp; &nbsp; &nbsp; [SpatialSta] [varchar](50) NULL, <br>
&nbsp; &nbsp; &nbsp; &nbsp; [AssetType] [varchar](50) NULL, <br>
&nbsp; &nbsp; &nbsp; &nbsp; [Backfill] [varchar](50) NULL, <br>
&nbsp; &nbsp; &nbsp; &nbsp; [BedMat] [varchar](50) NULL, <br>
&nbsp; &nbsp; &nbsp; &nbsp; [Capacity] [decimal](38, 18) NULL, <br>
&nbsp; &nbsp; &nbsp; &nbsp; [Diameter] [int] NULL, <br>
&nbsp; &nbsp; &nbsp; &nbsp; [DoStreamIn] [decimal](38, 18) NULL, <br>
&nbsp; &nbsp; &nbsp; &nbsp; [HasLining] [bit] NULL, <br>
&nbsp; &nbsp; &nbsp; &nbsp; [Height] [int] NULL, <br>
&nbsp; &nbsp; &nbsp; &nbsp; [Length] [decimal](38, 18) NULL, <br>
&nbsp; &nbsp; &nbsp; &nbsp; [LiningYear] [int] NULL, <br>
&nbsp; &nbsp; &nbsp; &nbsp; [LiningLen] [decimal](38, 18) NULL, <br>
&nbsp; &nbsp; &nbsp; &nbsp; [PipeClass] [varchar](50) NULL, <br>
&nbsp; &nbsp; &nbsp; &nbsp; [PipeFunc] [varchar](50) NULL, <br>
&nbsp; &nbsp; &nbsp; &nbsp; [PipeShape] [varchar](50) NULL, <br>
&nbsp; &nbsp; &nbsp; &nbsp; [UpStreamIn] [decimal](38, 18) NULL, <br>
&nbsp; &nbsp; &nbsp; &nbsp; [Width] [varchar](50) NULL, <br>
&nbsp;CONSTRAINT [Sanit_GM_pkey] PRIMARY KEY CLUSTERED <br>
( <br>
&nbsp; &nbsp; &nbsp; &nbsp; [GeometryIndex] ASC <br>
)WITH (PAD_INDEX &nbsp;= OFF, STATISTICS_NORECOMPUTE &nbsp;= OFF,
IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS &nbsp;= ON, ALLOW_PAGE_LOCKS &nbsp;= ON)
ON [PRIMARY] <br>
) ON [PRIMARY] <br>
END <br>
GO <br>
<br>
SET ANSI_PADDING OFF <br>
GO <br>
<br>
IF NOT EXISTS (SELECT * FROM sys.check_constraints WHERE object_id =
OBJECT_ID(N'[dbo].[Sanit_GM_GeometryItem_srid]') AND parent_object_id =
OBJECT_ID(N'[dbo].[Sanit_GM]')) <br>
ALTER TABLE [dbo].[Sanit_GM] &nbsp;WITH CHECK ADD &nbsp;CONSTRAINT
[Sanit_GM_GeometryItem_srid] CHECK &nbsp;(([GeometryItem].[STSrid]=(4269) OR
[GeometryItem] IS NULL)) <br>
GO <br>
<br>
IF &nbsp;EXISTS (SELECT * FROM sys.check_constraints WHERE object_id =
OBJECT_ID(N'[dbo].[Sanit_GM_GeometryItem_srid]') AND parent_object_id =
OBJECT_ID(N'[dbo].[Sanit_GM]')) <br>
ALTER TABLE [dbo].[Sanit_GM] CHECK CONSTRAINT [Sanit_GM_GeometryItem_srid] <br>
GO <br>
<br>
IF NOT EXISTS (SELECT * FROM sys.check_constraints WHERE object_id =
OBJECT_ID(N'[dbo].[Sanit_GM_GeometryItem_type]') AND parent_object_id =
OBJECT_ID(N'[dbo].[Sanit_GM]')) <br>
ALTER TABLE [dbo].[Sanit_GM] &nbsp;WITH CHECK ADD &nbsp;CONSTRAINT
[Sanit_GM_GeometryItem_type] CHECK
&nbsp;(([GeometryItem].[STGeometryType]()='MULTILINESTRING' OR [GeometryItem]
IS NULL)) <br>
GO <br>
<br>
IF &nbsp;EXISTS (SELECT * FROM sys.check_constraints WHERE object_id =
OBJECT_ID(N'[dbo].[Sanit_GM_GeometryItem_type]') AND parent_object_id =
OBJECT_ID(N'[dbo].[Sanit_GM]')) <br>
ALTER TABLE [dbo].[Sanit_GM] CHECK CONSTRAINT [Sanit_GM_GeometryItem_type] <br>
GO <br>
<br>
<br>
<br>
<br>
<b>VIEW:</b><br>
SELECT &nbsp; &nbsp; GeometryItem, GeometryIndex, AssetID, InstallYea,
LifeStatus, LocDesc, MaterialID, SpatialKey, SpatialSta, AssetType, Backfill,
BedMat, Capacity, Diameter, <br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
DoStreamIn, HasLining, Height, Length, LiningYear, LiningLen, PipeClass,
PipeFunc, PipeShape, UpStreamIn, Width <br>
FROM &nbsp; &nbsp; &nbsp; &nbsp; dbo.Sanit_GM AS new <br>
<br>
I am able to see layer pointing to this view. <b>AND</b>&nbsp;I am able to
select features on the map. <br>
<img border=0 id="_x0000_i1026" src="http://n2.nabble.com/file/n2356197/1.Selecting.png"><img border=0 id="_x0000_i1027" src="http://n2.nabble.com/file/n2356197/2.Selected.png"><br>
<br>
If I modify View to include any JOIN I will be able to see layer pointing to
view, <b>BUT</b>&nbsp;would <b>NOT</b>&nbsp;be able to select features on the
map: <br>
<img border=0 id="_x0000_i1028" src="http://n2.nabble.com/file/n2356197/1.Selecting%2B-%2BJOIN.png"><img border=0 id="_x0000_i1029" src="http://n2.nabble.com/file/n2356197/2.Selected%2B-%2BJOIN.png"><br>
<br>
<b>VIEW:</b><br>
SELECT &nbsp; &nbsp; new.GeometryItem, new.GeometryIndex, new.AssetID,
new.InstallYea, new.LifeStatus, new.LocDesc, new.MaterialID, new.SpatialKey,
new.SpatialSta, new.AssetType, <br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
new.Backfill, new.BedMat, new.Capacity, new.Diameter, new.DoStreamIn,
new.HasLining, new.Height, new.Length, new.LiningYear, new.LiningLen,
new.PipeClass, <br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
new.PipeFunc, new.PipeShape, new.UpStreamIn, new.Width <br>
FROM &nbsp; &nbsp; &nbsp; &nbsp; dbo.Sanit_GM AS new INNER JOIN <br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
dbo.Asset AS a ON a.DisplayId = new.AssetID <br>
<br>
<br>
Now, <b>MYSTERY</b>&nbsp;<img border=0 id="_x0000_i1030" src="http://n2.nabble.com/images/smiley/anim_crazy.gif"><br>
<br>
If I will not refresh Dataconnection after adding join to the view - I am still
able to select features on the map. <br>
<br>
Since Map, Layer and FeatureSource XML looks exactly the same in both cases I
wonder what is the difference? What is changing when FDO detects JOIN in view? <br>
Can I override this change? Can I force FDO to ignore it? Is it FDO, which
prevents selection or something else? <br>
<br>
Is this right forum to post? Is this a bug? <br>
<br>
<br>
Thank you, <o:p></o:p></p>

</div>

</div>

<p class=MsoNormal style='margin-bottom:12.0pt'><o:p>&nbsp;</o:p></p>

<div class=MsoNormal align=center style='text-align:center'>

<hr size=1 width="100%" noshade style='color:#CCCCCC' align=center>

</div>

<div>

<p class=MsoNormal><span style='font-size:8.5pt;font-family:"Tahoma","sans-serif";
color:#666666'>This email is a reply to your post @ <a href="http://n2.nabble.com/SQL-2008.-View-with-JOINS.-Not-able-to-select-features-on-the-layer.-tp2356197p2356328.html" target="_top" rel="nofollow">http://n2.nabble.com/SQL-2008.-View-with-JOINS.-Not-able-to-select-features-on-the-layer.-tp2356197p2356328.html</a><br>
You can reply by email or by visting the link above.<o:p></o:p></span></p>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

<p></p><p>----Notice Regarding Confidentiality----<br>This email, including any and all attachments, (this "Email") is intended only for the party to whom it is addressed and may contain information that is confidential or privileged.  Sierra Systems Group Inc. and its affiliates accept no responsibility for any loss or damage suffered by any person resulting from any unauthorized use of or reliance upon this Email.  If you are not the intended recipient, you are hereby notified that any dissemination, copying or other use of this Email is prohibited.  Please notify us of the error in communication by return email and destroy all copies of this Email.  Thank you.



<br><hr align="left" width="300">
View this message in context: <a href="http://n2.nabble.com/SQL-2008.-View-with-JOINS.-Not-able-to-select-features-on-the-layer.-tp2356197p2356875.html">RE: [fdo-users] SQL 2008. View with JOINS. Not able to select features on the layer.</a><br>
Sent from the <a href="http://n2.nabble.com/FDO-Users-f2048584.html">FDO Users mailing list archive</a> at Nabble.com.<br>