 
 exports.xmlWithSchema = (test) ->
   # Cannot use temp tables, as schema collections as not available to them.
+  # Schema must be created manually in database in order to make this test work properly (sql 2012)
 
   xml = '<root/>'
 


  execSql(test, "#{dropTable} #{dropSchema} #{createSchema} #{createTable} #{insert} #{select}", xml)

execSql = (test, sql, expectedValue) ->
  test.expect(2)


  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)
