Latest Blog Posts
The secrete SQLFile.sql
We are all so used to clicking on the New Query icon (or the keyboard shortcut Ctrl+N). We know it will open a new query window in SSMS, an empty query window that is, but many of us never knew that something else was designed to happen… Read more
T-SQL – Find Number of Rows of Database(s) tables Using Undocumented Procedure – sp_MSforeachdb and sp_MSforeachtable
On Technet forum, Op was looking for a way to get table cardinality for all databases in an instance. There are many ways to get the result. This post gives you an idea and SQL in which undocumented SP’s being called “sp_MSforeachdb and sp_MSforeachtable”.
The above undocumented SP’s iterate through… Read more
I wanted to find out how many SQL Saturday’s I’d spoken at and how I ranked with others. I got a spreadsheet from Kendal Van Dyke at one point, but it was quickly out of date. However Kendal mentioned that there was an XML document on the site, and I… Read more
Commercial database systems like SQL server have many recovery mechanisms to restore data hardware or software failure. Checkpoints are part of such recovery mechanism.SQL Server Database Engine is programmed to perform changes or modifications to databasepages in buffer cache (memory) first and after some processing the modification are written on… Read more
Omaha’s next SQL Saturday event, #397, is now live and scheduled for May 23rd, 2015, at Mammel Hall on the campus of the University of Nebraska – Omaha.
Parents, you know that feeling you get after you’ve brought home that brand new baby (or in my case, babies) where you suddenly say to yourself, “Oh damn. What have I done?” Yeah, that’s my feeling after my first board meeting. But let me give you a run-through of how… Read more
Every month SQL Judo (Russ Thomas) (b/t) challenges us to do his Monthly DBA Challenge. I’ve decided it would be fun (and good practice) to do them. Another major benefit is that it will force me to move out of my normal comfort zone. For… Read more
If you’re an IT manager, the first thing I’d like to tell you is how invested Microsoft is in SQL Server. While earlier incarnations of executive leadership focused in other areas (anyone remember “Developers! Developers! Developers!”?), Microsoft’s new leadership is very bullish on SQL Server. And, why not? After… Read more
SSRS Farm Overview
Building a SSRS farm will require Enterprise or Business Intelligence editions of SQL Server for versions 2012 and 2014. SQL Server allows for the deployment of 2 or more servers running SQL Server Reporting Services to increase the performance of your reporting environment.
SSRS stores its data… Read more
SELECT db_name(d.database_id) dbname
, object_name(d.object_id) tablename
,'CREATE INDEX [missing_index_' +…
Syntax for CONVERT function
CONVERT ( data_type [ ( length ) ] , expression [ , style ] )
Convert functions is usually used with date/time data type to convert a date in different formats. Below examples…
I was excited to learn this week that I’ve been chosen as a participant in the Friends of Red Gate program for 2015. For those of you who are not SQL folk, you can stop reading now – Red Gate is a company who makes top-shelf products for working with… Read more
It’s Friday, time to look back at the most popular RealSQLGuy posts of the week. Because it’s Friday and you’re not doing any real work anyway.
Posts That Were Popular This Week
- Building (for FREE) a Virtual Server for SQL Demos
- Cheating DBCC To Fix Index Corruption
- Don’t Get Slimed…
Read XML column attributes in to two columns DimType and Dimvalue from the below example also retrieve the data matching values[DimTypes (WIDTH or Height)].
<dimension name=”width” value=”12.77″/>
<dimension name=”height” value=”0.14″/>
<dimension name=”depth” value=”12.92″/>
Download SQL :- https://gallery.technet.microsoft.com/SQL-Querying-XML-f700bbb0
DECLARE @xml XML SELECT @xml = '<dimensions> <dimension…