Viewing 15 posts - 1,381 through 1,395 (of 5,588 total)
Since you do have the FK already established, you know that whatever is in the child table has to be in the parent table. So, how about something like:
SELECT PK=1,...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
May 10, 2011 at 3:21 pm
Steve Jones - SSC Editor (5/10/2011)
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
May 10, 2011 at 10:46 am
FYI, here are the results on my system (with my code throw in to test also):
--===== Test the RBAR function ========================================================================================
Total Duration in Seconds: 12
--===== Test the NON RBAR function...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
May 10, 2011 at 9:15 am
Please read the articles linked to in my signature:
For better assistance in answering your questions
How to ask a question
Cross Tabs / Pivot Tables, Part 1
Cross Tabs / Pivot Tables, Part...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
May 10, 2011 at 7:05 am
GSquared (5/9/2011)
I just registered for the PASS Rally in Orlando.
See you there, somewhere!
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
May 10, 2011 at 6:41 am
Like so?
;
WITH cte AS
(
SELECT Department,
Receipt,
StartDate,
EndDate,
...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
May 9, 2011 at 4:26 pm
I'd say with a combination of ROW_NUMBER(), DATEADD(), DATEDIFF() and possibly a self-referencing join. Maybe even RANK() and DENSE_RANK().
These links may help:
SQL Server Ranking Functions[/url]
You know, the people...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
May 9, 2011 at 12:39 pm
peterzeke (5/9/2011)
WayneS (5/9/2011)
I used to use an XML splitter all the time... that is, until Jeff showed me the light. There is a thread on here somewhere that discusses it,...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
May 9, 2011 at 11:58 am
Jeff Moden (5/9/2011)
I've got one still outstanding, myself.
Plus a rewrite an expansion of Tally OH! based on new findings, plus your book, plus the varchar(max) splitter, plus the Running Totals...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
May 9, 2011 at 10:38 am
Jeff Moden (5/8/2011)
peterzeke (5/6/2011)
DECLARE @STRING VARCHAR(8000)
SET @STRING = 'COMMUNITY GENERAL HOSPITAL'
DECLARE @TEXTXML XML
SELECT @textXML...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
May 9, 2011 at 10:33 am
peterzeke (5/9/2011)
Jeff/Wayne:Many thanks for your replies! Hearing from the two of you is an honor.
:blush: Thanks Pete - and I hope I can live up to that.
But, I am...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
May 9, 2011 at 10:30 am
Look up sp_executesql in Books-Online
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
May 8, 2011 at 6:06 pm
Try this:
DECLARE @STRING VARCHAR(8000);
SET @STRING = 'COMMUNITY GENERAL HOSPITAL';
SELECT (SELECT LEFT(Item,1)
FROM dbo.DelimitedSplit8K(@String, ' ')
...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
May 8, 2011 at 2:58 pm
(Raises hand)
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
May 8, 2011 at 1:51 pm
dwg1011 (5/7/2011)
1) Extract the Codes values to a temp table indexed on the...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
May 7, 2011 at 7:56 pm
Viewing 15 posts - 1,381 through 1,395 (of 5,588 total)