Category Archives: MS SQL

how to save website sessions to ms sql database for websites

If you are planing to use a load balancer, websites sessions may create some problems if load balancer does not support session management. In this case you can save the sessions to a ms sql database and fix the issue.¬† It’s simple to save session to database. You will need to create a database using …

Read more

change all stored procedure ownership in ms sql database

When you migrated MS SQL database to new server there is change that you may see error like “Stored Procedure not found”. Mainly this comes due to a change in dbo. Please make sure that the stored procedure is owned by the correct database user. If the user is different¬† you can correct it by …

Read more

Kill process on MS SQL

#FIND ALL PROCESSES SELECT getdate() as “RunTime”, st.text, qp.query_plan, a.* FROM sys.dm_exec_requests a CROSS APPLY sys.dm_exec_sql_text(a.sql_handle) as st CROSS APPLY sys.dm_exec_query_plan(a.plan_handle) as qp order by CPU_time desc #ABOVE QUERY WILL LIST ALL ITEMS WITH DATABASE ID AND TO FIND THE DATABSE NAME USE BELOW ONE SELECT name as Database_Name, database_id as Database_ID FROM sys.databases; #KILL …

Read more