 
   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)
 

  execSql(test, "select cast(null as ntext) as text", null)

exports.image = (test) ->
  execSql(test, "select cast(0x1234 as image)", [0x12, 0x34])

exports.imageNull = (test) ->
  execSql(test, "select cast(null as image)", null)

  execSql(test, "select cast(null as nvarchar(max))", null)

exports.varbinary = (test) ->
  execSql(test, "select cast(0x1234 as varbinary(4))", new Buffer [0x12, 0x34])

exports.varbinaryNull = (test) ->
  execSql(test, "select cast(null as varbinary(10))", null)

exports.binary = (test) ->
  execSql(test, "select cast(0x1234 as binary(4))", new Buffer [0x12, 0x34, 0x00, 0x00])

exports.binaryNull = (test) ->
  execSql(test, "select cast(null as binary(10))", null)

exports.varbinaryMax = (test) ->
  execSql(test, "select cast(0x1234 as varbinary(max))", new Buffer [0x12, 0x34])

exports.varbinaryMaxNull = (test) ->
  execSql(test, "select cast(null as varbinary(max))", null)
