web analytics

Category: Databases

Killing Locked Sessions in Oracle 2

Killing Locked Sessions in Oracle

Many a times user sessions are locked in some DML/DDL operation, than how to unlock those sessions because a new step or operation could not be done on the specific object that is locked....

Creating Custom Functions in Oracle 0

Creating Custom Functions in Oracle

Here it is a simple procedure to create and call a custom function in Oracle. A custom function is a simple PL/SQL subprogram that is used to calculate a value. It creation syntax is...

How to check Numeric value in Oracle 0

How to check Numeric value in Oracle

Currently i could not find any suitable function for checking numeric value on some column. There are many workarounds to achieve this functionality, either cast the column value in Numeric and check, but this...

Validating string for numeric values in SQL Server 0

Validating string for numeric values in SQL Server

What to do when you have a large string and you have to validate whether this string only contain digits or not. A straight thing that comes in our mind is to use a...

Find week start/end given week number 0

Find week start/end given week number

I have a table with some dated records. I wanted to do some weekly reports on this data. MySQL has a nifty function dubbed WEEK() which will return a week number. It allows you...

MINUS query in MySQL 0

MINUS query in MySQL

Mysql does not support MINUS operator which is not the end of the world. For most queries you can really care less if it’s implemented or not. My web app never needs to use...

SQL Server permissions 0

SQL Server permissions

Permissions on data are one of the most critical aspects of database administration. If you’re too strict as a database administrator then your users will not be able to do their jobs. If you’re...

How To Calculate the Number of Week Days Between two Dates 1

How To Calculate the Number of Week Days Between two Dates

If the start date and end date are both week days, then the total number of week days in between is simply: (total difference in days) – (total difference in weeks) * 2 DateDiff(dd,...

SQL Server Version 0

SQL Server Version

If you need to know the version you are currently running of SQL Server you can easily get it by running the following query. SELECT ‘ SQL Server ‘ + CONVERT ( varchar (...

Simple script to backup all SQL Server databases 0

Simple script to backup all SQL Server databases

Problem Sometimes things that seem complicated are much easier then you think and this is the power of using T-SQL to take care of repetitive tasks. One of these tasks may be the need...