Re: Populate a Table with Stored Proc.



Erland Sommarskog wrote:
Nate (nate.borland@xxxxxxxxxxxxx) writes:
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?

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.


Hmm. I'm getting old and I don't do daft things like that!
Now, what was I doing before I read this?....
.



Relevant Pages

  • Re: Populate table with stored proc
    ... I am able to populate it row by row, ... tables that should provide all necessary information for me to be able ... Which version of SQL Server are you using? ... Books Online for SQL Server 2005 at ...
    (comp.databases.ms-sqlserver)
  • Re: Populate a Table with Stored Proc.
    ... I am able to populate it row by row, ... tables that should provide all necessary information for me to be able ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ... Books Online for SQL Server 2005 at ...
    (comp.databases.ms-sqlserver)
  • userforms/templates/bookmarks/merge problems
    ... I am currently tasked with creating a report template with a form to fill out ... which then populates the document with the necessary information. ... document, bookmarking locations for information, then creating a userform ... I have a form for input of data; I need to populate the document with that ...
    (microsoft.public.word.mailmerge.fields)