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? 2 2022
Nate (na**********@westecnow.com) 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.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se
Books Online for SQL Server 2005 at http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at http://www.microsoft.com/sql/prodinf...ons/books.mspx
Erland Sommarskog wrote:
Nate (na**********@westecnow.com) 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?.... This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Alex |
last post by:
I have a "source" table that is being populated by a DTS bulk import
of a text file. I need to scrub the source table after the import
step by running appropriate stored proc(s) to copy the source...
|
by: .:mmac:. |
last post by:
I have a bunch of files (Playlist files for media player) and I am trying to
create an automatically generated web page that includes the last 20 or 30
of these files. The files are created every...
|
by: Robin Tucker |
last post by:
Hi,
I'm trying to determine with my program whether or not a given database
supports a given feature set. To do this I'm querying for certain stored
procedures in the sysobjects table and if...
|
by: hubert.trzewik |
last post by:
Hello,
Is it possible to EXEC stored procedure from a query?
I want to execute stored procedure for every line of SELECT result
table.
I guess it's possible with cursors, but maybe it's...
|
by: Yul |
last post by:
Hi,
We are in the process of designing an ASP.NET app, where a user will
enter some 'Customer ID' to be queried in the database. If the ID is
valid, several stored procedures will be called to...
|
by: Uwe C. Schroeder |
last post by:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi,
maybe my mind is stuck, but here's something strange.
This is the classic "counter" thing, where you can't / won't use sequences....
|
by: John |
last post by:
Hi all,
I'm sorry I'm reposting this but the original was urgent and I do need
closure on this.
I'm calling a stored proc which does 4 "selects" and then I populate a
dataset looping through...
|
by: Nate |
last post by:
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...
|
by: cookie0311 |
last post by:
Hi
I am trying to place three DropDownLists inside a Repeater, each DLL is dependent on it’s previous DDL’s selection. I’m developing in asp.net and VB.
An Initial DDL (inside the repeater) needs...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
| |