In order to simulate an

In order to simulate an enterprise environment we cooked up a company, complete with customers, products and even order histories. But in order to make it come to life, I've spent the last week in a fugue, moving from PERL...

September 12, 2002

2 Min Read
Network Computing logo

In order to simulate an enterprise environment we cooked up a company, complete with customers, products and even order histories. But in order to make it come to life, I've spent the last week in a fugue, moving from PERL to shell script and back, generating megabytes of simulated everything.

Some of the work I've done on Linux in MySQL and need to migrate to SQL Server. Defining the databases was simple, and you'd think all you'd need to do then is dump the data and import into SQL Server.

Not true. Oh not true at all. SQL Server choked on integer columns with lengths, and absolutely would not accept the "auto_increment" attribute. Well, it's only a few tables, so I edited the files to make SQL server happy and then redefined the tables within Enterprise Manager.

Then I tried to import the actual data. isql, the CLI for SQL Server, did not like the generated files designed to do bulk inserts. I fixed them one by one and managed to import the smaller ones. But I hit a snag I couldn't get around - "out of memory" . 1GB of RAM on this beefy machine and it's out of memory importing 200,000 rows?

Eegads. I was in trouble. The last two files had 200,000 and 600,000 records each, respectively. I moved to DTS to pull the data.

The first one took some modification to the table. What the heck is the difference between a datetime and a smalldatetime? Argh! Finally, I was ready to try the last file. Alas, it was not to be completed today. The PERL script that had generated the customer data was not perfect. It missed some enclosing quotes. vi and regular expressions are your friend, unless you're dealing with a 35MB file. Scratch that. Write a quick shell script to modify the data and set it to running. We'll get that customer data in tomorrow.

SUBSCRIBE TO OUR NEWSLETTER
Stay informed! Sign up to get expert advice and insight delivered direct to your inbox
More Insights