This is a small collection of demonstrations files on how to use the MSSQL classes. Some of these were culled from the Sybperl distribution. You may want to edit them to change user, password or server.

bcp.pl, bcp.dat - a simple demo on how to use bcp.

dbschema.10.pl, dbschema.old.pl - dbschema is supposed to generate a script of a database. I've adapted it from Sybperl so far that it runs and produces an output. The output is bogus, though, presumably due to that the system tables in Sybase 10/11 do not look exactly as those of MSSQL 6.x.

dbtext.pl - an example on how to use dbwritetext. If you want to see samples on how to use the other text functions, please see dblib\t\3_text.t.

rpctest.pl - an elaborate example on using the RPC routines directly from Perl. (It is easier to use sql_sp sp in MSSQL::Sqllib. :-)

sptritest.bat - this is actually a useful utilility. (And don't get fooled by the extension. It's just a Perl script wrapped into a BAT file.)

SPTRITEST runs each stored procedure and trigger in a database and accesses all views. Nonsens values are used as parameters. SPTRITEST reports all errors that occurs. Well almost all, some errors that are likely to be due to the nonsense values are filtered away. What you should look for are errors that are due to incorrect SQL, for instance joins between different user-defined datatypes, errors that SQL Server does not detect at CREATE time. Thus, SPTRITEST for helping to find problems in your database, before the problems find you.

WARNING! Don't run SPTRITEST in a database with data you care about. SPTRITEST do not try to clean up the nonsense it might insert.

sqllib-simple.pl - a simple example of using the MSSQL::Sqllib module.

sqllibtest.pl - a script which uses MSSQL::Sqllib in several ways. It used to be my test script, before I wrote the real test scripts. You couldn't say that the script makes much sense, but you might find something.

statistics.pl - a simple example of a message handler where we catch messages from SET STATISTICS IO/TIME.

who.pl - a simple example on a report with MSSQL::DBlib which also shows how to use MSSQL::DBlib for a simple query. It produces an awful lot of warnings when run with -w, though.


Last updated 01-05-01 22:41