Earlier I used to do Milestone blog posts where at the interval I used to celebrate achievements. However, as time passed the achievements changes their value and importance. We all grow more and more and our priorities are different. However, today I have come across a very interesting milestone! This is my 2200th blog post as well today is our 22nd Episode of SQL in Sixty Seconds Series.
SQL in Sixty Seconds series was started with the a very simple concept. Learn something in a very short period of the time. Our life is very busy, we move pretty fast now a days. We do not have enough time to sometime to learn something new. In this SQL in Sixty Seconds the goal is to learn something on the go! Well, it seems that it has worked a quite well because as our SQL in Sixty Seconds Channel is very popular and most of the video have 1000+ views. I thank Vinod Kumar and Rick Morelan for their contribution in this Sixty Seconds Video.
One of the most popular questions which I receive is how do I do this video and what kind of equipment I use for the same. In today’s SQL in Sixty Seconds we are going to see the same. This video is by my Nupur Dave, she recorded it while I was actually recording SQL in Sixty Seconds.
[youtube=http://www.youtube.com/watch?v=4sIFSUa2JhM]
Watch Last 5 Episodes of SQL in Sixty Seconds:
- Generate Script for Schema and Data in SQL Server – SQL in Sixty Seconds #021Â
- Remove Debug Button in SQL Server Management Studio – SQL in Sixty Seconds #020Â
- Three Tricks to Comment T-SQL in SQL Server Management Studio – SQL in Sixty Seconds #019Â
- Importing CSV into SQL Server – SQL in Sixty Seconds #018 Â
- Tricks to Replace SELECT * with Column Names – SQL in Sixty Seconds #017
I encourage you to submit your ideas for SQL in Sixty Seconds. We will try to accommodate as many as we can.
If we like your idea we promise to share with you educational material.
Reference:Â Pinal Dave (https://blog.sqlauthority.com)
7 Comments. Leave new
Nice pinal sir
one more question pinal sir, which software do you use for recording? Camtacia?
Hi Pinal
In Principal database user tables are missing (not appearing ) my boss was asking why it happend, what are causes on this .
I have checked all logs but no luck can you please suggest me
How can i find out what are the reasons here .
Tx
nice setup…. boss…. :) I would like to have one in future for sure.
Hi Pinal – here’s an idea for a 60 second video: The other day after looking at your SQL post on “how to get the top and bottom row in a result set” I had to do something similar, only harder. I had to pull the MAX date from 2 unrelated tables, then find out which of those were actually the most recent, AND be able to pull that single record into a later query as one of the pieces of data in a Select statement.
(I needed this to find out the most recent update to the database so we could say how recently the inventory counts and values had been last adjusted.)
I couldn’t get it to work as a subquery so I ended up creating a temp variable table, then querying that temp variable for it’s max record. Code follows:
BEGIN TRANSACTION
— create temp variable table
declare @TempMaxUpdate TABLE (LastUpdate smalldatetime)
— Find most recent Purchase Order Date
Insert into @TempMaxUpdate
select max(ReceivedDate) LastUpdate
from Porders2
— Find most recent Work Order Date
Insert into @TempMaxUpdate
select MAX(WoMaster.CompletedTime) LastUpdate
from WoMaster
Then in my following select statement I can just include as an item the MAX of those 2 values now in the temp variable like so:
INSERT INTO [Inventory_Totals]
(ReportDate, LastTransactionDate, ItemCount, PartsCount,TotalCost_QtyOnHand, TotalCost_MinOnHand, TotalCost_MaxOnHand, SourceDB, Notes)
SELECT
GETDATE()
,(select MAX(LastUpdate) from @TempMaxUpdate)
,COUNT(*)
,SUM(QuantityOnHand)
,SUM(QuantityOnHand * CurrentCost)
,SUM(MinimumOnHand * CurrentCost)
,SUM(MaxOnHand * CurrentCost)
,DB_NAME()
,’Test of InvTot_ID auto fill in’
FROM Parts
GO
COMMIT TRANSACTION
And there you have it. An “on the fly” method of grabbing non-related data and then pulling from that set as needed. And as a temp variable I think it’s destroyed after the commit as well.
How much will such podcaster cost?