dbTalk Databases Forums  

Query Analyzer - Join data in a text file to a SQL Server table

microsoft.public.sqlserver.tools microsoft.public.sqlserver.tools


Discuss Query Analyzer - Join data in a text file to a SQL Server table in the microsoft.public.sqlserver.tools forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Query Analyzer User
 
Posts: n/a

Default Query Analyzer - Join data in a text file to a SQL Server table - 05-12-2008 , 01:06 PM






I have data in a text file that contains the Lender Number.
789 $4,000 May 2008
456 $5,000 May 2008
I require the Lender name that is contained in the Lender table (Lender No
is the Primary Key).
789 LenderABC
456 LenderQLE
How do I setup a query that joins the results in the text file to the Lender
Table to obtain the Lender number for all the records in the text file?

Reply With Quote
  #2  
Old   
Tom Moreau
 
Posts: n/a

Default Re: Query Analyzer - Join data in a text file to a SQL Server table - 05-12-2008 , 01:19 PM






You could create a linked server to the flat file, but the performance would
likely not be very good. I'd create a table for the lender stuff, bulk
insert the file and then join onto the table. Don't forget to index the
table appropriately.

--
Tom

----------------------------------------------------
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
SQL Server MVP
Toronto, ON Canada
https://mvp.support.microsoft.com/profile/Tom.Moreau


"Query Analyzer User" <Query Analyzer User (AT) discussions (DOT) microsoft.com> wrote
in message news:5AC494E9-9C07-4C47-85CA-E6DB2C17066D (AT) microsoft (DOT) com...
I have data in a text file that contains the Lender Number.
789 $4,000 May 2008
456 $5,000 May 2008
I require the Lender name that is contained in the Lender table (Lender No
is the Primary Key).
789 LenderABC
456 LenderQLE
How do I setup a query that joins the results in the text file to the Lender
Table to obtain the Lender number for all the records in the text file?



Reply With Quote
  #3  
Old   
Tom Moreau
 
Posts: n/a

Default Re: Query Analyzer - Join data in a text file to a SQL Server table - 05-12-2008 , 01:19 PM



You could create a linked server to the flat file, but the performance would
likely not be very good. I'd create a table for the lender stuff, bulk
insert the file and then join onto the table. Don't forget to index the
table appropriately.

--
Tom

----------------------------------------------------
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
SQL Server MVP
Toronto, ON Canada
https://mvp.support.microsoft.com/profile/Tom.Moreau


"Query Analyzer User" <Query Analyzer User (AT) discussions (DOT) microsoft.com> wrote
in message news:5AC494E9-9C07-4C47-85CA-E6DB2C17066D (AT) microsoft (DOT) com...
I have data in a text file that contains the Lender Number.
789 $4,000 May 2008
456 $5,000 May 2008
I require the Lender name that is contained in the Lender table (Lender No
is the Primary Key).
789 LenderABC
456 LenderQLE
How do I setup a query that joins the results in the text file to the Lender
Table to obtain the Lender number for all the records in the text file?



Reply With Quote
  #4  
Old   
Tom Moreau
 
Posts: n/a

Default Re: Query Analyzer - Join data in a text file to a SQL Server table - 05-12-2008 , 01:19 PM



You could create a linked server to the flat file, but the performance would
likely not be very good. I'd create a table for the lender stuff, bulk
insert the file and then join onto the table. Don't forget to index the
table appropriately.

--
Tom

----------------------------------------------------
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
SQL Server MVP
Toronto, ON Canada
https://mvp.support.microsoft.com/profile/Tom.Moreau


"Query Analyzer User" <Query Analyzer User (AT) discussions (DOT) microsoft.com> wrote
in message news:5AC494E9-9C07-4C47-85CA-E6DB2C17066D (AT) microsoft (DOT) com...
I have data in a text file that contains the Lender Number.
789 $4,000 May 2008
456 $5,000 May 2008
I require the Lender name that is contained in the Lender table (Lender No
is the Primary Key).
789 LenderABC
456 LenderQLE
How do I setup a query that joins the results in the text file to the Lender
Table to obtain the Lender number for all the records in the text file?



Reply With Quote
  #5  
Old   
Tom Moreau
 
Posts: n/a

Default Re: Query Analyzer - Join data in a text file to a SQL Server table - 05-12-2008 , 01:19 PM



You could create a linked server to the flat file, but the performance would
likely not be very good. I'd create a table for the lender stuff, bulk
insert the file and then join onto the table. Don't forget to index the
table appropriately.

--
Tom

----------------------------------------------------
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
SQL Server MVP
Toronto, ON Canada
https://mvp.support.microsoft.com/profile/Tom.Moreau


"Query Analyzer User" <Query Analyzer User (AT) discussions (DOT) microsoft.com> wrote
in message news:5AC494E9-9C07-4C47-85CA-E6DB2C17066D (AT) microsoft (DOT) com...
I have data in a text file that contains the Lender Number.
789 $4,000 May 2008
456 $5,000 May 2008
I require the Lender name that is contained in the Lender table (Lender No
is the Primary Key).
789 LenderABC
456 LenderQLE
How do I setup a query that joins the results in the text file to the Lender
Table to obtain the Lender number for all the records in the text file?



Reply With Quote
  #6  
Old   
Tom Moreau
 
Posts: n/a

Default Re: Query Analyzer - Join data in a text file to a SQL Server table - 05-12-2008 , 01:19 PM



