Viewing 15 posts - 226 through 240 (of 683 total)
rbarryyoung (4/16/2008)
I feel bad for the OP, but we can't really do much for them until they can post something that we can see. Maybe an attachment?
I've just searched...
April 16, 2008 at 9:46 am
GSquared (4/15/2008)
Dictionary definition of "Recursive":Recursive (re-cur-siv) adj: See recursive.
😀
April 15, 2008 at 11:25 am
rbarryyoung (4/11/2008)
Wow.I really wish that the {code} IFcode tags would treat their contents as literals and not strip out the html & xml tags.
Agreed. The trick is to replace all...
April 15, 2008 at 4:59 am
I guess your google is broken.
"A recursive query is one in which a CTE references itself."
http://www.sqlservercentral.com/articles/Development/recursivequeriesinsqlserver2005/1760/%5B/url%5D
April 15, 2008 at 4:46 am
-- Data
declare @x xml
set @x = '<ROOT>
<Customers>
<CustomerID>1111</CustomerID>
<CompanyName>Sean Chai</CompanyName>
<City>NY</City>
<Order OrderID="1" />
<Order OrderID="2" />
</Customers>
<Customers>
...
April 15, 2008 at 4:05 am
Hi vsjayashri
Can't see your xml 🙁
Try replacing every < with < and repost...
April 15, 2008 at 3:14 am
Can't see your example, but this works...
DECLARE @x XML
SET @x = '<root><a><b /></a><c d="e" /></root>'
SET @x = @x.query('root/*')
SELECT @x
/* Results
<a><b /></a><c d="e" />
*/
April 15, 2008 at 2:01 am
Also asked here: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=100959
April 14, 2008 at 5:30 pm
It's a bit tricky to tell what's what, but try something like this...
c.reportrundate as Day1
,a.MaterialNumber
,a.MaterialDescription
,a.MaterialGroup
,max(Case
When a.plant = 'DC15' then a.unrestrictedstock
end) as Day1LDCStock
,max(Case
...
April 14, 2008 at 5:27 pm
Yep - you need something to identify the order. An identity field will do it, for example...
-- Data
CREATE TABLE MyTable (
ident int identity(1, 1), --<----- you need this
...
April 14, 2008 at 5:23 pm
This will go wrong for values with trailing spaces.
Using DATALENGTH rather then LEN will fix this 🙂
April 14, 2008 at 4:24 pm
Something like this...
declare @d1 datetime
declare @d2 datetime
declare @d3 datetime
declare @d4 datetime
set @d1 = '02/Nov/06 9:14:21 AM'
set @d2 = '19/Apr/07 11:52:31 AM'
set @d3 = '02/dec/07 12:14:21 AM'
set @d4 = '19/jan/08 5:52:31...
April 14, 2008 at 8:18 am
It looks like you're happy, so just to mention in passing that there are circumstances where 'ON DELETE CASCADE' would be an alternative. Here's an example...
--Structure
CREATE TABLE t1 (Id INT...
April 14, 2008 at 6:57 am
Or...
select dateadd(hour, datediff(hour, 0, acc_dt), 0) as dt, sum(acc_count) as total_cnt
from Acc_count group by dateadd(hour, datediff(hour, 0, acc_dt), 0)
April 14, 2008 at 6:22 am
Viewing 15 posts - 226 through 240 (of 683 total)