[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Sheflug] Perl on linux and MS SQL



On Mon, Mar 24, 2003 at 04:08:15PM -0000, Kevin Barrass wrote:
> Iam looking at converting a network monitor program I have written in perl
> from using text files to store data to using a Microsoft SQL 2000 server on
> Windows 2000 Advanced Server, as my text files are getting a tead big and
> slow :)

Hmm. MS-SQL 2k is probably overkill for that task :)

> Does Anyone have any experience of this such as wich perl modules to use
> what to do and not do and any experience of pitfalls etc.
> Any Links on Internet to Docs that might help would be much appreciated.

Yup, I've done it (a number of times).

You can choose between Win32::ODBC (okay, but not great) or DBI - go for
the DBI option (you may have to use the Sybase TDS driver, but it works
just as well). If you have fairly simple text files (ie., tab delimeted)
writing the import will be as easy as BULK INSERT .. 

The nice thing about the DBI interface is you'll find your app would be
fairly portable. For even nicer portability and a non-SQL interface, you
might want to investigate Class::DBI - that will insulate you completely
from the storage method of the data, and makes things a lot lot simpler.

All of these modules, and the documents for them, can be found on the CPAN
(http://search.cpan.org/)

Cheers,

Alex.
___________________________________________________________________

Sheffield Linux User's Group -
http://www.sheflug.co.uk/mailfaq.html

  GNU the choice of a complete generation.