Viewing 15 posts - 301 through 315 (of 2,171 total)
You'll have to include the namespace in the query too...
declare @sample table (y XML)
insert @sample
values('
<submission fc:submission_type="CURVEBALL" xmlns="http://www.curveballxml.org"
xmlns:fc="http://www.curveballxml.org" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.curveballxml.org https://challengeyouxml.org/schema/fc_submission.xsd">
<header_record>
<submission_date>2002-10-15</submission_date>
<begin_posting_date>2002-04-01</begin_posting_date>
<end_posting_date>2002-04-30</end_posting_date>
<number_of_records_transmitted>8</number_of_records_transmitted>
</header_record>
<detail_record>
<status>Good</status>
<name>Z</name>
</detail_record>
</submission>')
;WITH XMLNAMESPACES('http://www.curveballxml.org' AS e)
SELECTtab.col.value('(./e:status)[1]','varchar(10)') AS [status],
tab.col.value('(./e:name)[1]','varchar(2)') AS [name]
FROM@sample
CROSS APPLYy.nodes('e:submission/e:detail_record')...
January 4, 2010 at 6:16 am
January 4, 2010 at 6:01 am
The script calculates the uptime for the server, not the database service.
December 7, 2009 at 3:27 am
SELECTcl.*
FROMdbo.CallLog
INNER JOIN(
SELECTCallID
FROMAsgnmnt
GROUP BYCallID
HAVINGMIN(CASE WHEN Resolution = 'Completed' THEN 1 ELSE 0 END) = 1
) AS x ON x.CallID = cl.CallID
December 3, 2009 at 3:07 pm
Have you tried "CONVERT(XML, YourColumnNameHere)"?
November 24, 2009 at 12:55 am
DECLARE@Sample TABLE
(
Col1 DECIMAL(7, 4)
)
INSERT@Sample
SELECT7.0449 UNION ALL
SELECT7.0444 UNION ALL
SELECT7.0445 UNION ALL
SELECT7.033
SELECTCol1 AS OriginalValue,
ROUND(ROUND(Col1, 3), 2) AS OriginalPoster,
ROUND(Col1 + 0.0005, 2) AS Peso
FROM@Sample
November 22, 2009 at 1:17 pm
The overlooked thing is the TOP operator.
declare @SampleInput table
( CustomerID int )
insert into @SampleInput
select 10001
insert into @SampleInput
select 10002
insert into @SampleInput
select 10003
insert into @SampleInput
select 10004
insert into @SampleInput
select 10005
insert into @SampleInput
select 10006
insert...
November 22, 2009 at 1:12 pm
No, you can't use a computed column as source for another computed column
The main reason I think is circular reference, like this:
A = B
B = A
November 17, 2009 at 1:56 am
You will get the student with last character of your alphabet, probably Z.
Zanzibar is MAX over Sweden. It's the way they are sorted.
November 16, 2009 at 4:57 am
At least it is "lowest common" 😀
November 16, 2009 at 2:07 am
+1 for Florian's calculator analogy.
November 16, 2009 at 12:33 am
This may also be useful to know
http://weblogs.sqlteam.com/peterl/archive/2008/11/24/SQL-Server-2008-with-MERGE-and-triggers.aspx
November 15, 2009 at 1:49 pm
SELECTCOUNT(*) AS User_Count
FROM(
SELECT[User_ID],
MIN(Created_Date) AS First_Purchase_Date
FROMdbo.Orders
GROUP BY[User_ID]
HAVINGMIN(Created_Date >= DATEDIFF(DAY, 1, GETDATE())
AND MIN(Created_Date < DATEDIFF(DAY, 0, GETDATE())
) AS d
November 15, 2009 at 1:46 pm
1 week, and 4 pages of replies.
Where did OP go?
November 14, 2009 at 1:09 pm
Make your voice heard
Vote on Connect here
http://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=254388
November 13, 2009 at 11:31 pm
Viewing 15 posts - 301 through 315 (of 2,171 total)