You could create a linked server to the flat file, but the performance would
likely not be very good. I'd create a table for the lender stuff, bulk
insert the file and then join onto the table. Don't forget to index the
table appropriately.

--
Tom

----------------------------------------------------
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
SQL Server MVP
Toronto, ON Canada
https://mvp.support.microsoft.com/profile/Tom.Moreau


"Query Analyzer User" <Query Analyzer User (AT) discussions (DOT) microsoft.com> wrote
in message news:5AC494E9-9C07-4C47-85CA-E6DB2C17066D (AT) microsoft (DOT) com...
I have data in a text file that contains the Lender Number.
789 $4,000 May 2008
456 $5,000 May 2008
I require the Lender name that is contained in the Lender table (Lender No
is the Primary Key).
789 LenderABC
456 LenderQLE
How do I setup a query that joins the results in the text file to the Lender
Table to obtain the Lender number for all the records in the text file?



Reply With Quote
  #7  
Old   
Tom Moreau
 
Posts: n/a

Default Re: Query Analyzer - Join data in a text file to a SQL Server table - 05-12-2008 , 01:19 PM



You could create a linked server to the flat file, but the performance would
likely not be very good. I'd create a table for the lender stuff, bulk
insert the file and then join onto the table. Don't forget to index the
table appropriately.

--
Tom

----------------------------------------------------
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
SQL Server MVP
Toronto, ON Canada
https://mvp.support.microsoft.com/profile/Tom.Moreau


"Query Analyzer User" <Query Analyzer User (AT) discussions (DOT) microsoft.com> wrote
in message news:5AC494E9-9C07-4C47-85CA-E6DB2C17066D (AT) microsoft (DOT) com...
I have data in a text file that contains the Lender Number.
789 $4,000 May 2008
456 $5,000 May 2008
I require the Lender name that is contained in the Lender table (Lender No
is the Primary Key).
789 LenderABC
456 LenderQLE
How do I setup a query that joins the results in the text file to the Lender
Table to obtain the Lender number for all the records in the text file?



Reply With Quote
  #8  
Old   
Tom Moreau
 
Posts: n/a

Default Re: Query Analyzer - Join data in a text file to a SQL Server table - 05-12-2008 , 01:19 PM



You could create a linked server to the flat file, but the performance would
likely not be very good. I'd create a table for the lender stuff, bulk
insert the file and then join onto the table. Don't forget to index the
table appropriately.

--
Tom

----------------------------------------------------
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
SQL Server MVP
Toronto, ON Canada
https://mvp.support.microsoft.com/profile/Tom.Moreau


"Query Analyzer User" <Query Analyzer User (AT) discussions (DOT) microsoft.com> wrote
in message news:5AC494E9-9C07-4C47-85CA-E6DB2C17066D (AT) microsoft (DOT) com...
I have data in a text file that contains the Lender Number.
789 $4,000 May 2008
456 $5,000 May 2008
I require the Lender name that is contained in the Lender table (Lender No
is the Primary Key).
789 LenderABC
456 LenderQLE
How do I setup a query that joins the results in the text file to the Lender
Table to obtain the Lender number for all the records in the text file?



Reply With Quote
  #9  
Old   
Tom Moreau
 
Posts: n/a

Default Re: Query Analyzer - Join data in a text file to a SQL Server table - 05-12-2008 , 01:19 PM



You could create a linked server to the flat file, but the performance would
likely not be very good. I'd create a table for the lender stuff, bulk
insert the file and then join onto the table. Don't forget to index the
table appropriately.

--
Tom

----------------------------------------------------
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
SQL Server MVP
Toronto, ON Canada
https://mvp.support.microsoft.com/profile/Tom.Moreau


"Query Analyzer User" <Query Analyzer User (AT) discussions (DOT) microsoft.com> wrote
in message news:5AC494E9-9C07-4C47-85CA-E6DB2C17066D (AT) microsoft (DOT) com...
I have data in a text file that contains the Lender Number.
789 $4,000 May 2008
456 $5,000 May 2008
I require the Lender name that is contained in the Lender table (Lender No
is the Primary Key).
789 LenderABC
456 LenderQLE
How do I setup a query that joins the results in the text file to the Lender
Table to obtain the Lender number for all the records in the text file?



Reply With Quote
  #10  
Old   
Tom Moreau
 
Posts: n/a

Default Re: Query Analyzer - Join data in a text file to a SQL Server table - 05-12-2008 , 01:19 PM



You could create a linked server to the flat file, but the performance would
likely not be very good. I'd create a table for the lender stuff, bulk
insert the file and then join onto the table. Don't forget to index the
table appropriately.

--
Tom

----------------------------------------------------
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
SQL Server MVP
Toronto, ON Canada
https://mvp.support.microsoft.com/profile/Tom.Moreau


"Query Analyzer User" <Query Analyzer User (AT) discussions (DOT) microsoft.com> wrote
in message news:5AC494E9-9C07-4C47-85CA-E6DB2C17066D (AT) microsoft (DOT) com...
I have data in a text file that contains the Lender Number.
789 $4,000 May 2008
456 $5,000 May 2008
I require the Lender name that is contained in the Lender table (Lender No
is the Primary Key).
789 LenderABC
456 LenderQLE
How do I setup a query that joins the results in the text file to the Lender
Table to obtain the Lender number for all the records in the text file?



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.