I found this:<div><br></div><div><div>SELECT (select count(*) from QQHeader where PKey&lt;=a.PKey) AS RowNo, a.*</div><div>FROM QQHeader AS a</div><div><br></div><div>from here:</div><div><br></div><div><a href="http://dbaspot.com/forums/sqlserver-server/355698-how-add-identity-column-view.html">http://dbaspot.com/forums/sqlserver-server/355698-how-add-identity-column-view.html</a></div>
<div><br></div><div>Seems to work fine in MapServer, but I don&#39;t know how well it will work in large tables though...</div><div><br></div><div>Roger</div><br><div class="gmail_quote">On Fri, Mar 18, 2011 at 11:41 AM, Roger Bedell <span dir="ltr">&lt;<a href="mailto:sylvanascent@gmail.com">sylvanascent@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi Tamas,<br><br>Ok, well thanks so much for trying! I wonder if we could create unique integer ID with a view - I have no idea if that is possible.<br>
<font color="#888888"><br>Roger</font><div><div></div><div class="h5"><br><br><div class="gmail_quote">On Fri, Mar 18, 2011 at 11:09 AM, Tamas Szekeres <span dir="ltr">&lt;<a href="mailto:szekerest@gmail.com" target="_blank">szekerest@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">Hi Roger,<br><br>I came into the conclusion that supporting the uniqueidentifier is not possible with MapServer because the feature index is stored as int and we cannot convert the guid value to int.<br>

I&#39;ll revert the code to the original behaviour so MapServer will provide an error if the uniqueidentifier is used. For a workaround we could probably create an additional column with identity int or try to use checksum(PKey) instead of PKey in the layer configuration.<br>


<br>Best regards,<br><font color="#888888"><br>Tamas</font><div><div></div><div><br><br><br><br><div class="gmail_quote">2011/3/18 Roger Bedell <span dir="ltr">&lt;<a href="mailto:sylvanascent@gmail.com" target="_blank">sylvanascent@gmail.com</a>&gt;</span><br>

<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">
Hi Tamas,<br>Try this, the UNIQUE is currently oid in the MAP file, and it should work. Change to PKey, and it should bomb.<br><font color="#888888">Roger</font><div><div></div><div><br><br><div class="gmail_quote">
On Thu, Mar 17, 2011 at 11:31 PM, Tamas Szekeres <span dir="ltr">&lt;<a href="mailto:szekerest@gmail.com" target="_blank">szekerest@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">Hmmm. Just tried this and it works for me. Do you have a data/mapfile example to reproduce the problem?<div>




<div></div><div><br><br>Best regards,<br><br>Tamas<br><br><br><br><div class="gmail_quote">2011/3/17 Roger Bedell <span dir="ltr">&lt;<a href="mailto:sylvanascent@gmail.com" target="_blank">sylvanascent@gmail.com</a>&gt;</span><br>





<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">Hi Tamas,<br><br>I get this:<br><br>&quot;Attempted to read or write protected memory. This is often an indication that other memory is corrupt.&quot; when trying to use the UniqueIdentifier field as Unique. Same thing works fine using an integer field as Unique.<br>





<font color="#888888">
<br>Roger</font><div><div></div><div><br><br><div class="gmail_quote">On Thu, Mar 17, 2011 at 9:19 PM, Roger Bedell <span dir="ltr">&lt;<a href="mailto:sylvanascent@gmail.com" target="_blank">sylvanascent@gmail.com</a>&gt;</span> wrote:<br>





<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">
Sorry about that, I understand now. Development is trunk, -stable is fixes to the official release. I do this all the time with GeoServer, so one would think I&#39;d learn.<img goomoji="330" style="margin:0pt 0.2ex;vertical-align:middle" src="cid:330@goomoji.gmail"><br>






<font color="#888888">
<br>Roger</font><div><div></div><div><br><br><div class="gmail_quote">On Thu, Mar 17, 2011 at 9:08 PM, Tamas Szekeres <span dir="ltr">&lt;<a href="mailto:szekerest@gmail.com" target="_blank">szekerest@gmail.com</a>&gt;</span> wrote:<br>






<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">
Hi Roger,<br><br>The package you mention contains the latest &quot;official&quot; release versions of MapServer and GDAL which has been released earlier and doesn&#39;t contain the fix, you should use the -stable branch versions instead.<div>







<div></div><div><br>
<br>Best regards,<br><br>Tamas<br><br><br><br><div class="gmail_quote">2011/3/17 Roger Bedell <span dir="ltr">&lt;<a href="mailto:sylvanascent@gmail.com" target="_blank">sylvanascent@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">








Hi Tamas. I appreciate your help. I tried this one:<br><br><a href="http://vbkto.dyndns.org/sdk/Download.aspx?file=release-1600-gdal-1-8-0-mapserver-5-6-6.zip" target="_blank">http://vbkto.dyndns.org/sdk/Download.aspx?file=release-1600-gdal-1-8-0-mapserver-5-6-6.zip</a><br>









