Created
March 17, 2012 17:52
-
-
Save rkitover/2063477 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use DBI; | |
use strict; | |
use warnings; | |
my $h = DBI->connect(@ENV{map "DBICTEST_MSSQL_ODBC_$_", qw/DSN USER PASS/}, | |
{RaiseError => 1, PrintError => 0} | |
); | |
eval { $h->do(q/drop table owners/); }; | |
$h->do(q/create table owners (id int identity (1,1) not null, name varchar(100))/); | |
my $s = $h->prepare_cached(<<"EOF"); | |
SET IDENTITY_INSERT owners ON | |
insert into owners (id, name) values (?,?) | |
SET IDENTITY_INSERT owners OFF | |
SELECT SCOPE_IDENTITY() | |
EOF | |
my @data = ([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15], | |
['wiggle', | |
'woggle', | |
'boggle', | |
'fRIOUX', | |
'fRUE', | |
'fREW', | |
'fROOH', | |
'fISMBoC', | |
'station', | |
'mirror', | |
'dimly', | |
'face_to_face', | |
'icarus', | |
'dream', | |
'dyrstyggyr']); | |
$s->execute_array(undef, @data); | |
eval { $h->do(q/drop table owners/); }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment