Hi, in an upcoming engagement I will need to use T-SQL instead of SAS and PROC SQL. Has anyone used T-SQL before? If so, are there any important differences in syntax that might be of value to know beforehand. Also, is there a resource that I can refer to that might show me how a certain query might be written differently in T-SQL compared to PROC SQL.
The T-SQL will be used primarily for querying and reporting purposes rather than database administration purposes.
T-SQL is Microsoft so there's tons of documentation and examples out on the web.
Biggest difference - look into Windowing function
Thanks @Reeza. Will look into the difference in the Windowing function.
It's not so much difference as something SAS doesn't have.
And Pivot? Or is that Oracle? Look into how they do processing over groups basically, besides group by.
Thank you for your input @LinusH. This is great I'm sure I will learn more along the way. One difference I chanced upon recently was with the AS keyword while assigning Aliases.
The AS keyword is recommended but can be omitted while assigning an Alias in T-SQL.
Not having the AS keyword while assigning an Alias in PROC SQL causes an error.
Another minor difference is while eliminating duplicate rows:
The DISTINCT keyword is common between T-SQL and PROC SQL. PROC SQL also has an alternative, the UNIQUE keyword. This, I believe, isn't available in T-SQL.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.