Oracle TO_CHAR to SQL Server CONVERT Equivalents to change Date to String

Transact SQL (T-SQL) When it comes to SQL I tend to lean on the SQL I have used the most over the years, which is Oracle.  Today was no exception, I found myself trying to use the TO_CHAR command in SQL Server to format a date, which of course does not work. So, after a … Continue reading Oracle TO_CHAR to SQL Server CONVERT Equivalents to change Date to String

SQL server table Describe (DESC) equivalent

Transact SQL (T-SQL) Microsoft SQL Server doesn’t seem have a describe command and usually, folks seem to want to build a stored procedure to get the describe behaviors.  However, this is not always practical based on your permissions. So, the simple SQL below will provide describe like information in a pinch.  You may want to … Continue reading SQL server table Describe (DESC) equivalent

Netezza / PureData – How To Get A List Of When A Store Procedure Was Last Changed Or Created

In the continuing journey to track down impacted objects and to determine when the code in a database was last changed or added, here is another quick SQL, which can be used in Aginity Workbench for Netezza to retrieve a list of when Store Procedures were last updated or were created. SQL List of When A Stored Procedure was … Continue reading Netezza / PureData – How To Get A List Of When A Store Procedure Was Last Changed Or Created

Netezza / PureData – How To Get a SQL List of When View Was Last Changed or Created

Sometimes it is handy to be able to get a quick list of when a view was changed last.  It could be for any number of reason, but sometimes folks just lose track of when a view was last updated or even need to verify that it hadn't been changed recently.  So here is a quick … Continue reading Netezza / PureData – How To Get a SQL List of When View Was Last Changed or Created

Netezza / PureData – Table Describe SQL

If you want to describe a PureData / Netezza table in SQL, it can be done, but Netezza doesn’t have a describe command.  Here is a quick SQL, which will give the basic structure of a table or a view.  Honestly, if you have Aginity Generating the DDL is fast and more informative, at least … Continue reading Netezza / PureData – Table Describe SQL

Aginity For Netezza – How to Generate DDL

How to Generate Netezza Object DDL In ‘Aginity for Netezza’ this process is easy, if you have a user with sufficient permissions. The basic process is: In the object browser, navigate to the Database select the Object (e.g. table, view, stored procedure) Right Click, Select ‘Script’ > ‘DDL to query window’ The Object DDL will … Continue reading Aginity For Netezza – How to Generate DDL

Netezza / PureData – Substring Function Example

The function Substring (SUBSTR) in Netezza PureData provides the capability parse character type fields based on position within a character string. Substring Functions Basic Syntax SUBSTRING Function Syntax SUBSTRING(<<CharacterField>>,<< StartingPosition integer>>, <<for Number of characters Integer--optional>>)   SUBSTR Function Syntax SUBSTR((<>,<< StartingPosition integer>>, <>)   Example Substring SQL Substring SQL Used In Example SELECT  LOCATIONTEXT … Continue reading Netezza / PureData – Substring Function Example