<br>It seemed to me to be the latest stable. It works fine, except the fix for Guid doesn&#39;t seem to be in there.<br><font color="#888888"><br>Roger</font><div><div></div><div><br><br><div class="gmail_quote">
On Thu, Mar 17, 2011 at 5:16 PM, Tamas Szekeres <span dir="ltr">&lt;<a href="mailto:szekerest@gmail.com" target="_blank">szekerest@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">Roger,<br><br>Which package did you try. The -stable branches (ie: <a href="http://vbkto.dyndns.org/sdk/PackageList.aspx?file=release-1600-gdal-1-8-mapserver-5-6.zip" target="_blank">http://vbkto.dyndns.org/sdk/PackageList.aspx?file=release-1600-gdal-1-8-mapserver-5-6.zip</a>) should contain the fix.<br>










<br>Best regards,<br><font color="#888888"><br>Tamas</font><div><div></div><div><br><br><br><br><div class="gmail_quote">2011/3/17 Roger Bedell <span dir="ltr">&lt;<a href="mailto:sylvanascent@gmail.com" target="_blank">sylvanascent@gmail.com</a>&gt;</span><br>









<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">
Hi Tamas,<br>I&#39;m trying to get this working and ran into a couple snags. We are currently using mapscript_csharp.dll version 5.6.5 in a .NET program.<br><br>1) Tried to just copy just the msplugin_mssql2008.dll from your latest build from <a href="http://vbkto.dyndns.org/sdk/" target="_blank">http://vbkto.dyndns.org/sdk/</a> - this didn&#39;t work, must have other dependencies, I didn&#39;t really think it would work.<br>











<br>2) Tried to use the latest build. Strangely, mapscript_csharp.dll doesn&#39;t seem to have the same objects as 5.6.5, and I got a bunch of unresolved references in the code.<br><br>What do you think is the easiest way to get this working?<div>










<br>
<br>Thanks,<br>Roger Bedell<br>Coordinate Solutions Inc.<br><br><br></div><div class="gmail_quote"><div>On Thu, Mar 10, 2011 at 12:56 PM, Tamas Szekeres <span dir="ltr">&lt;<a href="mailto:szekerest@gmail.com" target="_blank">szekerest@gmail.com</a>&gt;</span> wrote:<br>











</div><div><div></div><div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">Hi Roger,<br><br>Could you create a ticket with this issue (<a href="http://trac.osgeo.org/mapserver/newticket" target="_blank">http://trac.osgeo.org/mapserver/newticket</a>)? I&#39;ll take care of fixing this.<br>











<br>Best regards,<br><font color="#888888"><br>
Tamas</font><div><div></div><div><br><br><br><br><div class="gmail_quote">2011/3/10 Roger Bedell <span dir="ltr">&lt;<a href="mailto:sylvanascent@gmail.com" target="_blank">sylvanascent@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">
Thanks Till, however, here is the trace from the ODBC tracer, pretty obvious what is going on:<br><br><span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:Tahoma;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;font-size:medium">          DIAG 
[42000] [Microsoft][ODBC SQL Server Driver][SQL Server]Insufficient 
result space to convert uniqueidentifier value to char. (8170) <br><br>Guids generally take up 36 characters when converted to a string, and the Select statement only has room for 20.<br><br>Since this is a SQL specific query, my guess it is being generated in the sql spatial driver?<br>













<br>Roger<br></span>
<div><span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:Tahoma;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;font-size:medium"><br>













