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