SQLTeam.com | Weblogs | Forums

Update script - Need help


#1

I have 2 tables
RecordWeekDay
[Id] [int] IDENTITY(1,1) NOT NULL,
[RecordId] [int] NOT NULL,
[DayId] [int] NULL
|525|437|1|
|532|437|2|
|533|444|1|

WeekDay
[Id] [int] IDENTITY(1,1) NOT NULL,
[Name] varchar NOT NULL,
[Description] varchar NULL,
[SequenceNo] [smallint] NULL,

1 Sunday 1
2 Monday 2
8 Sunday - Week 1 8
15 Sunday - Week 2 9
9 Monday - Week 1 10
16 Monday - Week 2 11

The "DayId" column in the RecordWeekDay table is the key with the "Id" column in the RecordWeekDay Table

I want to change, for example
"Sunday" to "Sunday- Week 1" and also add "Sunday- Week 2"
"Monday" to "Monday - Week 1" and also add "Monday - Week 2"

So for RecordId 437...They have Sunday(1) and Monday(2).
I want change the DayId for 1 to 9 and then add


#2

hi

for this post ...

could you please help us understand whats going on ?
understanding it is 90 % headache and effort ......

doing it is 10 %
:slight_smile:
:slight_smile: