All Forums Database
bree_l 1 post Joined 08/14
11 Aug 2014
New to Teradata from T-SQL

Good Morning All,
I've just changed roles. I've got about 4 years experience with MS SQL Server (T-SQL) and my new role uses Teradata.
I'm sure I'm not the first person who has made this change, and was wondering if anyone has a cheat sheet for common functions and operators translated from T-SQL to TD. (As I'm sure everything I could do in MSSMS, I can do in TD Sql Assistant  as far as cutting code)
I've started noticing things in TD are quite different (working with dates in example). Doing a simple DATEDIFF calculation seems very complex in TD (though, I could just be reading poor forum posts).
From my reading, It's also become apparent that it isn't possible to declare variables ? i.e.
DECLARE @Startdate DATE = '2014-08-04';
DECLARE @Enddate DATE = '2014-08-10';
I typically like to use dates in my where clause to limit my data. I read one solution was to create temporary tables and join to them to achieve the same as a declare statement? Is this correct?
Any advice would be ablsolutely terrific.

shelleybobelly 1 post Joined 09/14
21 Mar 2015

Haha I found this blog to be very helpful. Looks like you kind of have to do it in a Teradata Macro (which is like a stored proc on TSQL). Your answer is about 3/4 down.  I'm in the same boat as you, only with about 17 years TSQL, so good luck to you!


You must sign in to leave a comment.