Viewing 15 posts - 751 through 765 (of 1,082 total)
Ok I think I have a better way of doing this.
I'm using a dynamic pivout query so I hope this helps
DROP TABLE #Yourtbl
CREATE TABLE #Yourtbl
(PK INT,
Restaurant VARCHAR(100),
RoomStatus ...
August 6, 2008 at 5:24 am
HI there,
Does anyone have any ideas or alternative methods?
August 6, 2008 at 4:36 am
There is another problem in that how does your query know which related intv_schedule.program_Id gets which ex.Program_ID?
I think this is in fact what you looking for:
UPDATE s
SET program_id = e.program_ID
FROM...
August 6, 2008 at 4:32 am
HHI,
There are a few places you went wrong I'll try and explain.
For simplicity I'll just look at your select statements.
[Code]
SELECT e.program_id
FROM (SELECT *
...
August 6, 2008 at 4:29 am
Thanks for the reply 🙂
I guess it comes down to test test and test again 🙂
August 6, 2008 at 2:14 am
mmmm ooops,
I'll work on the performance and try and get back to you 🙁
August 5, 2008 at 11:32 am
Hi 🙂
When you say it gets lost?!!? does it throw an Error?
could you let me know what you mean, and send through an example as well .
Thanks
Chris
August 5, 2008 at 11:24 am
I'm not sure what you mean about Hardcoding the names?
None of my code should be hard coded, the only section that was hard coded was the creating of the data...
August 5, 2008 at 10:56 am
Hi there,
Ok I think a recursive CTE might get you what you want.
DECLARE @Yourtbl TABLE
(PK INT,
Restaurant VARCHAR(100),
RoomStatus VARCHAR(100))
INSERT INTO @Yourtbl
SELECT 10,'Yonos Restaurant','Room A- Incomplete Certification' UNION ALL
SELECT 10,'Yonos Restaurant','Room...
August 5, 2008 at 10:39 am
Glad you managed to find the answer.
There are a few articles about nulls on this site.
here is one of them
http://www.sqlservercentral.com/articles/Advanced+Querying/2829/
I tend NEVER EVER to use 'something' = null
😉
August 5, 2008 at 9:56 am
HI Paul,
Please could you give us the table schema and the proc schema with example input and outputs.
Otherwise it is going to be very very hard for us to help...
August 5, 2008 at 9:47 am
HI GSquared,
Don't get me wrong, I'm not a 100% but I have always been taugh both at work and here that cursors are a no-no where ever possible.
Perhaps because of...
August 5, 2008 at 9:46 am
Here are few examples of how to do this differently depending what you want.
1 - example is yours.
2 - example is just returning the first word before the string like...
August 5, 2008 at 9:39 am
HI,
Might be worth looking into changing that code to use a Tally table which should give you must better performance 😉
also something good to learn if you don't knwo much...
August 5, 2008 at 9:23 am
Viewing 15 posts - 751 through 765 (of 1,082 total)