Data Podcast

By Rajib Bahar at June 15, 2017 02:32
Filed Under: Data, Data Podcast, Database, Podcast, SQL, SQL Server, Big Data, Data Science, Analytics

Last few months Shabnam, & I were working on creating a podcast. Our podcast brings industry experts working in various Data practices. We focus on topics related to Big Data, Data Science, Database technologies, RDBMS. Many thanks to our colleagues & friends for their support in this initiative.

 

Here are links to our podcast:

Soundcloud -> https://soundcloud.com/data-podcast

iTunes -> https://itunes.apple.com/us/podcast/data-podcast/id1247751397?mt=2

Set Operation trick to generate date data #TSQL2sDay

By Rajib Bahar at December 08, 2009 17:52
Filed Under: SQL

Two things that happened today, which motivated me to write this post: 

1. I learned a new trick using set-operation

2. Also today is the day some of my SQL Server colleagues having #TSQL2sDay party

 

Here is the entry where I learned the trick [http://ask.sqlteam.com/questions/1206/insert-date-value-for-1-year]. 

 

I have been participating at AskSqlTeam.com lately. One of the recent question was about how to generate date for 1 year. TG had an interesting solution and I did not realize it was set-operation until Kristen set me straight. :) As usual, I was coming up with a iterative solution as opposed to set-based one. Here is the snippet I modified off of TG's code.

create table #myTable 
(dateCol datetime)
go
declare @i int
SET @i = 0
WHILE 
(
 datediff(year, dateadd(day, @i,'2010-01-01'),'2010-01-01')=0
)
begin
    insert #myTable (dateCol)
    select dateadd(day, @i, '2010-01-01')
    SET @i = @i + 1
    continue
end
go
select * from #myTable
go


The script above will create about 365 entries containing everyday of the year 2010. 

TG's answer to that problem was:

create table #myTable 
(dateCol datetime)
go
insert #myTable (dateCol)
select dateadd(day, number, '2010-01-01')
from   master..spt_values
where  type = 'P'and    number < 365
order by number
go
select * from #myTable
go

 

Anyways, my approach above is not the most ideal solution and it will be slow because of the looping. TG had the right idea. Many DB professional create a reference database for their tasks. In this database one may have scripts that can be applied on scheduled jobs and other artifacts that don't belong anywhere else. The solution above can be improved if we create a reference table containing all integers. Let's say we call that table IntValues. I started building that table today and it took more than 6 hours to enter 2 billion numbers. Here is the final draft of what that script would look like.

 

create table #myTable 
(dateCol datetime)
go
insert #myTable (dateCol)
select dateadd(day, number, '2010-01-01')
from   DbReference.dbo.IntValues
where  number < 365
order by number
go
select * from #myTable
go

My YouTube VLOG

By Rajib Bahar at December 13, 2008 22:16
Filed Under: SQL

I have 2 YouTube Video Log or VLOG.

One is work related and called the icsql channel. The clip below talks about SSIS script component changes:

My other VLOG is related to art and volunteer works I do around the community. I volunteer some of my free time to KFAI radio these days. Here is a radio interview I did with some notable friends like Matt Harding, Palbasha Siddiqui, and Garry Schyman:

 

Trying to claim my blog at Technocrati

By Rajib Bahar at December 05, 2008 13:08
Filed Under:
Technocrati requires a link back to them... Here is the link Technorati Profile.

SQL Data Auditor program

By Rajib Bahar at December 03, 2008 06:27
Filed Under: SQL, .NET

My team and I have been working on building an enterprise tool to audit data in SQL Server. The 1st CTP permits you to remove redundant data. Other features will be available later. It is available for download at http://www.icdotnet.com.

Here is a screenshot: .

Welcome

By Rajib Bahar at November 25, 2008 10:42
Filed Under:
Welcome to my blog site. Just restarting the blog...

Tag cloud

Month List