Viewing 15 posts - 916 through 930 (of 1,439 total)
I would have expected your function to look like this
CREATE function fn_getXML(@url nvarchar(max))
returns TABLE (field1 nvarchar(1000), field2 nvarchar(150), field3 nvarchar(max), field4 datetime, field5 nvarchar(50))
EXTERNAL NAME [XMLPuller].[XMLPuller.XmlFunctions].[getXML]
July 19, 2010 at 9:49 am
Try this
CREATE TABLE MyTable(SlotNumber INT, StartTime INT, Duration INT, Status INT);
INSERT INTO MyTable(SlotNumber, StartTime, Duration, Status)
SELECT 1, 0,30,0 UNION ALL
SELECT 2,30,20,0 UNION ALL
SELECT 3,50,20,1 UNION ALL
SELECT 4,70,20,0;
WITH CTE AS (
...
July 14, 2010 at 3:53 am
Dave Ballantyne (7/9/2010)
Chris Morris-439714 (7/9/2010)
Now, how often have you had to tell folks that there's no guaranteed order of results from a query unless...
July 9, 2010 at 9:17 am
select r.query('.')
from @xml.nodes('/U/N[@id="2" and @ type ="good"]') as x(r)
July 7, 2010 at 3:20 am
Using this sort of approach, you should be able to dynamically pivot the data
DECLARE @data XML
SET @data ='<ITEM><RESPONDENT_ID>2</RESPONDENT_ID><Business_Account_Name>ElectroDom</Business_Account_Name><Category>Director</Category></ITEM>'
SELECT r.value('local-name(.)','VARCHAR(100)') AS Name,
r.value('.','VARCHAR(100)') AS Value
FROM...
June 29, 2010 at 10:01 am
stuff 56271 (6/22/2010)
I just wanted to let you know that I put the query I liked the most in this thread into a blog post.
The reason was that I...
June 24, 2010 at 6:19 am
Look up ROW_NUMBER() OVER... in BOL
June 18, 2010 at 4:29 am
Here's another way
SELECT LEFT(a.Del_No,5) AS Del_No,
SUM(b.L_Amt) AS L_Amt,
a.T_Amt,
a.A_Name
FROM Table_A...
June 17, 2010 at 10:24 am
WITH CTE AS (
SELECT a, b, COUNT(*) OVER(PARTITION BY a,b) AS cn
FROM dbo.t)
SELECT a,b
FROM CTE
WHERE cn>1;
June 10, 2010 at 2:01 am
Here's another way
DECLARE @s-2 VARCHAR(100)
SET @s-2='TESTRBTEST'
SELECT @s-2 = CASE WHEN CHARINDEX(SUBSTRING(@s,Number,1),@s) BETWEEN 1 AND Number-1 THEN STUFF(@s,Number,1,'') ELSE @s-2 END
FROM master.dbo.spt_values
WHERE Number BETWEEN 2 AND LEN(@s) AND type='P'
ORDER BY Number...
June 9, 2010 at 4:43 am
Jeff Moden (6/8/2010)
paul_ramster (6/7/2010)
darn flies!
Ah... my apologies for being the messenger. There's more than one fly... here are...
June 9, 2010 at 2:24 am
cgreathouse (5/31/2010)
I'm trying to find a way to collapse a large table I'm working with. I'm noticing that there are a lot of rows that are very similar. ...
June 7, 2010 at 7:34 am
ColdCoffee (5/31/2010)
declare @mytable table
(
id int,
potype varchar(10)
)
insert into @mytable values (1,'AA')
insert into @mytable values (1,'BB')
insert into @mytable values (1,'CC')
SELECT p1.id,
...
June 3, 2010 at 2:15 am
Another one to try
WITH CTE1 AS (
SELECT Name ,Price ,Date,
ROW_NUMBER() OVER(PARTITION BY Name ORDER BY DATE) AS rn1,
...
June 2, 2010 at 8:50 am
cgreathouse (5/20/2010)
Here's some SQL to get everything setup
declare @table table(ID int,
...
May 21, 2010 at 8:00 am
Viewing 15 posts - 916 through 930 (of 1,439 total)