Hello Devz, Today I had an issue with the performance of a SQL stored procedure. This procedure was supposed to delete a few millions rows in a table. But it was quite slow… So after optimizing the query, I looked at the database itself. Having an indexed primary key is important but the level of […]
Pi Web Server – Part 1: Install Nginx, PHP and MySQL
Install Nginx, PHP and MySQL I’m going to use nginx rather than the more traditional Apache2, because it is more efficient and on a low-power device like the Pi that’s going to be important. I’m also going to install PHP5 (with PHP APC to make it faster than normal) and MySQL as these are pretty […]
How to kill all user sessions on a DB
Sometimes in SQL you need to delete some rows, delete a Table or the DB. But what if a user is still connected to it. The solution is simple, kill all the sessions on that DB with a simple script: USE master SET NOCOUNT ON DECLARE @DBName varchar(50) DECLARE @spidstr varchar(8000) DECLARE @ConnKilled smallint SET […]