I'm at a bit of a loss on an intersects query that I'm sending via EF6. It works great against my test and production databases, but I recently set up a new box and restored my production database onto the local machine and the intersects query hard crashes the SQL Server process. Overview of the line of code that blows this up:
public async Task<TicketResultModel[]> ResultsByBoundingBox(DbGeography box)
{
var addressIds = await _addresses.Where(a => a.LatLon.Intersects(box)).Select(a => a.Id).ToArrayAsync();
...
}
So, my question is what should I check that would make this particular query succeed against my other databases, but fail against the local SQL Server 2012 installation? Mind you, everything else seems to work.
I have already installed the SQLSysClrTypes. Is there something else (there must be!)?
This turned out to be an issue of x86 vs x64. Rather than giving any sort of error message at all about wrong architecture, the process would just crash. Hard. I had x86 SQL Server 2012 installed. The machine architecture is x64, so I think the box was magically choosing to use the x64 spatial libraries. Unfortunately, this magic did not result in unicorns and rainbows: That happened after uninstalling SQL Server 2012 x86 and installing SQL Server 2014 x64.
Hope this helps someone who has done something silly!
Related
I am having a problem with a SSIS project that downloads data from a MySQL database and insert it in a SQL Server 2014 Database.
So I have two versions of the same project, one for SQL Server 2016 and another one for SQL Server 2014. They have the same scripts and data flows, but for some reason, only the one made for SQL Server 2016 works. The issues resides in the ODBC Driver connector. I can preview data in both project, but for the SQL Server 2014 version, it simply won't load it. So I get 0 rows every time I run it. Sadly, I need the 2014 version for our SQL Server, since when I deploy the project with 2016 as target version, it fails.
This pretty much sum up the whole problem and I have try quite a few things. Including, changing the ODBC connector's version. It all seems it has something to do with Visual Studio, when the target version is change from 2016 to 2014. Still, I can't find a solution to this issue.
I am using a query to source data, but I also tried with the table name, but still didn't work. I am not using any function. I am running directly from Visual Studio in debug mode.
Has anyone gone through the same error? I can't find anything related.
Please, let me know if you need anything else to understand the issue.
Ok I had similar issue but it was in Source query where one of function was not behaving same between 2016 and 2014 version.
When you say 0 rows, does package failed or successful ?
Are you using a query to source data ? If yes, does it have any functions used ?
Are you running from BIDS or SQL Agent ? If Sql Agent, Check if agent job configured to run in same 32bit or 63 bit version ?
Environment: SQL Server 2008 SP3 - using SSMS2008 (local or remote) and SSMS2012 (remote)
Something happened with our SQL Server instance recently. Nobody is able to create a new database through an SSMS (SQL Server Management Studio) interface. Neither SSMS for 2008, or SSMS for 2012.
What happens is they hang (or appear to hang). Sit and spin forever, and then the performance of the SQL instance really starts to tank while it is chewing away. CPU usage skyrockets.
Things I've noticed:
Telling it to create the MDF/LDFs on a local drive or network drive makes no difference.
We've tried disabling the anti-virus tools on both the SSMS machine and SQL instance server, with no change.
We've tried using the SSMS on the SQL instance server itself, and it also just spins. Any SSMS (we've tried three different machines) does the same thing.
If I open Windows Explorer and look at the locations I've told it to put the MDF/LDFs, they are created. I see the MDF and LDF show up.
As soon as I kill the SSMS process (because it feels like it's hanging), it does some cleanup work and the MDF/LDFs go away.
I can successfully use the CREATE DATABASE t-sql script in a query window, and it creates the databases fine, fast as can be, like one would expect.
FILESTREAM is not enabled for the server instance at all. No database uses it in the instance.
This only started happening recently - and the only thing I found with GoogleFu was a hotfix by Microsoft for SQL2008-SP2, that had to deal with microfilters and antivirii. This is SP3, so that fix is rolled into it (as well as we disabled AV on the SQL server and our local machines - to be sure).
Any suggestions or ideas? Is there some trace profile I can start up that would show me what is going on, step by step, to see where the SQL instance seems to be spinning its wheels when I try creating a database through the SSMS interface?
The background to my problem is based on distributed computing. I want to have a database with some numbers in them and then a number of computers go through each row calculating another number (a little bit of an over simplification).
The problems I'm having are routed in my poor understanding of SQL servers (I think). I've got Microsoft SQL server 2012 (and 2008) installed on this machine and I've somehow managed to make a server for this task but then the problems arise.
I can't add a table to the server (I'm trying to do this in VS2010). When I expand the server and right click on tables and select add new table i get the following error:
"The server version is not supported. Only servers up to Microsoft SQL Server 2008 are supported."
That stops me making a table and from there I can't move on. I've downloaded and installed the VS2010 SP1 (and re-installed it again when it didn't fix the problem) as I found this suggested for similar issues.
Any help on this would be greatly appreciated. I've read around but nothing seems to work, people suggest using "SQL Management Studio" but I don't seem to have this installed!
Also, I haven't gotten to this step yet, but if this gets fixed any advice/links on how to access the database from a different machine (over the same local network) would be greatly appreciated!
Many thanks,
Fraser
R Harvey gave you the pointer to SSMS - that's the ideal tool to use.
As for other computers accessing your local database - the name of your computer (where MSSQL is installed) is the name of the server in your connection string.
I am a junior developer and about to get my feet wet in my first "real" project. However we are trying to figure out a way to set everything up as the current developer lives out of country.
I was told to install certain programs, subversion clients and SQL Server 2000.
It does not seem that SQL Server 2000 can be installed on Windows 7. Are there inherent issues with me developing in a higher version of SQL Server like 2005? Is there an issue with stored procedures that can not be properly translated from on SQL Server version to another?
Again, I'm fairly new at this; please let me know if this is just a bad idea, impossible and any other guidance you can provide.
There are many features in newer versions of MSSQL that were not there in 2000 (multi-row inserts, newer hashing algorithms, and VARCHAR(MAX) to name a few). If you're using SQL Server Management Studio, it will not check these differences for you, even if you are connected to a SQL server 2000 database - it automatically uses 2008 rules for its syntax highlighting. Because of this it's easy to accidentally write code that's not 2000-compatible.
As far as getting 2000 running, if you have the install disk for an older version of windows, you could run a VM (http://www.microsoft.com/windows/virtual-pc/) and install the database server there. If your company has a separate development environment, you could create a copy of the production database to work off of as well.
The newer versions of SQL server bring new language and database features, if you write something using a feature that is available in SQL 2005 and not 2000 i.e. PIVOT then when you try and promote this to live then it will just get a syntax error.
There is no translation, if you went back in time 11 years, you'd still speak English you'd just get an odd look if you talked about 'Tweeting'.
You can set the database compatibility level to an earlier version for the specific database you are working on. This will stop you using the more modern features.
For the most part, you won't run into issues is you're simply running standard stored procedures and SQL statements.
However, there are several things that might not work properly if you're not in sync. SQL2005 was a relatively major upgrade and instroduced quite a bit of new functionality.
I don't know what you've got for available resources - dollars, etc, but if you have an MSDN Subscription at a level that provides you access to operating systems, then I would strongly recommend setting up a virual machine with an older version of Windows using your MSDN licenses, just to keep things on an even playing field.
I have been using VS2010 without any issues, always on the same application. Suddenly within the last my solution has become unbearably slow when right clicking. When doing other projects, it is fine. The only thing I can think of that I changed was disabling the SQL Server debugging.
It happens if I right click anywhere within the code editor. Everything freezes for about a minute and a half, then the right click menu shows up. If I try again right away, the same thing happens.
Intellisense seems to work fine. It is only the right click.
The project is fairly big, but it has been working fine. I am working on a 2 month old top of the line MacBook Pro (running Windows 7 64 bit in Boot Camp). I did do the patch Tuesday big batch of Microsoft patches in the last 24 hours...
Can anyone suggest where to look?
A delay that long is almost always associated with network time-outs. Use the trouble-shooting strategy demonstrated by Mark Russinovich in this blog post.
Windows 7, x64, 12GB memory, very slow right clicks:
The following steps fixed the problem for me. Right click is now instantaneous. Your Mileage may vary:
I deleted the following directory:
%AppData%Local\Microsoft\VisualStudio\10.0
and reinstalled these three packages from the Visual Studio 2010 Ultimate DVD
Microsoft SQL Server 2008 R2 Data-Tier Application Framework with this command:
\WCU\DAC\DACFramework_enu.msi
Microsoft SQL Server 2008 R2 Data-Tier Application Project:
\WCU\DAC\DACProjectSystemSetup_enu.msi
Microsoft SQL Server 2008 R2 Transact-SQL Language Service:
\WCU\DAC\TSqlLanguageService_enu.msi