Skip to content

Commit

Permalink
Making some notes about [date], [datetime2], [datetimeoffset] and [ti…
Browse files Browse the repository at this point in the history
…me] data types.
  • Loading branch information
metaskills committed Jul 27, 2011
1 parent f0f1027 commit 13d22f1
Showing 1 changed file with 48 additions and 27 deletions.
75 changes: 48 additions & 27 deletions test/schema_test.rb
Expand Up @@ -242,33 +242,54 @@ class SchemaTest < TinyTds::TestCase

context 'for 2008 and up' do

should 'cast date' do

end

should 'cast datetime2' do

end

should 'cast datetimeoffset' do

end

should 'cast geography' do

end

should 'cast geometry' do

end

should 'cast hierarchyid' do

end

should 'cast time' do

end
# These data types always come back as SYBTEXT and there is no way I can
# find out the column's human readable name.
#
# * [date]
# * [datetime2]
# * [datetimeoffset]
# * [time]
#
# I have tried the following and I only get back either "char" or 0/null.
#
# rb_warn("SYBTEXT: dbprtype: %s", dbprtype(coltype));
# rb_warn("SYBTEXT: dbcolutype: %s", dbcolutype(rwrap->client, col));
# rb_warn("SYBTEXT: dbcolutype: %ld", dbcolutype(rwrap->client, col));

# should 'cast date' do
# value = find_value 51, :date
# assert_equal '', value
# end
#
# should 'cast datetime2' do
# value = find_value 72, :datetime2_7
# assert_equal '', value
# end
#
# should 'cast datetimeoffset' do
# value = find_value 81, :datetimeoffset_2
# assert_equal '', value
# end
#
# should 'cast geography' do
# value = find_value 111, :geography
# assert_equal '', value
# end
#
# should 'cast geometry' do
# value = find_value 121, :geometry
# assert_equal '', value
# end
#
# should 'cast hierarchyid' do
# value = find_value 131, :hierarchyid
# assert_equal '', value
# end
#
# should 'cast time' do
# value = find_value 283, :time_7
# assert_equal '', value
# end

end if sqlserver_2008? || sqlserver_azure?

Expand Down

0 comments on commit 13d22f1

Please sign in to comment.