Groups | Blog | Home
all groups > sql server (alternate) > april 2007 >

sql server (alternate) : Populate a Table with Stored Proc.


Nate
4/25/2007 7:29:25 AM
I am looking to populate a Schedule table with information from two
other tables. I am able to populate it row by row, but I have created
tables that should provide all necessary information for me to be
able
to automatically populate a "generic" schedule for a few weeks or
more
at a time.

The schedule table contains:
(pk) schedule_id, start_datetime, end_datetime, shift_employee,
shift_position


A DaysOff table contains:
(pk) emp_id, dayoff_1, dayoff_2 <-- the days off are entered in day
of
week (1-7) form


A CalendarDays table contains:
(pk) date, calendar_dow <-- dow contains the day of week number (as
above) for each day until 2010.


My main question is how to put all of this information together and
have SQL populate the rows with data based on days off. Any
suggestions?
Erland Sommarskog
4/25/2007 9:59:45 PM
Nate (nate.borland@westecnow.com) writes:
[quoted text, click to view]

Just as a reminder, in case you are getting old and don't remember
what you did yesterday, you posted this question yesterday as well,
and I replied by asking some questions, and Plamen Ratchev suggested
some queries. I suggest that you go Google news and find the old
thread and review our replies.


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
AndrewC
4/27/2007 3:04:09 PM
[quoted text, click to view]
Hmm. I'm getting old and I don't do daft things like that!
AddThis Social Bookmark Button