{"id":281,"date":"2012-04-16T17:31:37","date_gmt":"2012-04-16T16:31:37","guid":{"rendered":"http:\/\/www.nax.cz\/?p=281"},"modified":"2012-04-16T17:31:37","modified_gmt":"2012-04-16T16:31:37","slug":"describe-table-on-sybase-db","status":"publish","type":"post","link":"https:\/\/nax.cz\/?p=281","title":{"rendered":"describe table on sybase db"},"content":{"rendered":"<p>I needed to find out types of columns in one sybase database. Usual SQL standard &#8222;describe table&#8220; didn&#8217;t work. I google a bit and found <a href=\"http:\/\/www.tek-tips.com\/viewthread.cfm?qid=1112314\">this solution<\/a>.<\/p>\n<p>Single command list all db objects:<br \/>\n<code><br \/>\nkfsql-1) sp_help;<br \/>\nName                           Owner                          Object_type<br \/>\n------------------------------ ------------------------------ ----------------------<br \/>\nINSTANCES                      dbo                            view<br \/>\nmyapp_Audit                   dbo                            user table<br \/>\nmyapp_Bindings                dbo                            user table<br \/>\nmyapp_CPSInstances            dbo                            user table<br \/>\n...<br \/>\n(48 rows affected)<br \/>\nUser_type       Storage_type         Length Nulls Default_name    Rule_name       Access_Rule_name<br \/>\n--------------- --------------- ----------- ----- --------------- --------------- ----------------<\/p>\n<p>Class_name                     Jar_name<br \/>\n------------------------------ ------------------------------<\/p>\n<p>Jar_name<br \/>\n------------------------------<\/p>\n<p>(return status = 0)<br \/>\n<\/code><\/p>\n<p>When you add table name, it gives you lot of details for that table, including types of columns:<br \/>\n<code><br \/>\nkfsql-1) sp_help myapp_Instances;<br \/>\nName                           Owner                          Object_type<br \/>\n------------------------------ ------------------------------ --------------------------------<br \/>\nmyapp_Instances             dbo                            user table<\/p>\n<p>(1 row affected)<br \/>\nData_located_on_segment        When_created<br \/>\n------------------------------ ------------------------<br \/>\ndefault                        Feb  2 2007  9:41PM<\/p>\n<p>(1 row affected)<br \/>\nColumn_name                    Type                                Length Prec Scale Nulls Default_name                   Rule_name                      Access_Rule_name               Identity<br \/>\n------------------------------ ------------------------------ ----------- ---- ----- ----- ------------------------------ ------------------------------ ------------------------------ --------<br \/>\nid                             int                                      4 NULL  NULL     0 NULL                           NULL                           NULL                                  1<br \/>\nname                           varchar                                 40 NULL  NULL     0 NULL                           NULL                           NULL                                  0<br \/>\nmsgInstance                    int                                      4 NULL  NULL     1 NULL                           NULL                           NULL<br \/>\n...<br \/>\n(18 rows affected)<br \/>\nindex_name           index_description ...<br \/>\n...<br \/>\n(2 rows affected)<br \/>\nNo defined keys for this object.<br \/>\nObject is not partitioned.<br \/>\nLock scheme Datarows<\/p>\n<p>exp_row_size reservepagegap fillfactor max_rows_per_page identity_gap<br \/>\n------------ -------------- ---------- ----------------- ------------<br \/>\n           0              0          0                 0            0<\/p>\n<p>(1 row affected)<br \/>\nconcurrency_opt_threshold optimistic_index_lock dealloc_first_txtpg<br \/>\n------------------------- --------------------- -------------------<br \/>\n                       15                     0                   0<br \/>\n<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I needed to find out types of columns in one sybase database. Usual SQL standard &#8222;describe table&#8220; didn&#8217;t work. I google a bit and found this solution. Single command list all db objects: kfsql-1) sp_help; Name Owner Object_type &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- INSTANCES dbo view myapp_Audit dbo user table myapp_Bindings dbo user table myapp_CPSInstances dbo user [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-281","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/nax.cz\/index.php?rest_route=\/wp\/v2\/posts\/281","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nax.cz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nax.cz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nax.cz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nax.cz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=281"}],"version-history":[{"count":0,"href":"https:\/\/nax.cz\/index.php?rest_route=\/wp\/v2\/posts\/281\/revisions"}],"wp:attachment":[{"href":"https:\/\/nax.cz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=281"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nax.cz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=281"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nax.cz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=281"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}