SSRS - SQL Server Spatial Query

Hi, I was hoping someone could help me.
I'm creating an SSRS report with Map and importing points via SQL Server Spatial query. I have a db table with 8,000 points bu the import only ever brings in the first 2,000 queried (no matter what the filter is). Is there a limitation in SSRS that can be
changed via a configuration setting?
Many thanks in advance for any help on this,
Steve.

Really appreciate you coming back so quick Olaf.
No its a straightforward query (select AccountNum, Name, Address, Longitude, Lattitude, UrbanArea, County, MI_STYLE, MI_PRINX, SP_GEOMETRY from <table>)
Just to give the whole picture. I had 8,000 points in MapInfo version 10. I imported them to SQL Server 2012 via MapInfo Easy Loader.
The SQL Server spatial points import to SSRS and the Bing overlay map works great (so they import to correct space) but its only a subset of the points that import. I can pick any subset using the WHERE clause but I cannot get all 8,000 points.  
I was hoping there was a configuration setting somewhere in SSRS that was causing the problem.

Similar Messages

  • Error [hyt00] [microsoft][odbc sql server driver] query timeout expired

    I have the below network setup:-
    1. Its a simple network at my father's office at a small town called Ichalkaranji (District - Kolhapur, Maharashtra).
    2. We are using private network range 192.168.1.xxx with two Windows Server 2003 Enterprise Edition with SP2 licensed copies and 15 local Windows 7 clients who are only using Server A.
    3. The network is having a TP-Link Braodband Router Connected to internet with the IP 192.168.1.1.
    4. Both there Windows Server 2003 Enterprise Edition with SP2 are running separate SQL Server 2005 Express with Advanced Services, you can treat them as Server A (Problematic Server with IP of 192.168.1.2) 
    and Server B (this is not having any issue with IP of 192.168.1.3).
    5. Server A is also being used by 6 Remote users from our Kolkata office using DDNS facility through the NO IP client software which installed separately on both the servers. Kolkata remote users
    do not use OR access the Server B.
    6. Server B is being used by only 2 Remote users from our Erode office (Under Salem District, Tamilnadu) using DDNS facility through the NO IP client software which installed separately on both
    the servers. Erode remote users do not use OR access the Server A.
    7. The front end application which running separately on both the servers have been developed in VB by a local vendor at Ichalkaranji (District - Kolhapur, Maharashtra).
    8. Both Servers are having the same database structure in terms of design and tables format. Only difference is that both the servers are being used separately.
    9. This error OR problem is only related to Server A, where on the clients we get the message "error [hyt00] [microsoft][odbc sql server driver] query timeout expired" every now and then.
    10. We have to frequently reboot the server whenever we get this message on the client machines. May be after rebooting every thing works perfectly for 2 hours / 5 Hours / may be one full day but
    the the error will come back for sure.
    11. Current Database back up size on Server A is around 35 GB and take around 1 hour 15 minutes daily to take the back up.
    12. Current Database back up size on Server B is around 3 GB and take around 5 to 10 minutes daily to take the back up.
    13. One thing I have noticed is that when ever we reboot Server A, for some time sqlsrvr.exe file will show memory usage of 200 to 300 MBs but it will start using slowly, what i understand is that
    this is the way SQL Server works.
    14. Both the Servers are also running Quick heal Antivirus Server Edition separate licensed copies also.
    15. Server B is also running Tally ERP 9 Licenses copy which is being used locally by 15 users of Ichalkaranji (District - Kolhapur, Maharashtra) same users
    Can any one help to resolve this issue. Any help will be highly appreciated.

    The error message "query timeout expired" occurs, because by default many APIs, including ODBC only waits for 30 seconds for SQL Server to send any output. If no data has been seen for this period of time, they tell SQL Server to cancel execution
    and return this error to the caller.
    This timeout could be seen as a token that the query is taking too long time to execute and this needs to be fixed. But it can also be a pain in the rear parts, if you are content with a report taking five minutes, because you only run it once a day.
    The simplest way to get rid of the error is to set the timeout to zero, which means "wait forever". This is something your vendor would have to do. This may, however, not resolve the problem, as the users may just find that the application is hanging.
    To wit, there are two reasons why the query takes more than 30 seconds to complete. One is that there is simply that much work to do. This can be reduced by adding indexes or by doing other tuning, if the execution time is not acceptable. The other possibility
    is blocking. That is, there is a process blocking this query from completing. This is much more likely to require attention.
    It is not clear to me, whether the vendor has developed the database part as well. In this case, you should probably call the vendor's support desk to have them to sort this out.
    Finally, I am little puzzled. You say that you are using Express Edition, but one of the databases is 35 GB in size. 35 GB is far above the limit for Express Edition.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • How to convert SQL Server hierarchical query (CTE) to Oracle?

    How to convert SQL Server hierarchical query (CTE) to Oracle?
    WITH cte (col1, col2) AS
    SELECT col1, col2
    FROM dbo.[tb1]
    WHERE col1 = 12
    UNION ALL
    SELECT c.col1, c.col2
    FROM dbo.[tb1] AS c INNER JOIN cte AS p ON c.col2 = p.col1
    DELETE a
    FROM dbo.[tb1] AS a INNER JOIN cte AS b
    ON a.col1 = b.col1

    See: http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_10002.htm#i2129904
    Ah, just spotted it's a delete statement - you won't be able to do it using subquery factoring in Oracle.
    I had a go at trying to convert for you, but notice that you reference the cte from inside the cte... I can only assume you have a table called cte too...
    DELETE FROM dbo.tb1
    WHERE col1 = 12
    OR col2 IN (SELECT col1 FROM cte)
    Edited by: Boneist on 22-Jun-2009 09:19

  • Copy and Paste from SQL server to Query Generator eliminate spaces

    Hi:
    My query is run perfectly on SQL server.
    However, when I copied it to Query Generator in SAP B1, it can not be run. When I look closely I see that some spaces have been truncated for example between the fieldname and key words like FROM, LEFT OUTER JOIN. I have to then going through the Query Generator in SAP B1 to put in the spaces in appropriate places. This process took long time and require very close attention and did not make any sense to me, since my query already work in SQL server query manager.
    Is there any way that we can make Query Generator in SAP B1 keeping the same format (ie. not eliminate the spaces) as in SQL server Query Manager?
    Best Regards,
    Phong Nguyen.

    Here is what I mean:
    SELECT YEAR(T1.DocDate) YEAR_NO, DATEPART(wk,T1.DocDate) WEEK_NO,SUM(T1.LineTotal) TotalShrinkage_Sales, (SUM(T1.LineTotal)/SUM(T1.Total_Sales)) Percent_Shrinkage, SUM(T1.Total_Sales) Total_Sales,COUNT(DISTINCT T1.Shrinkage_No) Shrinkage_Volume, SUM(T1.TotalCost) TotalShrinkage_CostFROM (SELECT V0.ITEMCODE, V0.DocEntry Shrinkage_No, V0.DocDate, V0.LineTotal, 0 Total_Sales,  V0.TotalCostFROM dbo.V_SHRINKAGE_TOTAL V0 WHERE V0.TransType='Shrinkage'UNION ALLSELECT V1.ITEMCODE, null Shrinkage_No, V1.DocDate, 0 LineTotal, V1.LineTotal Total_Sales, 0 TotalCostFROM dbo.V_Sales_Invoice V1UNION ALLSELECT V2.ITEMCODE, null Shrinkage_No, V2.DocDate,0 LineTotal, V2.LineTotal Total_Sales, 0 TotalCost FROM dbo.V_Credit_Note V2) T1WHERE DATEDIFF(wk,T1.DocDate,getdate())<=12GROUP BY YEAR(T1.DocDate), DATEPART(wk,T1.DocDate)ORDER BY YEAR(T1.DocDate) ASC,DATEPART(wk,T1.DocDate) ASC
    You can see the the third line (top down) the space between the field TotalShrinkage_Cost and FROM has been eliminated.
    Also you can see that on the 4th line (top down) the space between the field  V0.TotalCost and FROM has been eliminated.
    Also in the 5th line (top down) you can see: V0.TransType='Shrinkage'UNION ALLSELECT --- spaces have been eliminated between 'Shrinkage" and UNION and ALL and SELECT
    The list can go on.
    Can you help there?
    Thanks,
    Phong Nguyen.

  • SQL Server TG Query Optimization

    We are using Oracle Transparent Gateway 9.0.1.1.1 to connect an Oracle (Windows 2000) 9.1.7.4.0 database to a SQl Server 2000 SP2 database.
    When we use two simple queries to retrieve information from the gateway, the data is returned with a response time of less than 100 milliseconds. When we combine these queries into a single query, data is returned with a response time of over 20 seconds.
    QUESTION: Is there any documentation as to the "Do's" and "Don'ts" of querying across the TG for best response times? Anything concerning joining Oracle and SQL Server tables in particular would be appreciated.
    Scott Allen
    [email protected]

    Scott,
    The gateway does not create any type of locks. Could you provide the sql statements in your session. Also take a look at the trace generated by the SQL Server profiler

  • MS SQL Server Architecture (Query Processing)

     Explain Sql server Architecture for Select statement diagrammatically ?
     Explain Sql server Architecture for Insert , update statements  diagrammatically ?
    bhagee

    Hi,
    to me, we have to completely read SQL Server Internals book to understanding internals of DMLs. so many internal compoents, layers works starting from pressing F5 at client location till we get the result in results pane.
    Below link has high level info about SELECT
    http://www.sqlservercentral.com/blogs/livingforsqlserver/2010/12/05/what-happens-when-a-query-is-submitted/
    internals of SELECT
    http://rusanu.com/2013/08/01/understanding-how-sql-server-executes-a-query/
    Internals of INSERT
    http://www.sqlservercentral.com/blogs/livingforsqlserver/2012/11/26/time-pass-with-transaction-log-part-4-ddl/
    http://www.sqlservercentral.com/blogs/livingforsqlserver/2012/11/27/time-pass-with-transaction-log-part-5-insert/
    hope you would find this useful.
    Ramkumar Gopal Living For SQL Server Blog: http://www.sqlservercentral.com/blogs/livingforsqlserver/ Facebook: https://www.facebook.com/#!/groups/livingforsqlserver/ Twitter: https://twitter.com/LivingForSQL

  • How to get hardware related metrics of SQL Server through query ?

    Hi Folks,
                   I am newbie to the SQL Server programming. I also follow this forum only now. I am not sure if these kind of question had been asked in the past. Let me furnish you more detail about my query. I do like
    to get few details regarding the SQL server. I do need the following details to get the information about it through query
    SQL Server Installation directory
    No. Of CPU(as i read SQL Server standard support 4 cpu and Enterprise support 32 CPU)
    CPU Speed of the SQL Server installed machine
    Disk Storage details
    Operating system on which the SQL Server is installed
    Location of the swap file of SQL Server
    TempDB directory path
    System database directory path
    User database location 
    Log files location
    I do like to get information like this through query. Can i know if such information can be get through query or it should be get only thro' WMI. Please drop your ideas in getting these details.
    Thanks in Advance,
    Regards,
    JeiSurya

    Try this query in the below link 
    http://gallery.technet.microsoft.com/Query-to-find-all-the-8fa765e6
    you will get the SQL Server and H/W Details like 
    IP Address 
    FQDN 
    CurrentSQLNodeName 
    SQL Instance Name 
    SQL Server Product
    SQL Server Edition 
    Service Pack 
    SQL Server Version 
    Operating System
    OS SP Level
    OS Build Number
    SystemManufacturer 
    Processor Type 
    System Model 
    Total RAM in MB 
    NumberOfPhysicalCPUs 
    NumberOfCoresInEachCPU 
    TotalNumberOfCores 
    NumberOfLogicalCPUs

  • SQL Server Licensing Query

    Hi Team ,
    I have some queries for MS SQL server , can you please clarify the below points :
    Can I buy licenses for SQL 2008 R2 or do I need to buy license for MSSQL server 2012 license and then downgrade it?
    Would there be any additional cost for downgrade ?
    If I want to buy license for MSSQL 2008 ,would it be “per processor “ or “per core” for Virtualization i.e. which of the two licensing policies will apply.
    Please clarify on this.relevant microsoft oem docs/links would be really helpful
    Thanks

    Hi Team ,
    I have some queries for MS SQL server , can you please clarify the below points :
    Can I buy licenses for SQL 2008 R2 or do I need to buy license for MSSQL server 2012 license and then downgrade it?
    Would there be any additional cost for downgrade ?
    If I want to buy license for MSSQL 2008 ,would it be “per processor “ or “per core” for Virtualization i.e. which of the two licensing policies will apply.
    1. You can buy license for 2008 R2, if your requirement is 2008 R2 dont buy 2012 its costly.. You dont need to buy 2012 license and downgrade it.I am not sure whether it is possible or not licensing expert will be in better position to answer this question.
    2.Licensing expert can tell better.
    3.Licensing expert can tell better. Please use information provided by Kalman.But i still suggest you to go for 2008 R2 IF that suits your requirement
    PS: This is technical forum, Licensing question must be directed to licensing expert
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers
    My TechNet Wiki Articles

  • How to fetch presence in Lync 2013 from SQL server (using query)

    We are running Lync 2013 setup with 5 FE and 2 BE SQL (mirrored) servers.
    How can i get presence information for our users by script or SQL queries?
    My Concern is to fetch out current presence information of a list of users (CSV file) by script (Powershell or SQL query) for automation purpose. So that one need not to go to Lync 2013 (or anything) Client for every single user, to check their corresponding
    presence.
    E.g Say a service desk agent is handling tickets of 200 users per day. So it will be time consuming for him/her to go to Lync 2013 client and check presence for every user. It would be better for SD agent to operate, if we could make a script to fetch presence
    status for the list of 200 users.
    We will fetch the information when required and send a mail to him/her.
    i have asked this question under Presence and IM forum.
    https://social.technet.microsoft.com/Forums/en-US/ef6287d1-e474-48ab-a411-f3813d256145/how-to-fetch-presence-information-in-lync-2013?forum=lyncprofile
    been suggested to post it here.

    Create a Store procedure which will give you integer value according to presence status:
    USE [rtc]
    GO
    /****** Object:  StoredProcedure [dbo].[GetAvailability]    Script Date: 05/01/2015 10:36:35 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    -- =============================================
    -- Author:  <sudipta samanta>
    -- Create date: <02.01.2015>
    -- Description: <fetch presence information of user>
    -- =============================================
    CREATE PROCEDURE [dbo].[GetAvailability]
    @_Publisher varchar(50)
    AS
    DECLARE
    @agrregate_state varchar(500),
    @availability varchar(50),
    @index_first int,
    @index_last int,
    @index int
    BEGIN
    SET NoCount ON
    set @agrregate_state = (select top 1 Data from dbo.DiagPublisherDataView(@_Publisher) order by LastPubTime desc);
    set @index_first = (select CHARINDEX('<availability>',@agrregate_state));
    set @index_last = (select CHARINDEX('</availability>',@agrregate_state));
    set @index = @index_first + 14;
    set @availability = (SUBSTRING(@agrregate_state,@index,@index_last - @index));
    return CONVERT(int, @availability);
    END
    GO

  • Sql Server Express Query String error

    I am having trouble trying to filter my sql database using the query string against a date column in my database.  I set a date variable = "dd/mm/yyy" format but when I apply that in the sql query as:
    StartPeriod = CDate("01/" & Today.Month.ToString & "/" & Today.Year.ToString)
    EndPeriod = CDate(Today.Day.ToString & "/" & Today.Month.ToString & "/" & Today.Year.ToString)
    At this point StartPeriod = #04/01/2015#  and EndPeriod is #04/27/2015#
    sql = "SELECT * FROM Transactions WHERE  ((PaidOutDate IS Null) OR (TransDate >= '" & StartPeriod & "' AND TransDate <= '" & EndPeriod & "')
    When I execute the Sql command I get this error:
    "Conversion failed when converting date and/or time from character string"
    My Current Culture is {en-AU}
    Any help is appreciated.
    Brad
    BHend

    Visakh,
    Further to the problem above.  Your suggestion worked well on my laptop, but when I transferred the program to my desktop it failed with the error: "Conversion failed when converting date and/or time from character string" again.  Both
    computers are running the same version of Windows 8.1, both running the same version of vs express 2012 and both running the same version of ssms.  Both Windows 8.1 versions have the same English (Australia) as the Region and language.  The only
    difference that I can find is that while both have a CurrentCulture of {en=AU} and CurrentUICulture of {en-GB} the laptop, where the program works has an InstalledUICulture of {en-GB} and the PC where it doesn't work has an InstalledUICulture of {en-US}.
    Do you think this could be the problem?  If so, how would I change the InstalledIUCulture?
    As you can tell I am way our of my depth here, I've looked in the Control Panel and both computers appear to have the same settings for options that I think are relevant, but of course there could be hundreds of other settings nI don't know about. 
    I've also progressively worked through the Registry on both computers comparing their settings but could find nothing relevant. 
    Any suggestions of where to look?
    Thanks Again
    Brad
    BHend

  • How to speed up SQL spatial query (spatial index error)

    Hi,
    Im trying to split polylines by points which have a small buffer around them. Currently i have over 370,000 lines and 320,000 nodes and the query is running really slowly (ive left it for 3 days and it still hasnt completed). I have tried forcing a spatial
    index using with (Index(SI_tempPD)) but i get the following error:
    "The query processor could not produce a query plan for a query with a spatial index hint. Reason: Could not find required binary spatial method in a condition. Try removing the index hints or removing SET FORCEPLAN."
    below is the snippet of code that im trying to run when i get the error:
    BEGIN INSERT INTO TempLines ( [linenum] ,[ogr_geometry] ) SELECT lines.[linenum] ,lines.[ogr_geometry].STDifference(points.[ogr_geometry].STBuffer(0.005)) AS ogr_geometry FROM dbo.TemplineData AS lines with(Index(SI_tempPD)) INNER JOIN dbo.[TemplineNodes] AS points ON lines.[ogr_geometry].STIntersection(points.[ogr_geometry]).STDistance(points.[ogr_geometry]) < 1 WHERE (lines.[linenum] <> points.[linenum]) END
     is there anyway i can speed up the query? (I also have a clustered primary key) the execution plan shows that a filter takes up 36% of the cost and the insert takes up 64%
    Any help would be greatly appreciated! (im using SQL Server 2008 (SQL server Management studio 10.50.1600.1))

    SQL Server spatial indexes don't support STDifference or STIntersection, see
    https://technet.microsoft.com/en-us/library/bb895373(v=SQL.105).aspx, which is why you get the error. 
    Your query is doing multiple expensive spatial operations against some fairly good-size tables in a join. You might get better results by either breaking the query into multiple simpler queries (SELECT into a temporary table and move the STDifference and
    STBuffer and INSERT off to a separate statement), and (if possible) rearchitecting the query to use STIntersects (which does support spatial index) rather than STIntersection.
    Hope this helps, Bob

  • How can i store latitude and longitude (of registered user locations) in sql server and how can i query it for finding locations inside X radius from point y (or any user)?

    Hello
    In my app (WP 8.1) i have to store user location (lat,lon) in sql db so how can i store that location detail? And i also have to find all the location which are inside certain radius X from another user location, How can i do this?
    Any Sample project or code or any blog post?
    P.S. I use sql server 2012.

    If you need to do spatial queries like the one you mentioned you'd need to store it as a spatial geography type. For points, a simple SQL INSERT statement using the Point() method would do it. Example here:
    http://msdn.microsoft.com/en-us/library/bb933811.aspx For locations inside a radius, you'd use STDistance() method. All of the methods for the geography data type are documented here:
    http://msdn.microsoft.com/en-us/library/bb933802.aspx and can be used in ordinary T-SQL statements.
    If you need to use the SQL Server spatial library in your .NET application direct, Alastair has some nice blog posts, like this one:
    https://alastaira.wordpress.com/2011/08/19/spatial-applications-in-windows-azure-redux-including-denali/ , he even wrote a book. Or search the answers in this forum.
    Hope this helps, Bob

  • Query: SQL Server Book Recommendations

    Hi folks!
    There are Books Online. There are the SAP Notes and Documents created by people like Jürgen Thomas (THANKS!!!) ...
    There are many sources of information in the WWW - blogs, documents, discussons ...
    And there are many BOOKS. Too many ...
    I ask you to recommend your favourite books about SQL Server.
    Your recommendations should help all of us to buy those books which are helpful ...
    Kind regards, Rudi

    Hi Rudolf,
      Do you focus only on SQL server, not including Windows Server Failover Cluster and SAP? If yes, I  recommend you to ask in MSDN -> Database Engine.
    Because this is a SAP on SQL forum, I will talk a little bit about WSFC and SAP. Here is my MATERIAL list. Hope this helps.
    PS: These are very useful for troubleshooting and performance optimization. Regarding to reviews, there are so many people wrote in Amazon in great detail. I will skip it.
    1. Search "Failover Cluster" from MS TechEd 2008~2014
    2. Search "SQL Server Performance/Query/execution plan/AlwaysOn" from MS TechEd 2008~2014
    3. A book "Microsoft SQL Server 2005 administrator’s companion"
    3.5 Troushooting Sql Server ( Troubleshooting SQL Server: A Guide for the Accidental DBA )
    4. A material from SAP course "BC 490: ABAP Performance & Tuning"
    5. CD 262: Tune Your Custom ABAP Code.
    6. Performance Do’s and Don’ts – ABAP: http://service.sap.com/performance
    7. SAP performance optimization guide: http://www.amazon.com/SAP-Performance-Optimization-Guide-Edition/dp/1592293689
    8. Juergen best practices: http://scn.sap.com/docs/DOC-1006
    9. SAP DBA Cockpit and Microsoft SQL Server | SCN
    10. DBA Cockpit SQL scripts: http://blogs.msdn.com/b/saponsqlserver/archive/2007/06/05/sap-dbacockpit-and-some-related-sql-scripts-part-1.aspx
    11. Search "Enhancment Package/Solution Manager" from SAP TechEd

  • SQL Server Service Pack Install and SSRS Scale Out Environment

    We have an error in our SSRS environment that looks to be addressed in SQL Server 2008 R2 SP3. Our set up is a scale out environment, 2 SSRS app servers and 1 SSRS database server. For simplicity as we are moving to 2012 soon, I would like to only install
    the service pack on one of the SSRS app servers. Anyone aware of any reason besides keeping servers consistent to not do this? I don't want to go through the time to upgrade the SSRS SQL Server if I don't have to.
    Thanks

    Hello,
    If you apply the service pack on the database server first, front-ends may not be able to provide service again until you
    apply the SP to them too. I have no knowledge of other possible issue.
    Remember to backup SSRS databases and encryption key before applying the service pack.
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • SQL Server Express Performance Limitations With OGC Methods on Geometry Instances

    I will front load my question.  Specifically, I am wondering if any of the feature restrictions with SQL Server Express cause performance limitations/reductions with OGC methods on geometry instances, e.g., STIntersects?  I have spent time reading
    various documents about the different editions of SQL Server, including the Features Supported by the Editions of SQL Server 2014, but nothing is jumping out at me.  The
    limited information on spatial features in the aforementioned document implies spatial is the same across all editions.  I am hoping this is wrong.
    The situation....  I have roughly 200,000 tax parcels within 175 taxing districts.  As part of a consistency check between what is stored in tax records for taxing district and what is identified spatially, I set up a basic point-in-polygon query
    to identify the taxing district spatially and then count the number of parcels within in taxing district.  Surprisingly, the query took 66 minutes to run.  As I pointed out, this is being run on a test machine with SQL Server Express.
    Some specifics....  I wrote the query a few different ways and compared the execution plans, and the optimizer always choose the same plan, which is good I guess since it means it is doing its job.  The execution plans show a 'Clustered Index Seek
    (Spatial)' being used and only costing 1%.  Coming in at 75% cost is a Filter, which appears to be connected to the STIntersects predicate.  I brute forced alternate execution plans using HINTS, but they only turned out worse, which I guess is also
    good since it means the optimizer did choose a good plan.  I experimented some with changing the spatial index parameters, but the impact of the options I tried was never that much.  I ended up going with "Geometry Auto Grid" with 16 cells
    per object.
    So, why do I think 66 minutes is excessive?  The reason is that I loaded the same data sets into PostgreSQL/PostGIS, used a default spatial index, and the same query ran in 5 minutes.  Same machine, same data, SQL Server Express is 13x slower than
    PostgreSQL.  That is why I think 66 minutes is excessive.
    Our organization is mostly an Oracle and SQL Server shop.  Since more of my background and experience are with MS databases, I prefer to work with SQL Server.  I really do want to understand what is happening here.  Is there something I can
    do different to get more performance out of SQL Server?  Does spatial run slower on Express versus Standard or Enterprise?  Given I did so little tuning in PostgreSQL, I still can't understand the results I am seeing.
    I may or may not be able to strip the data down enough to be able to send it to someone.

    Tessalating the polygons (tax districts) is the answer!
    Since my use of SQL Server Express was brought up as possibly contributing to the slow runtime, the first thing I did was download an evaluation version of Enterprise Edition.  The runtime on Enterprise Edition dropped from 66 minutes to 57.5 minutes.
     A reduction of 13% isn't anything to scoff at, but total runtime was still 11x longer than in PostgreSQL.  Although Enterprise Edition had 4 cores available to it, it never really spun up more than 1 when executing the query, so it doesn't seem
    to have been parallelizing the query much, if at all.
    You asked about polygon complexity.  Overall, a majority are fairly simple but there are some complex ones with one really complex polygon.  Using the complexity index discussed in the reference thread, the tax districts had an average complexity
    of 4.6 and a median of 2.7.  One polygon had a complexity index of 120, which was skewing the average, as well as increasing the runtime I suspect.  Below is a complexity index breakdown:
    Index
    NUM_TAX_DIST
    1
    6
    <2
    49
    <3
    44
    <4
    23
    <5
    11
    <6
    9
    <7
    9
    <8
    4
    <9
    1
    <10
    4
    >=10
    14
    Before trying tessellation, I tweaked the spatial indexes in several different ways, but the runtimes never changed by more than a minute or two.  I reset the spatial indexes to "geometry auto grid @ 32" and tried out your tessellation functions
    using the default of 5000 vertices.  Total runtime 2.3 minutes, a 96% reduction and twice as fast as PostgresSQL!  Now that is more what I was expecting before i started.
    I tried using different thresholds, 3,000 and 10,000 vertices but the runtimes were slightly slower, 3.5 and 3.3 minutes respectively.  A threshold of 5000 definitely seems to be a sweet spot for the dataset I am using.  As the thread you referenced
    discussed, SQL Server spatial functions like STIntersect appear to be sensitive to the number of vertices of polygons.
    After reading your comment, it reminded me of some discussions with Esri staff about ArcGIS doing the same thing in certain circumstances, but I didn't go as far as thinking to apply it here.  So, thanks for the suggestion and code from another post.
     Once I realized the SRID was hard coded to 0 in tvf_QuarterPolygon, I was able to update the code to set it to the same as the input shape, and then everything came together nicely.

Maybe you are looking for

  • "The Data is Invalid" When Trying to Approve Pending Computers in WDS

    I'm having an issue were I can't approve pending computers in the WDS console or using WDSUTIL.  I get "The Data is Invalid" whether I use default settings or choose the Name and Approve option.  The server's computer account has full permissions on

  • Rollback related queries

    I have doubt related to rollback in albpm. though we have COMPENSATION HANDLDLING method to deal with rollbacks but what if we make an entry in databse and we have to rollback the changes. I tried it using compensation handling but i dont think that

  • Downloaded song is corrupted or incomplete

    I just downloaded 18 different songs and four of them say they are downloaded but are incomplete when played. How can I redownload a corrupted song with out charges?

  • 5.1 Channel Surround from iMovie

    Greetings, I have some AVCHD video clips taken with my Sony Camcorder and already downloaded to my computer. I use ClipWrap to re-wrap the videos so that iMovie can at least import them into timeline (as iMovie does not natively support M2TS videos).

  • MIN and MAX datetimes ti find  range

    I am using Oracle 11g version create table re(Name char(20),Datetime char(45),val1 number); insert into re values('abc','10/29/2012 13:00','1.5') insert into re values('abc','10/29/2012 13:05','1.5') insert into re values('abc','10/29/2012 13:10','1.