 
   execSql(test, "#{dropTable} #{dropSchema} #{createSchema} #{createTable} #{insert} #{select}", xml)
 
+exports.udt = (test) ->
+  execSql(test, "select geography::STGeomFromText('LINESTRING(-122.360 47.656, -122.343 47.656 )', 4326) as geo", new Buffer [230,16,0,0,1,20,135,22,217,206,247,211,71,64,215,163,112,61,10,151,94,192,135,22,217,206,247,211,71,64,203,161,69,182,243,149,94,192])
+
+exports.udtNull = (test) ->
+  execSql(test, "select cast(null as geography)", null)
+
 execSql = (test, sql, expectedValue) ->
   test.expect(2)
 


exports.xmlWithSchema = (test) ->
  # Cannot use temp tables, as schema collections as not available to them.

  xml = '<root/>'


  request.on('row', (columns) ->
    if expectedValue instanceof Date
      test.strictEqual(columns[0].value.getTime(), expectedValue.getTime())
    else if expectedValue instanceof Array or expectedValue instanceof Buffer
      test.deepEqual(columns[0].value, expectedValue)
    else
      test.strictEqual(columns[0].value, expectedValue)
