CodeSmith Community
Your Code. Your Way. Faster!

Sybase Adaptive Server Enterprise 12.5 Schema Provider update

Latest post 11-02-2004 12:14 AM by rgelb. 0 replies.
  • 11-02-2004 12:14 AM

    • rgelb
    • Top 200 Contributor
    • Joined on 01-15-2004
    • Posts 22
    • Points 375

    Sybase Adaptive Server Enterprise 12.5 Schema Provider update

    This is an update to the Sybase ASE 12.5 Schema Provider, that was originally posted to here:
    http://www.ericjsmith.net/codesmith/forum/default.aspx?f=10&m=3711

    Updates:
    1. It acts more like the MS SQL Server Schema Provider in many ways. For instance, if you access the PrimaryKey object of the SourceTable object and the table doesn't have the primary key, it will return NULL. Previously it did not.

    2. I've added all the standard column ExtendedProperties that MS SQL Server has, even if Sybase doesn't support them, so the templates that rely on them will run as expected.

    CS_Default (used to be default)
    CS_IsIdentity
    CS_IdentitySeed (not supported by sybase. It's set to 1 if the column is an identity, 0 if it is not)
    CS_IdentityIncrement (not supported by sybase. It's set to 1 if the column is an identity, 0 if it is not)
    CS_Description (not supported by sybase. It's set to "")
    CS_IsRowGuidCol (not supported by sybase. It's set to false)
    CS_IsComputed (not supported by sybase. It's set to false)
    CS_IsDeterministic (not supported by sybase. It's set to true)

    3. The provider now handles the user-defined data types for tables, views and stored procs. It resolves them to the native data types.

    Notes:
    The attached zip includes the source and the binary. The binary is at the root folder of the zip file and is called SchemaExplorer.SybaseAseSchemaProvider.dll
    I recommend compiling the provider rather than using the provided binary. The reason for it is that Sybase has gone through
    many revisions of their ADO.NET driver and not all of them are binary compatible. The provider SchemaExplorer.SybaseAseSchemaProvider.dll is built against version 1.0.159.0 of the ADO.NET driver. Try the provided binary, if it doesn't work, then recompile against your driver.
    I've tested it with a bunch of templates and they all seem to work properly.
    The provider was written for Sybase ASE 12.5, but it will work with Sybase ASE 11.x and 12.0 for most operations. See the notes at the top of SybaseAseSchemaProvider.cs for information

    Dependencies:
    You will need the Sybase ASE ADO.NET Data Provider. You can download this from Sybase (if you are a registered user). The software is also available from the Sybase ASE 12.5 SDK. You can also probably get it when you download the trial version of the database server.

    How to make it work/compile:
    I've compiled in vs.net 2003.
    Per Eric's instructions, drop the binary into CodeSmith folder. If you choose not to install Sybase ADO.NET driver into the global assembly (early versions didn't), you should also drop Sybase.Data.AseClient.dll into the CodeSmith directory.

    Bugs:
    There might be bugs, since my pattern of usage probably differs from yours. The fastest way to get of a hold of me is to email to rgelb at vbrad.com

    Props:
    Thanks to Stan McFarland for bug extensive triaging. For other acknoledgements, see the top of SybaseAseSchemaProvider.cs
    • Post Points: 35
  • 11-02-2004 2:29 AM In reply to

    RE: Sybase Adaptive Server Enterprise 12.5 Schema Provider update

    Robert,

    Great job! I am using CodeSmith 2.6 and the Sybase ASE ADO.NET driver version 1.1.376.0. I had to compile the schema provider myself, then things worked as expected. I have to write code against SQL Server databases and Sybase ASE databases. This will really help out. Now I will be able to use the same templates to derive code from either backend. Thanks for the update!

    Thanks to Eric for a fantastic product! It is great to use a product that was written with the foresight to be extensible in this way. I can't wait to show others at my work the coolness of CodeSmith! scool

    Stan

    • Post Points: 5
Page 1 of 1 (2 items) | RSS
Copyright © 2008 CodeSmith Tools, LLC
Powered by Community Server (Commercial Edition), by Telligent Systems