Does anyone know if there's a tool out there which allows you to run queries against a SQL Server database through a web browser (e.g. SSMS functionality available through the browser)?
I ask as we have a large support team who rely heavily on running database queries when investigating issues. As our data center (where the DBs are hosted) is based remotely from our offices, and many of our support staff are working offshore over VPN it's helpful to allow them to access a client hosted at the data center. One solution would be to host SSMS on a terminal server, but having a web front end would be more straight forward, should one exist.
You may like sqlpad.
It's a Node.js web app for writing and running SQL queries and visualizing the results. Supports Postgres, MySQL, SQL Server, Crate and Vertica.
It has many contributors and it's being kept up-to-date.
IIS / iisnode specifics
You may be using IIS with iisnode. That's working too. You only need to alter the port config in /lib/config.js line 12 to use process.env.PORT.
When you want to use Google Authentication. You need to have this in your web.config:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appSettings>
<add key="GOOGLE_CLIENT_ID" value="..." />
<add key="GOOGLE_CLIENT_SECRET" value="..." />
<add key="PUBLIC_URL" value="https://example.com" />
<add key="DISABLE_USERPASS_AUTH" value="true" />
</appSettings>
</configuration>
PS: The last key is optional for when you want to only allow google logins
None from Microsoft but there are 3rd party tools available, such as myLittleAdmin.
You are wanting something like SQL Web Data Admin.
It does not provide all the features of SSMS but it does enough to be able to support/manage the sql server remotely.
There are other tools that are based of this project on codeplex that add additional functionality.
Related
I have a WPF application where I use Entity Framework for interacting with the database that is on SQL Server Express on my machine. I'm reasoning on small projects where data will not be huge and then I don't want to install SQL Server Express on client's machine for two reasons:
installation takes a long time
these projects must be executable on computers with low hardware specs (installation of SQL Server takes too much time)
I tried installing LocalDB on client machine, created default instance and started
The problems are two:
how to reconfigure app.config file making Entity Framework connecting to database? (in development environment connection string is SQL Server style)
where to put database files? (user's profile root?)
Am I following the correct way? I know only two way to do this, installing SQL Server Express or using LocalDB the may be a third way?
You can set up your app.config file as follows (just replace "C:\Database.mdf" with the full path to your database):
<connectionStrings>
<add name="NameOfConnectionString" connectionString="data source=(LocalDB)\v11.0;attachdbfilename=C:\Database.mdf;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" />
</connectionStrings>
But with this you will end up having always the same static connection string.
Perhaps you want to store you database rather in some user folder.
This will get a sub folder of the users documents folder at runtime:
string folder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "MyAppsFolder");
If you want to deploy the local db to the users machine, you might want to create a installer project for this. See here
The alternative would be to install some version of SQL-Server on the client machine.
If it is possible that one the client site you will have more than one concurrent user you will have no other choice.
Difference between local db and SQL-Server express
If you need more information on the usage scenarios of local db and SQL-Server express, check out this question and answers.
This MSDN Site has also a bunch of information on LocalDB.
I have two identical Windows 2012 R2 environments. One is for development and the other is for staging.
For my server-side language I am using PHP and the Laravel 4.1 Framework.
I have a service account that I use for both environments to connect to our MSSQL development database. I set the service account to the application pool and assign that application pool to the application within IIS 8.5. I have done this numerous times with no issues. This avoids us storing the password in the PHP database config file within Laravel.
Now, the application I built is running fine in development. I can connect to the database using the method described above. I copied the identical code over to staging, again using the same environment and the same service account, but I get the dreaded:
PDOException
SQLSTATE[28000]: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.
Because it is working in development with no issues and because I have other applications on my staging box that are successfully able to connect, I am at a complete loss as to why this application can't connect in test. I spent hours yesterday troubleshooting with no luck.
Any ideas?
The issue had to do with the ApplicationHost.config file. The other applications and app pools had an attribute of userName="" which the application that was causing the issue did not. I manually added the attribute and this resolved my issue.
<location path="Default Web Site/application-name">
<system.webServer>
<security>
<authentication>
<basicAuthentication enabled="false" />
<anonymousAuthentication enabled="true" userName="" />
</authentication>
</security>
<handlers>
I have a web site app running on IIS 7.5 that access a LocalDb, all installed on same server.
Using SSMS, I can see the app db folder in the object explorer but when I try to expand it, I get an error saying that the database is not accessible. If I stop the web site in IIS then I can access it.
Is there a way that I can work on the database in SSMS simultaneously while the clients are accessing the web app ?
I log in the SSMS as administrator using Windows authentication. The web app log in as "IIS AppPool\AutoParkDemo" using the ApplicationPoolIdentity.
<connectionStrings>
<clear />
<add name="AutoPark" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=AutoParkDemo;AttachDbFilename=C:\AutoPark\Demo\Data\AutoParkDemo.mdf;Integrated Security=true" providerName="System.Data.SqlClient" />
</connectionStrings>
IIS server needs to have exclusive access to local db file, that is the main reason you can't access to database using SSMS.
In theory you could have read-only access to local db while IIS is running on background. I use often Visual Studio and IIS, and I can access local db while web server is running.
I believe SSMS needs write access to works with local db. This could be the reason why VS can read and SSMS not.
What I have found out is that each application that access LocalDB simultaneously, must have its own shared instance. There is a good tutorial about it on MS site, but the problem is that if there is no activity the shared instance stops and, although I read on Microsoft website that it will restart automatically, it didn't happen to me. After struggling for couple weeks, I decided to use the suggestion from other post on this site: When deploying to a web site with IIS, use SQLExpress instead. It now works perfectly.
This question already has answers here:
Uploading MVC site to server
(3 answers)
Closed 8 years ago.
I've developed website based on .NET MVC4.
I used simple membership .NET built in forms authentication.
I saw that the application uses some kind of MS database, but I don't really know what kind.
I want to upload my site to server and publish it.
Do I need to install some kind of database on the server? or I'll just need to upload the application and it will create the database on the server automatically?
Thanks.
The database created by default when using the MVC 4 Internet template is a SQL Server Express LocalDB, which is really intended for development and testing and not for deployment. Although I think some people do use it in production. If the correct components are on the server you are deploying to it will automatically create this database. If you look at the web.config generated by the template it looks something like this.
<add name="SimpleSecurityConnection" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-SeedSimple-20130125152904;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnet-SeedSimple-20130125152904.mdf" providerName="System.Data.SqlClient" />
The name for the configuration string to use is defined in the WebSecurity.InitializeDatabaseConnection method as the first parameter. You will notice that the data source starts out with "(LocalDb)" which tells the runtime to use a LocalDB instance. I would recommend installing something like SQL Server Express or a full blown SQL Server instance on the server and changing the connection string to point to it instead for production.
You should explain more about state of your application database. At least you should let us see your working connection string(s).
If you have all your data in a single database - your own tables and the membership made tables - and your database is attached to a local database instance, you just need to generate a script from your current database and run that script on the database server of your web host.
Many scenarios exist according to the type of your application database (source) and the type of your web hosting database server (destination)...
I have created a windows forms application using Visual C# and ms acces 2007. The connection string to the database from the application looks like this.
<connectionStrings>
<add name="CRMS.Properties.Settings.CRMSConnectionString" connectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\CRMS.accdb"
providerName="System.Data.OleDb" />
</connectionStrings>
I have devloped both the database and windows forms development on a single pc.
I need to deploy this application on LAN with 8 pc's. The database will reside on the central pc with ip address 192.168.1.10. The windowsforms application will be installed on all the pcs including the pc on which the database file resides on. What are the steps i need to complete for a smooth and efficient deployment?
You'll need to set up a network share that is hosting the access database. Then you'll have to point to either the UNC path of that shared file:
<connectionStrings>
<add name="CRMS.Properties.Settings.CRMSConnectionString" connectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\\192.168.1.10\ShareName\CRMS.accdb"
providerName="System.Data.OleDb" />
</connectionStrings>
or using mapped drives "Z:\CRMS.accdb".
You might consider using the DNS name of the computer instead of the IP address so you don't have to change the connection string on each of the client computers if / when the IP address changes.
Of course, I would be remiss in my duties if I didn't point out that running Access over the network is painful from a performance and maintenance standpoint. I would consider importing your database into an actual network database such as SQL Server Express or MySQL (both free) for better performance and reliability.