  
.container
  - client = TinyTds::Client.new(username: 'test', password: '@Chatenois!2017', host: '40.89.153.193', appname: "SQL4PS" , port: 1534, database: "JIPE")
  
  -result = client.execute("SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE'")
  -table_names = []
  -result.each do |row|
    -table_name = row["TABLE_NAME"]
    -if table_name.include?"JIPE$"
      -table_name = table_name #.sub("JIPE$", "")
      -table_names << table_name
  
  -result.cancel
  
  -i = 0
  -table_names.sort.each do |tn|
    -i+= 1

    =tn
    -if i <= 40000
      -r = client.execute("SELECT TOP 50 * FROM dbo.[#{tn}]")
      -if r.count > 0
        %hr
        %p=tn
        %table.table.table-striped
          %tr
            -ic = 0
            -r.each do |row|
              -ic += 1
              -if ic == 1
                -row.each do |k,v|
                  %th
                    =k
                
                
          -r.each do |row|
            %tr
              -row.each do |k,v|
                %td
                  -if v.class == String
                    =v.encode("UTF-8", :invalid => :replace, :undef => :replace)
                  -else
                    =v
                  
      -r.cancel
      