July 2025 Discount: Comprehensive Database Performance Health Check | Testimonials

Home
  • Consulting
  • Training
  • Free Videos
  • All Articles
    • Interview Questions and Answers
    • SQL Tips and Tricks
    • SQL Performance
    • SQL Puzzle
    • Big Data
    • Blog Stats
    • SQL Books
    • Search SQLAuthority
  • Downloads
  • Hire Me
  • Health Check

SQL SERVER – PIVOT and UNPIVOT Table Examples

June 7, 2008
Pinal Dave
SQL, SQL Server, SQL Tips and Tricks
PIVOT, SQL Joins, SQL Scripts, UNPIVOT
I previously wrote two articles about PIVOT and UNPIVOT tables. I really enjoyed writing about them as it was interesting concept. One of the Jr. DBA at my organization asked me following question. “If we PIVOT any table and UNPIVOT that table do we get our original table?” I really…
Read More
All Articles 3scripts-600x217

SQLAuthority News – Subscribe to the Newsletter for 3 Important Scripts

June 6, 2008
Pinal Dave
SQLAuthority News
Database, Newsletter, SQL Wait Stats

Lots of people ask me how to stay in touch with SQLAuthority.com. Well, the answer is very simple, you can subscribe to the newsletter of SQLAuthority.com by going to URL here: https://go.sqlauthority.com. 

Read More
All Articles Compound-Assignment-Operators-600x387

SQL SERVER – Compound Assignment Operators – A Simple Example

June 5, 2008
Pinal Dave
SQL Tips and Tricks
SQL Operator, SQL Scripts, SQL Server, SQL Utility

SQL SERVER 2008 has introduced new concept of Compound Assignment Operators. Compound Assignment Operators are available in many other programming languages for quite some time. Compound Assignment Operators is operator where variables are operated upon and assigned on the same line.

Read More
All Articles notes85-600x400

SQL SERVER – Create a Comma Delimited List Using SELECT Clause From Table Column

June 4, 2008
Pinal Dave
SQL Tips and Tricks
CSV, Database, SQL Function, SQL Scripts, SQL Server, SQL Stored Procedure

I received following question in email : How to create a comma delimited list using SELECT clause from table column?

Read More

SQL SERVER – Example of DISTINCT in Aggregate Functions

June 3, 2008
Pinal Dave
SQL, SQL Server, SQL Tips and Tricks
SQL Function, SQL Scripts
Just a day ago, I was was asked this question in one of the teaching session to my team members. One of the member asked me if I can use DISTINCT in Aggregate Function and does it make any difference. Of course! It does make difference. DISTINCT can be used…
Read More

SQL SERVER – Order Of Column In Index

June 2, 2008
Pinal Dave
SQL, SQL Performance, SQL Server, SQL Tips and Tricks
SQL Index, SQL Joins, SQL Scripts
I just found one of my Jr. DBA to create many indexes with lots of column in it. After talking with him I found out that he really does not understand how really Index works. He was under impression that if he has more columns in one index, that index…
Read More

SQL SERVER – SQL SERVER – UDF – Get the Day of the Week Function – Part 4

June 1, 2008
Pinal Dave
SQL, SQL Server, SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Scripts
I have been asked many times when there is DATENAME function available why do I go in exercise of writing UDF For the getting the day of the week. Answer is : I just like it! SELECT DATENAME(dw, GETDATE()) Reference : Pinal Dave (https://blog.sqlauthority.com)
Read More
All Articles defaultconstraint-600x199

SQL SERVER – Create Default Constraint Over Table Column

May 31, 2008
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys, SQL Scripts, SQL Server

Very frequently Jr. Developers request script for creating default constraint over table column. I have written following small script for creating default constraint. I think this will be useful to many other developers who want this script to keep handy.

Read More

SQLAuthority News – 3 Million Readers and Continuing Journey

May 30, 2008
Pinal Dave
SQL, SQL Server, SQL Tips and Tricks, SQLAuthority News
Database, DBA, Software Development
I would like to express my deep gratitude towards your active participation on this blog. There are more than 3 Million of you have visited this site as well contributed to make it successful. You can read my personally selected articles here. SQLAuthority – Best Articles SQLAuthority – Favorite Articles…
Read More

SQL SERVER – UNPIVOT Table Example

May 29, 2008
Pinal Dave
SQL, SQL Server, SQL Tips and Tricks
PIVOT, SQL Function, SQL Scripts, UNPIVOT
My previous article SQL SERVER – PIVOT Table Example encouraged few of my readers to ask me question about UNPIVOT table. UNPIVOT table is reverse of PIVOT Table. USE AdventureWorks GO CREATE TABLE #Pvt ([CA] INT NOT NULL, [AZ] INT NOT NULL, [TX] INT NOT NULL); INSERT INTO #Pvt ([CA],…
Read More
Previous 1 … 518 519 520 521 522 523 524 … 580 Next
  • SQL Interview Q & A
  • Testimonials
  • Search
  • Privacy Policy

© 2006 – 2025 All rights reserved. pinal @ SQLAuthority.com