I found this: SELECT (select count(*) from QQHeader where PKey<=a.PKey) AS RowNo, a.* FROM QQHeader AS a
from here: http://dbaspot.com/forums/sqlserver-server/355698-how-add-identity-column-view.html Seems to work fine in MapServer, but I don't know how well it will work in large tables though... Roger On Fri, Mar 18, 2011 at 11:41 AM, Roger Bedell <[email protected]>wrote: > Hi Tamas, > > 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. > > Roger > > > On Fri, Mar 18, 2011 at 11:09 AM, Tamas Szekeres <[email protected]>wrote: > >> Hi Roger, >> >> 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. >> I'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. >> >> Best regards, >> >> Tamas >> >> >> >> >> 2011/3/18 Roger Bedell <[email protected]> >> >>> Hi Tamas, >>> Try this, the UNIQUE is currently oid in the MAP file, and it should >>> work. Change to PKey, and it should bomb. >>> Roger >>> >>> >>> On Thu, Mar 17, 2011 at 11:31 PM, Tamas Szekeres <[email protected]>wrote: >>> >>>> Hmmm. Just tried this and it works for me. Do you have a data/mapfile >>>> example to reproduce the problem? >>>> >>>> >>>> Best regards, >>>> >>>> Tamas >>>> >>>> >>>> >>>> 2011/3/17 Roger Bedell <[email protected]> >>>> >>>>> Hi Tamas, >>>>> >>>>> I get this: >>>>> >>>>> "Attempted to read or write protected memory. This is often an >>>>> indication that other memory is corrupt." when trying to use the >>>>> UniqueIdentifier field as Unique. Same thing works fine using an integer >>>>> field as Unique. >>>>> >>>>> Roger >>>>> >>>>> >>>>> On Thu, Mar 17, 2011 at 9:19 PM, Roger Bedell >>>>> <[email protected]>wrote: >>>>> >>>>>> 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'd learn.[?] >>>>>> >>>>>> Roger >>>>>> >>>>>> >>>>>> On Thu, Mar 17, 2011 at 9:08 PM, Tamas Szekeres >>>>>> <[email protected]>wrote: >>>>>> >>>>>>> Hi Roger, >>>>>>> >>>>>>> The package you mention contains the latest "official" release >>>>>>> versions of MapServer and GDAL which has been released earlier and >>>>>>> doesn't >>>>>>> contain the fix, you should use the -stable branch versions instead. >>>>>>> >>>>>>> >>>>>>> Best regards, >>>>>>> >>>>>>> Tamas >>>>>>> >>>>>>> >>>>>>> >>>>>>> 2011/3/17 Roger Bedell <[email protected]> >>>>>>> >>>>>>>> Hi Tamas. I appreciate your help. I tried this one: >>>>>>>> >>>>>>>> >>>>>>>> http://vbkto.dyndns.org/sdk/Download.aspx?file=release-1600-gdal-1-8-0-mapserver-5-6-6.zip >>>>>>>> >>>>>>>> It seemed to me to be the latest stable. It works fine, except the >>>>>>>> fix for Guid doesn't seem to be in there. >>>>>>>> >>>>>>>> Roger >>>>>>>> >>>>>>>> >>>>>>>> On Thu, Mar 17, 2011 at 5:16 PM, Tamas Szekeres < >>>>>>>> [email protected]> wrote: >>>>>>>> >>>>>>>>> Roger, >>>>>>>>> >>>>>>>>> Which package did you try. The -stable branches (ie: >>>>>>>>> http://vbkto.dyndns.org/sdk/PackageList.aspx?file=release-1600-gdal-1-8-mapserver-5-6.zip) >>>>>>>>> should contain the fix. >>>>>>>>> >>>>>>>>> Best regards, >>>>>>>>> >>>>>>>>> Tamas >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> 2011/3/17 Roger Bedell <[email protected]> >>>>>>>>> >>>>>>>>>> Hi Tamas, >>>>>>>>>> I'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. >>>>>>>>>> >>>>>>>>>> 1) Tried to just copy just the msplugin_mssql2008.dll from your >>>>>>>>>> latest build from http://vbkto.dyndns.org/sdk/ - this didn't >>>>>>>>>> work, must have other dependencies, I didn't really think it would >>>>>>>>>> work. >>>>>>>>>> >>>>>>>>>> 2) Tried to use the latest build. Strangely, mapscript_csharp.dll >>>>>>>>>> doesn't seem to have the same objects as 5.6.5, and I got a bunch of >>>>>>>>>> unresolved references in the code. >>>>>>>>>> >>>>>>>>>> What do you think is the easiest way to get this working? >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> Thanks, >>>>>>>>>> Roger Bedell >>>>>>>>>> Coordinate Solutions Inc. >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> On Thu, Mar 10, 2011 at 12:56 PM, Tamas Szekeres < >>>>>>>>>> [email protected]> wrote: >>>>>>>>>> >>>>>>>>>>> Hi Roger, >>>>>>>>>>> >>>>>>>>>>> Could you create a ticket with this issue ( >>>>>>>>>>> http://trac.osgeo.org/mapserver/newticket)? I'll take care of >>>>>>>>>>> fixing this. >>>>>>>>>>> >>>>>>>>>>> Best regards, >>>>>>>>>>> >>>>>>>>>>> Tamas >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> 2011/3/10 Roger Bedell <[email protected]> >>>>>>>>>>> >>>>>>>>>>>> Thanks Till, however, here is the trace from the ODBC tracer, >>>>>>>>>>>> pretty obvious what is going on: >>>>>>>>>>>> >>>>>>>>>>>> DIAG [42000] [Microsoft][ODBC SQL Server Driver][SQL >>>>>>>>>>>> Server]Insufficient result space to convert uniqueidentifier value >>>>>>>>>>>> to char. >>>>>>>>>>>> (8170) >>>>>>>>>>>> >>>>>>>>>>>> Guids generally take up 36 characters when converted to a >>>>>>>>>>>> string, and the Select statement only has room for 20. >>>>>>>>>>>> >>>>>>>>>>>> Since this is a SQL specific query, my guess it is being >>>>>>>>>>>> generated in the sql spatial driver? >>>>>>>>>>>> >>>>>>>>>>>> Roger >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> HSTMT 0x0589B310 >>>>>>>>>>>> UCHAR * 0x05E1A990 [ -3] "SELECT >>>>>>>>>>>> Feature.STAsBinary(),convert(varchar(20), PKey) from >>>>>>>>>>>> MetesAndBoundsHeader >>>>>>>>>>>> WHERE >>>>>>>>>>>> Feature.STIntersects(Geometry::STGeomFromText('POLYGON((-104.18599 >>>>>>>>>>>> 29.2473266843318,-93.22438 29.2473266843318,-93.22438 >>>>>>>>>>>> 41.3707663156682,-104.18599 41.3707663156682,-104.18599 >>>>>>>>>>>> 29.2473266843318))',4326)) = 1 \ 0" >>>>>>>>>>>> SDWORD -3 >>>>>>>>>>>> >>>>>>>>>>>> DIAG [42000] [Microsoft][ODBC SQL Server Driver][SQL >>>>>>>>>>>> Server]Insufficient result space to convert uniqueidentifier value >>>>>>>>>>>> to char. >>>>>>>>>>>> (8170) >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> On Thu, Mar 10, 2011 at 12:04 PM, adams <[email protected]>wrote: >>>>>>>>>>>> >>>>>>>>>>>>> Dear Roger, >>>>>>>>>>>>> >>>>>>>>>>>>> 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. >>>>>>>>>>>>> Also ensure, that your extent when querying the map is correct. >>>>>>>>>>>>> >>>>>>>>>>>>> So you make sure, that everything around your datasource is OK. >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> Then use a datastring like this one: >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> DATA "the_geom from (SELECT Feature from MetesAndBoundsHeader) >>>>>>>>>>>>> as foo USING UNIQUE PKey USING SRID=4326" >>>>>>>>>>>>> >>>>>>>>>>>>> or however the geometry-column in mssql server is called ;-) >>>>>>>>>>>>> >>>>>>>>>>>>> Regards, Till >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> Roger Bedell wrote: >>>>>>>>>>>>> >>>>>>>>>>>>> Good Morning. >>>>>>>>>>>>> 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: >>>>>>>>>>>>> >>>>>>>>>>>>> DATA "Feature from MetesAndBoundsHeader USING UNIQUE PKey USING >>>>>>>>>>>>> SRID=4326" >>>>>>>>>>>>> >>>>>>>>>>>>> where PKey is defined like this: >>>>>>>>>>>>> >>>>>>>>>>>>> [PKey] [uniqueidentifier] DEFAULT NEWSEQUENTIALID() ROWGUIDCOL >>>>>>>>>>>>> NOT NULL, >>>>>>>>>>>>> >>>>>>>>>>>>> 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? >>>>>>>>>>>>> >>>>>>>>>>>>> Thanks! >>>>>>>>>>>>> Roger Bedell >>>>>>>>>>>>> Coordinate Solutions Inc. >>>>>>>>>>>>> >>>>>>>>>>>>> ------------------------------ >>>>>>>>>>>>> >>>>>>>>>>>>> _______________________________________________ >>>>>>>>>>>>> mapserver-users mailing >>>>>>>>>>>>> [email protected]http://lists.osgeo.org/mailman/listinfo/mapserver-users >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> -- >>>>>>>>>>>>> >>>>>>>>>>>>> --------------------------------------------------------- >>>>>>>>>>>>> terrestris GmbH & Co. KG >>>>>>>>>>>>> Irmintrudisstrasse 17 >>>>>>>>>>>>> 53111 Bonn >>>>>>>>>>>>> Germany >>>>>>>>>>>>> >>>>>>>>>>>>> Till Adams >>>>>>>>>>>>> Geschäftsführung >>>>>>>>>>>>> >>>>>>>>>>>>> Tel: <%2B49%20%280%29228%20%2F%20962%20899-52> >>>>>>>>>>>>> <%2B49%20%280%29228%20%2F%20962%20899-52> >>>>>>>>>>>>> <%2B49%20%280%29228%20%2F%20962%20899-52>+49 (0)228 / 962 899-52 >>>>>>>>>>>>> Fax: <%2B49%20%280%29228%20%2F%20962%20899-57> >>>>>>>>>>>>> <%2B49%20%280%29228%20%2F%20962%20899-57> >>>>>>>>>>>>> <%2B49%20%280%29228%20%2F%20962%20899-57>+49 (0)228 / 962 >>>>>>>>>>>>> [email protected] http://www.terrestris.de >>>>>>>>>>>>> Amtsgericht Bonn, HRA 6835 >>>>>>>>>>>>> --------------------------------------------------------- >>>>>>>>>>>>> >>>>>>>>>>>>> Komplementärin: >>>>>>>>>>>>> >>>>>>>>>>>>> terrestris Verwaltungs GmbH >>>>>>>>>>>>> >>>>>>>>>>>>> vertreten durch: >>>>>>>>>>>>> Hinrich Paulsen, Till Adams >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> _______________________________________________ >>>>>>>>>>>> mapserver-users mailing list >>>>>>>>>>>> [email protected] >>>>>>>>>>>> http://lists.osgeo.org/mailman/listinfo/mapserver-users >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>> >>>>>> >>>>> >>>> >>> >> >
<<330.gif>>
_______________________________________________ mapserver-users mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/mapserver-users
