I have seen scores of expert developers getting perplexed with SQL Server in finding time only from datetime datatype. Let us have a quick glance look at the solution. Let us learn about how to get Time in Hour:Minute Format from a Datetime as well as to get Date Part Only from Datetime.
SQL SERVER – Get a List of Fixed Hard Drive and Free Space on Server
When I am not blogging, I am typically working on SQL Server Optimization projects. Time and again, I only have access to SQL Server Management Studio that I can remotely connect to server but do not have access to Operating System, and it works just fine. At one point in…
Read MoreSQL SERVER – Forgot the Password of Username SA
I just received a call from an old friend with whom I used to work in Las Vegas. He told me about a password-related issue he faced in his organization. They had changed the password of username SA and now they are not able to recall the new password. I…
Read MoreSQL SERVER – 2008 – Copy Database With Data – Generate T-SQL For Inserting Data From One Table to Another Table
Just about a year ago, I had written on the subject of how to insert data from one table to another table without generating any script or using wizard in my article SQL SERVER – Insert Data From One Table to Another Table – INSERT INTO SELECT – SELECT INTO…
Read MoreSQL SERVER – List All Missing Identity Values of Table in Database
The best part of any blog is when readers ask each other questions. Better still, is when a reader takes the time to provide a detailed response. A few days ago, one of my readers, Yasmin, asked a very interesting question: How we can find the list of tables whose…
Read MoreSQL SERVER – Puzzle – Write Script to Generate Primary Key and Foreign Key
In one of my recent projects, a large database migration project, I confronted a peculiar situation. SQL Server tables were already moved from Database_Old to Database_New. However, all the Primary Key and Foreign Keys were yet to be moved from the old server to the new server. Please note that…
Read MoreSQL SERVER – Get Last Running Query Based on SPID
We often need to find the last running query or based on SPID need to know which query was executed. SPID is returns sessions ID of the current user process. The acronym SPID comes from the name of its earlier version, Server Process ID. To know which sessions are running…
Read More