Microsoft SQL Insert Trigger to Get Current Datetime Value

This script gets the datetime value in this format MM/DD/YYYY:HR:MI:SSPM or AM. I could have used the CAST or CONVERT option but the did not reproduce the result that I wanted.  There are some option in CONVERT option but they converts into a 24hr format. Here is my trigger for insert event. USE dwdata GO /* —————————————————————————– www.myw0.com, Version 1.0, Creation Date: 11/05/2014 Functionality: Generate Datetime values into a text field —————————————————————————– */ if exists (select * from sysobjects…

Read More

Who is Active for MSSQL

Who is Active is free SQL tool that you can download and use for personal, educational, and internal corporate purposes. If you work with MSSQL server and notice slowness this is a great tool for monitoring SQL transactions and performance in SQL server.  I personally use this tool for monitoring SQL deadlocks in the database. You can find more information in this page: http://sqlblog.com/blogs/adam_machanic/archive/2012/03/22/released-who-is-active-v11-11.aspx You can download the SQL script from here: http://sqlblog.com/files/folders/beta/entry42453.aspx The installation process is very simple:…

Read More

Understanding Microsoft SQL Server System Databases

A database server application such as Microsoft SQL Server uses a lot of information in order to operate. Considering the purpose of a database is to store information, it only makes sense that SQL Server dips into its own technology for storing and accessing the information required for operating in a set of its own databases. Each of the databases used plays a specific role in the operation of the SQL Server. The system databases use the same components…

Read More