Your strings should be stored in two text files R1.txt and R2.txt. The files should contain two, tab-separated columns. The first column contains the tuple id tid, and the second column contains the string str. The first line of the text files should contain the name of the columns. The SQL script ignores the first line and does not import it into the RDBMS.
Download the SQL script import.sql, for importing the data, or use the code below.
You can run the script as isql -U <user> -P <passwd> -d <database name> -i import.sql
-- Import the original data -- Assume tab-separated files with field names on the first row. -- The rows should have format <tuple id>\t<string> -- The first row contains the headers. CREATE TABLE [dbo].[R1] ( [tid] int NOT NULL, [str] varchar (100) NOT NULL, PRIMARY KEY (tid) ) CREATE TABLE [dbo].[R2] ( [tid] int NOT NULL, [str] varchar (100) NOT NULL, PRIMARY KEY (tid) ) BULK INSERT [dbo].[R1] FROM 'R1.txt' WITH ( DATAFILETYPE = 'char', FIELDTERMINATOR = '\t', ROWTERMINATOR = '\n', FIRSTROW = 2 ) BULK INSERT [dbo].[R2] FROM 'R2.txt' WITH ( DATAFILETYPE = 'char', FIELDTERMINATOR = '\t', ROWTERMINATOR = '\n', FIRSTROW = 2 ) GO |