SQL Server – get all triggers

Here is an often used SQL statement to get a list of Triggers, in SQL Server. I’m posting this here for my own convenience and perhaps someone else will benefit. SELECT   [so].[name] AS sys_obj,   so.type,   USER_NAME([so].[uid]) AS obj_owner,   USER_NAME([so2].[uid]) AS table_schema,   OBJECT_NAME([so].[parent_obj]) AS table_name,   OBJECTPROPERTY( [so].[id], ‘ExecIsUpdateTrigger’) AS [isupdate],   OBJECTPROPERTY( [so].[id], ‘ExecIsDeleteTrigger’) AS [isdelete],   OBJECTPROPERTY( [so].[id], ‘ExecIsInsertTrigger’) AS [isinsert],   OBJECTPROPERTY( [so].[id], ‘ExecIsAfterTrigger’) AS [isafter],   OBJECTPROPERTY( [so].[id], ‘ExecIsInsteadOfTrigger’) AS [isinsteadof],  

Read more

Kettle PDI, Named Parameters, and Generic Database Connections

Kettle / PDI Generic SQL Server JTDS database with parameters and a Generic SQL Server Database Connection The purpose of using named parameters is to abstract out what parts of a database connection change, from one environment to another, and make that part of a configuration that can be maintained elsewhere.  For example,  for a given ETL to extract Appointment data, it might need to connect to different database servers, databases, and use different credentials in Development, QA, and Production. This

Read more

RoR: Using Yaml_db to copy Prod data/schema to Non-prod Environments

This morning, I took a snapshot of a production, Ruby on Rails database (via rake db:dump), and then applied the production / schema data to other environments.

    System information:

  • Database is Oracle 11
  • Application server runs Redhat Enterprise Linux
    Assumptions and challenges:

  • The Development and QA (Quality Assurance) instances are probably not at the same software revisions or migration version numbers. So… keep that in mind.
    Read more

Calling Ruby on Rails rake tasks through Appworx

I have a rake task “db:update_last_status”, which I need to have run on remote servers, nightly, to update cached status fields – which are used for fast search capabilities in an RoR application. The RoR application runs on Red Hat Enterprise Linux, an an Oracle database. It would be simple to script that with Cron, but that doesn’t lend itself to monitoring or work within the enterprise standards. Capistrano works great, but also isn’t within the Enterprise standards.

Read more