I started to work with an old project which is on SQL Server, there is a problem every few days with too msny opened connections and the project on production crashes.
I am supposed to find a way how to help it super fast, before looking more into code. So I found option in SQL Server options:
Disconnect after the query executes
which looks perfect at first glance.
But does it make app on IIS working worse? Will it work if I'm using IQueryable objects? I couldn't find much info about it.
Thank you in advance.
Related
I am completely baffled by SQL Server and OPENROWSET permissions.
Our team has an AD Group. This group is included in the DEV server's Windows Administrators local group. This same AD group has SysAdmin privilege on the local installation of SQL Server 2017.
Attempting to run the command:
SELECT *
FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0','Excel 12.0;Database=C:\Work\test.xls;HDR=YES',['sheet1$'])
works for me, but for none of my teammates.
If there is a definitive document on the security requirements for using the OPENROWSET command - I have not found it (and please - don't refer me to learn.microsoft.com - that documentation is not written in any way that I understand).
There are other issues I have found including if I change the name of the sheet in the Excel workbook - the command fails (and yes - I closed the book after making the change).
Finally - some feedback on the use of OPENROWSET - is it generally a good idea? a bad idea? pretty much neutral but be prepared for these kinds of problems?
I hope this question is specific enough to be answered - I have probably spent 20+ hours trying to figure out how to understand how this works so I can make it work and use it consistently.
Thanks!
So honestly troubleshooting security/permissions and errors with SQL Server is probably the most frustrating aspects of my job.
First few questions and thoughts about your dilemma.
Do you really want to be granting your team connected to your db
sysadmin rights? I wouldn't do that period, full-stop.
Will the data be refreshed? If yes, I suggest you ingest this data
into a sql table with a process, perhaps python, ssis, dts package,
powershell, whatever you fancy.
If the data will always be static in that one excel file, I'd suggest perhaps making it act like a linked server for (hopefully) fewer permission issues? Also, it's easier to query that way, from my memory.
In any event, this article (non msdn link) may help? I've done it this way once before and had slightly less of a difficult time, but then again it involves adding a driver (usually) to the sql server. BUT, then I did not have to allow multiple users sysadmin - and I think ANYTHING is better than that.
https://www.sqlshack.com/query-excel-data-using-sql-server-linked-servers/
Sometimes the issue is not with the user running the query, but SQL Server using the account it runs as - to get permissions on the file. This article goes over that aspect as well. I'm not sure that is your issue as you say it works for me but not for thee, but maybe read that portion of the article at least?
Hi there and many thanks in advance, Im veeery newby.
I am building a small visual basic 2010 application and I need a better choice for my database (around 20 tables), since now Im using SQL server express 2008 and as far as I understand it is too big and complicated for me (just installing it was a pain for me)
I am looking for an application that will be easy to distribute (maybe just an installer and thats it!) and that can run without problems on old computers with windows xp.
The last thing is that I want to have to chance to install just a client version of my app on a computer and tell it to connect to the database wich will be running on other computer on the same LAN (or maybe on a web server on the future!).
In other words I would like to have the option of selecting "where" is the database to read/write on.
I will thank advices for this implemtation and will respond if somebody needs more details before answering.
Well installing sqlserver in not rocketscience al you need to execute .exe .
Though if you looking for opensource database then have a look at mongodb
MySql is open source and quite easy to use, especially with a tool like PHP MyAdmin:
http://www.mysql.com/
I've written my website using ASP.NET MVC and SQL Server (used a SQL Server instance which ran locally on my machine).
I'm about to upload my site to a hosting provider. However, his DB works under MySQL. I don't care about the data already in the DB itself. It's mostly mock data and a few tables which I don't mind rewriting. But how do I go about the transition from SQL Server to MySQL? How does this influence my queries inside my code? is it the same code syntax? Will I have to recreate the table definitions? In my project I used LINQ to SQL.
Am I forced to look for a host with SQL Server capabilities (i.e. licenses)? (I hope not...)
Thanks!
You may be able to transition smoothly, but I greatly doubt this will be the case.
The differences are many and whether you could depends on what features you used when developing.
If you kept to one of the standards, you may be in luck.
See a comparison sheet on wikipedia.
In regards to the Linq aspect of your question - you should be able to use a Linq provider for MySql instead of MSSql without a problem.
Here is a link to one: http://code2code.net/DB_Linq/
If you do decide to go with the MySql hosting, I suggest you test all aspects of you application to ensure they are working as expected.
LINQ to SQL works with MS SQL Server only...so if you want to keep using it, you need to find a host with a MSSQL database.
We are doing a feasibility on what we're going to propose as a solution to a client who wants to migrate to a .NET based solution. Part of the data resides in UniData. What is required can be achieve using the following tool:
http://www.welland.com/export.html
The above product ETLs data from UniData to SQL Server.
As a first step, we want to be sure that there are no hitches in getting the data through SSIS from UniData to SQL Server.
Since we don't have an environment to test this we have to check mostly on the net. But most of the discussions regarding UniDate and SSIS don't look like the problem got solved. The main problem seems to be that people aren't able to get hold of a proper ODBC driver. If the data is converted into XML, then it looks like it's working fine.
Has anyone done this and know that this can go through without any problems?
Cannot say I've done it, but Rocket Software has 2-user license versions of UniData available for download, so at least you would have a system to test on.
We are actually working on this process now -- Unidata to SQL through SSIS. We worked with Rocket Software to get the OLE DB working... ODBC was never fast enough and before there was not OLE DB... Now there is. You have to do some work on the UNIDATA side once the OLE DB is install but that is an answer for another day. So far we have no issues except the work to get it setup.
i wonder if there is something similar to Sql Profiler for Sql Server Compact Edition?
i use SqlCE as backend for a desktop application and it would be really great to have something like sql profiler for this embedded database.
or at least something simliar to the NHibernate show_sql feature...
any ideas?
thanks
j.
The only tested solution I know of that could solve this problem is Altiris Profiler which is a tool I designed at my previous job, but is closed source and not-for-sale.
The way you would hook it in, is by creating a factory for your commands and proxing them for profiling purposes before using them (using RealProxy). Its really light weight and about 10 lines of code to implement.
On my question Flory talks about a new tool called dynaTrace that may also be able to solve this problem as well.
I don't think that would work - CE seems like a totally different beast.
You can enable some logging that might help you:
http://msdn.microsoft.com/en-us/library/ms171949(SQL.90).aspx
I tried to do this and managed to set the database up and connect from SSMS - you have to specify the alternate connection type of 'SQL Server Compact Edition'. Profiler has no such thing - and entering a path to the datafile for the 'database' field did nothing.
Try to install a Standard version (with the profiler) and you might be able to connect to the CE instance also.
I think that its possible that it could be done using the Default Profiler Trace Template (from Visual Studio 2008). I talk about using the template for a non-CE version of SQL in my weblog at: http://codingathome.blogspot.com/2009/04/create-sql-trace-and-read-it-using-sql.html .
Its possible that template would work for the CE version of SQL. I haven't tried it. Your milage might vary. I know that SQL CE doesn't support stored procedures so chances are this wont work. You might have to setup debugging in your code in order to trace queries.
Since CE doesn't support a stored procedure I bet you can still run the script as a .sql script and get the tracing events installed. Its worth a try.