</span></div><br><div><span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:Tahoma;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;font-size:medium">          HSTMT               0x0589B310<br>














          UCHAR *             0x05E1A990 [      -3] &quot;SELECT Feature.STAsBinary(),convert(varchar(20), PKey) from MetesAndBoundsHeader WHERE Feature.STIntersects(Geometry::STGeomFromText(&#39;POLYGON((-104.18599 29.2473266843318,-93.22438 29.2473266843318,-93.22438 41.3707663156682,-104.18599 41.3707663156682,-104.18599 29.2473266843318))&#39;,4326)) = 1 \ 0&quot;<br>














          SDWORD                    -3<br><br>
          DIAG [42000] [Microsoft][ODBC SQL Server Driver][SQL Server]Insufficient result space to convert uniqueidentifier value to char. (8170) </span></div><div><span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:Tahoma;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;font-size:medium"><br>













</span></div>
<br><br><br><br><br><br><div class="gmail_quote">On Thu, Mar 10, 2011 at 12:04 PM, adams <span dir="ltr">&lt;<a href="mailto:adams@terrestris.de" target="_blank">adams@terrestris.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">
















  

<div bgcolor="#ffffff" text="#000000">
Dear Roger,<br>
<br>
if you get an empty image with no error, the first try would be to use
a simple symbol and no expression in your layer. <br>
Also ensure, that your extent when querying the map is correct.<br>
<br>
So you make sure, that everything around your datasource is OK. <br>
<br>
Then use a datastring like this one:<br>
<br>
<br>
DATA &quot;the_geom from (SELECT Feature from MetesAndBoundsHeader) as foo
USING UNIQUE PKey USING SRID=4326&quot;<br>
<br>
or however the geometry-column in mssql server is called ;-)<br>
<br>
Regards, Till<br>
<br>
<br>
<br>
<br>
Roger Bedell wrote:
<blockquote type="cite"><div><div></div><div><div><div></div><div>Good Morning.<br>
I am currently working with MapServer and the MSSQL Spatial driver. I
am seeing that MS does not work with a DATA statement like this in the
Map file:<br>
  <br>
DATA &quot;Feature from MetesAndBoundsHeader USING UNIQUE PKey USING
SRID=4326&quot;<br>
  <br>
where PKey is defined like this:<br>
  <br>
[PKey] [uniqueidentifier] DEFAULT NEWSEQUENTIALID() ROWGUIDCOL NOT NULL,<br>
  <br>
No errors are triggered, however nothing is displayed, including all
other layers. Is this an issue with the SQL Spatial driver or
MapServer? Any ideas on how to fix it?<br>
  <br>
Thanks!<br>
Roger Bedell<br>
Coordinate Solutions Inc.<br>
  </div></div></div></div><pre><hr size="4" width="90%">
_______________________________________________
mapserver-users mailing list
<a href="mailto:mapserver-users@lists.osgeo.org" target="_blank">mapserver-users@lists.osgeo.org</a>
<a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a>
  </pre>
</blockquote>
<br>
<pre cols="72">-- 
 
---------------------------------------------------------
terrestris GmbH &amp; Co. KG
Irmintrudisstrasse 17
53111 Bonn
Germany

Till Adams
Geschäftsführung

Tel: <a href="tel:%2B49%20%280%29228%20%2F%20962%20899-52" target="_blank"></a><a href="tel:%2B49%20%280%29228%20%2F%20962%20899-52" target="_blank"></a><a href="tel:%2B49%20%280%29228%20%2F%20962%20899-52" target="_blank"></a><a href="tel:%2B49%20%280%29228%20%2F%20962%20899-52" target="_blank">+49 (0)228 / 962 899-52</a>
Fax: <a href="tel:%2B49%20%280%29228%20%2F%20962%20899-57" target="_blank"></a><a href="tel:%2B49%20%280%29228%20%2F%20962%20899-57" target="_blank"></a><a href="tel:%2B49%20%280%29228%20%2F%20962%20899-57" target="_blank"></a><a href="tel:%2B49%20%280%29228%20%2F%20962%20899-57" target="_blank">+49 (0)228 / 962 899-57</a>
<a href="mailto:adams@terrestris.de" target="_blank">adams@terrestris.de</a> <a href="http://www.terrestris.de" target="_blank">http://www.terrestris.de</a>
Amtsgericht Bonn, HRA 6835
---------------------------------------------------------

Komplementärin:

terrestris Verwaltungs GmbH

vertreten durch:
Hinrich Paulsen, Till Adams
</pre>
</div>

</blockquote></div><br>
<br>_______________________________________________<br>
mapserver-users mailing list<br>
<a href="mailto:mapserver-users@lists.osgeo.org" target="_blank">mapserver-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
<br></blockquote></div><br><div style="padding:0px;margin-left:0px;margin-top:0px;overflow:hidden;word-wrap:break-word;color:black;font-size:10px;text-align:left;line-height:130%">
</div>
</div></div></blockquote></div></div></div><br>
</blockquote></div><br><div style="padding:0px;margin-left:0px;margin-top:0px;overflow:hidden;word-wrap:break-word;color:black;font-size:10px;text-align:left;line-height:130%">
</div>
</div></div></blockquote></div><br>
</div></div></blockquote></div><br><div style="padding:0px;margin-left:0px;margin-top:0px;overflow:hidden;word-wrap:break-word;color:black;font-size:10px;text-align:left;line-height:130%">
</div>
</div></div></blockquote></div><br>
</div></div></blockquote></div><br>
</div></div></blockquote></div><br><div style="padding:0px;margin-left:0px;margin-top:0px;overflow:hidden;word-wrap:break-word;color:black;font-size:10px;text-align:left;line-height:130%">
</div>
</div></div></blockquote></div><br>
</div></div></blockquote></div><br><div style="padding:0px;margin-left:0px;margin-top:0px;overflow:hidden;word-wrap:break-word;color:black;font-size:10px;text-align:left;line-height:130%">
</div>
</div></div></blockquote></div><br>
</div></div></blockquote></div><br></div>