dbTalk Databases Forums  

sql newbie....

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss sql newbie.... in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Ernstb
 
Posts: n/a

Default sql newbie.... - 08-09-2004 , 07:27 PM






We are in a K-12 school running SQL Server 2000 and must
export a file each night for importing into a server that
runs our cafeteria software. Basically, I have all of the
information that was built with the DTS wizards and
package designer. I need one instance of the student's
name, id, and contact information in this text file, but
what I am getting is the student's name, id, and etc for
EACH contact that appears in the database (i.e. student
appears once for Mom's phone number, once for Dad's phone
number, and once for Grandma....)

Is there a way to get this DTS SQL statement to ignore all
occurrences AFTER the first occurrence? (We only need one
contact listed.)

Thank you in advance!

Reply With Quote
  #2  
Old   
Darren Green
 
Posts: n/a

Default Re: sql newbie.... - 08-10-2004 , 03:05 AM






This sounds like you need a simple SELECT DISTINCT query as the source in
DTS, e.g.

SELECT DISTINCT StudentID, Forename, Surname
FROM NonNormalTable

Lookup the DISTINCT keyword in SQL Server Books Online index for more
information about this.

--
Darren Green
http://www.sqldts.com

"Ernstb" <ernstb (AT) clifton (DOT) k12.tx.us> wrote

Quote:
We are in a K-12 school running SQL Server 2000 and must
export a file each night for importing into a server that
runs our cafeteria software. Basically, I have all of the
information that was built with the DTS wizards and
package designer. I need one instance of the student's
name, id, and contact information in this text file, but
what I am getting is the student's name, id, and etc for
EACH contact that appears in the database (i.e. student
appears once for Mom's phone number, once for Dad's phone
number, and once for Grandma....)

Is there a way to get this DTS SQL statement to ignore all
occurrences AFTER the first occurrence? (We only need one
contact listed.)

Thank you in advance!



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.