I have a project where I need to build a two tables in sql 2005 and fill them with data (they are look-up tables for weather a name is a male's name or a female's name) I have 7354 male names to insert and 7776 female names to insert.
currently I do it
CREATE TABLE #NamesMale (
[FirstName] [varchar](50) NOT NULL,
[MaxRank] [smallint] NULL)
CREATE TABLE #NamesFemale (
[FirstName] [varchar](50) NOT NULL,
[MaxRank] [smallint] NULL)
insert into #NamesMale select 'AADEN',343
insert into #NamesMale select 'AAPELI',1000
insert into #NamesMale select 'AAPO',1000
... (snip ~7300 lines)
insert into #NamesMale select 'ZVONIMIR',1000
insert into #NamesMale select 'ZVONKO',1000
insert into #NamesMale select 'ZYGMUNT',1000
insert into #NamesFemale select 'AALIYAH',64
insert into #NamesFemale select 'AAREN',1000
insert into #NamesFemale select 'AARON',873
... (snip ~7700 lines)
insert into #NamesFemale select 'ZUZANA',1000
insert into #NamesFemale select 'ZUZANNA',1000
insert into #NamesFemale select 'ZVONIMIRA',1000
It currently takes a one minute fourteen seconds to load the names on my machine and where this will be used in the field the servers will often be much less powerful than my dev machine.
using a separate bulk copy file is not a option, the solution must be entirely transact-sql and in one file. Preferably I would like a solution that does not break compatibility with sql2000 but that is not a requirement.
Any help would be greatly appreciated.