SQL SERVER – Inviting Ideas for SQL in Sixty Seconds – 12/12/12

Today is 12/12/12 – I am not sure when will I write this kind of date again – maybe never. This opportunity comes once in a lifetime when we have the same date, month and year all have same digit. December 12th is one of the most fantastic day in my personal life. Four years ago, this day I got married to my wife – Nupur Dave.  Here are photos of our wedding (Dec 12, 2008).

Here is a very interesting photo of myself earlier this year. It is not photoshoped or modified photo. The only modification I have done here is to add arrow and speech bubble.

Every Wednesday I tried to put one SQL in Sixty Seconds Video. The journey has been fantastic and so far I have put a total of 35 SQL in Sixty Seconds Video. The goal of the video is to learn something in 1 minute. In our daily life we are all very busy and hardly have time for anything. No matter how much we are busy – we all have one minute of time. Sometime we wait for a minute in elevators, at the escalator, at a coffee shop, or just waiting for our phone reboot.

Today is a fantastic day – 12/12/12. Let me invite all of you submits SQL in Sixty Seconds idea. If I like your idea and create a sixty second video over it – you will win surprise learning material from me. There are two very simple rules of the contest: -

  1. I should have not have already recorded the tip.
  2. The tip should be descriptive. Do not just suggest to cover “Performance Tuning” or “How to Create Index” or “More of reporting services”. The tip should have around 100 words of description explaining SQL Tip.

The contest is open forever. The winner will be announced whenever I use the tip to convert to video. If I use your tip, I will for sure mention in the blog post that it is inspired from your suggestion.

Meanwhile, do not forget to subscribe YouTube Channel.

Here are my latest three videos from SQL in Sixty Seconds.

Reference: Pinal Dave (http://blog.sqlauthority.com)

14 thoughts on “SQL SERVER – Inviting Ideas for SQL in Sixty Seconds – 12/12/12

  1. Hello Pinal,

    Let me take the privilege of commenting first and suggest few topics for SQL in sixty seconds.

    Topics :
    1. Working on SQL Profiler trace file
    2. Explaining common types of deadlock
    3. Monitoring Tempdb space
    4. Deadlock Graph event in SQL Trace
    5. How to view the SQL Server Error Log
    6. Detecting Memory Pressures
    7. Dynamic Management Views

    Wishing you a Happy Anniversary.

    -Vakul More.

    Like

  2. Hi Pinal,

    First of all Wedding day wishes to my SQL Guru. Once again we check with all the existing SQL sixty video and then suggest a topic with descriptive.

    Like

  3. Hi Pinal,

    Happy Wedding Anniversary! :)

    Please find below one of the ideas on which possibly many SQL Server beginners have issues with –

    Fixing Orphaned users after Restore on New instance.

    Scenario: During Upgrades or Migrations, often we would have to take backups of the current Databases and Restore the same on the New Instance. When some of the beginners do that, they often forget or are not aware of the fact that there may be users which existed in the previous instance and they do not exist on the new instance.

    A quick video on how to fix these orphaned users would be a great tutorial that would help them keep that in mind. :)

    Thanks.

    Like

  4. Hello Pinal,

    Here my two suggestions for videos SQL in sixty seconds.

    1- Get the max between multiple columns
    exemple , my table contain 4 columns Id, Date1, Date2 and Date3 and i want get the Max bettween then.

    I find solution very simple , do this request

    SELECT id, (SELECT MAX([Value]) FROM
    ( SELECT Date1 AS [Value]
    UNION ALL
    SELECT Date2
    UNION ALL
    SELECT Date3
    ) AS UnionSetMax
    ) AS MaxDate

    The column MaxDate Return the Max date between date1, date2 and date3

    2- Backup database with Script and Task Sckeduler

    create sql file “scriptbackup.sql” with content this cript
    Backup Database MyDatabaseTo Disk = ‘E:\Backup_Bdd\MyDatabase.bak’

    create file .bat “lancherbackup.bat” with content this command
    sqlcmd -E -S [Sever] -i E:\Backup_Bdd\scriptbackup.sql

    Like

  5. Hello Pinal,

    Here my two suggestions for videos SQL in sixty seconds.

    1- Get the max between multiple columns
    exemple , my table contain 4 columns Id, Date1, Date2 and Date3 and i want get the Max bettween then.

    I find solution very simple , do this request

    SELECT id, (SELECT MAX([Value]) FROM
    ( SELECT Date1 AS [Value]
    UNION ALL
    SELECT Date2
    UNION ALL
    SELECT Date3
    ) AS UnionSetMax
    ) AS MaxDate

    The column MaxDate Return the Max date between date1, date2 and date3

    2- Planifie Backup database with Script and Task Sckeduler

    create sql file “scriptbackup.sql” with content this cript
    Backup Database MyDatabaseTo Disk = ‘E:\Backup_Bdd\MyDatabase.bak’

    create file .bat “lancherbackup.bat” with content this command
    sqlcmd -E -S [Sever] -i E:\Backup_Bdd\scriptbackup.sql

    with the task sckeduler planifie the execution of the lancherbackup.bat.

    thanks

    Like

  6. Hi Pinal,

    Recently came to know very interesting bit when we do the “select count(*) from table”. Optimiser select very interesting plans when we have index on table and there there is no index.

    I always thought it will scan the table but I was wrong it does index scan when have index on table.

    I thought it is very interesting and hope you feel the same would share it.Please let me know if need I can send you demo code.

    Anyway Happy Wedding Anniversary.

    Thanks
    Nachi

    Like

  7. Hello ,

    Happy Aniversary to both of you!

    My first suggestion is not related to SQL.
    As you have earlier recored one video regarding how you record these videos. My Suggestion is related to this. Can you record a video about how you capture this image? (As you already told, this is not photoshoped or modified) :)

    Well, I will submit list of suggestion later after checking existing videos. (Related to SQL, this time :) )

    Like

    • Belated, but I am submitting some of my suggestions as mentioned in above comment. These could be useful to some beginner/intermediate users.
      1. Change Connection in Query Window : In SSMS, We can change DB by use command or DB Drop-down from SQL Editor Drop-down. But, for Change of DB Server/Instance in connection , “Change Connection” window can be opened by Query Menu /Context Menu -> Connection->Change Connection
      2. Import /Export Environment Settings: New feature in SSMS 2012. Backup of Environment Settings can be taken and restored.
      3. Writing a CLR Function . Based on your earlier post http://blog.sqlauthority.com/2008/10/19/sql-server-introduction-to-clr-simple-example-of-clr-stored-procedure/

      Like

  8. Hello Pinal,

    Belated Anniversary wishes to both of you :)

    Please find below one of the concept which I found to be very useful in one of our requirement.

    When a table is having unique index and if an attempt is made to insert duplicate data an error is thrown. Conventional method to insert data into such table from another table is to either use “NOT IN” or “NOT EXISTS”. But if the table, to which data insertion has to be made, has billions of records, there may be performance issues.
    In such cases “IGNORE_DUP_KEY” property can be used. By default, for a unique index the property is set to OFF. When this property is set to ON, it will issue a warning message when a duplicate key is inserted and the particular row is ignored and also continues with the transaction. There was a good performance by using this property since %age of duplicates were less

    Like

  9. Here a Tip,

    If you ever want to use TOP keyword with dynamic number
    DECLARE @count int
    SET @count=10

    SELECT TOP @count from Table

    This will throw error

    Try with
    SELECT TOP (@count) from Table

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s