Module: ArJdbc::MsSQL::LimitHelpers

Included in:
ArJdbc::MsSQL
Defined in:
lib/arjdbc/mssql/limit_helpers.rb

Defined Under Namespace

Modules: SqlServer2000AddLimitOffset, SqlServer2000ReplaceLimitOffset, SqlServerAddLimitOffset, SqlServerReplaceLimitOffset

Class Method Summary collapse

Class Method Details

.get_table_name(sql) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/arjdbc/mssql/limit_helpers.rb', line 5

def get_table_name(sql)
  if sql =~ /^\s*insert\s+into\s+([^\(\s,]+)\s*|^\s*update\s+([^\(\s,]+)\s*/i
    $1
  elsif sql =~ /\bfrom\s+([^\(\s,]+)\s*/i
    $1
  else
    nil
  end
end