Viewing 15 posts - 16 through 30 (of 113 total)
As it was stated in the previous suggestion, you need to declare the namespaces.
DECLARE @x xml = '
<xml xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema">
<s:Schema id="RowsetSchema">
<s:ElementType name="row"...
May 5, 2014 at 2:01 pm
Try:
SELECT
*
FROM
#employee
WHERE
Surname LIKE '%[^0-9a-zA-Z][^0-9a-zA-Z]%'
OR GivenName LIKE '%[^0-9a-zA-Z][^0-9a-zA-Z]%';
GO
April 8, 2014 at 6:10 pm
I do not get the right result with the CHECKSUM suggestion. May be I am doing something wrong.
This is the result I am getting:
worker_id SNO
4 1
1 2
2...
April 8, 2014 at 8:16 am
I second Lynn regarding the needs to post DDL, sample data and expected result. Help us to be able to help you.
Regarding the problem / question I find it easier...
April 4, 2014 at 9:01 am
Try:
UPDATE customers
SET fee_history = STUFF(
(
select ',' + cast(F.id as varchar(10)) + cast(F.feetype as varchar(25))
from fees AS F
where F.custid = customers.custid
ORDER BY F.id
FOR XML PATH(''), TYPE
).value('.', 'nvarchar(MAX)'), 1, 1, '');
I hope...
April 3, 2014 at 11:47 am
Can you post the output from " print @DynamicPivotQuery "?
March 26, 2014 at 9:18 am
Use a ranking function.
with C1 as (
select *, row_number() over(partition by [year], [month] order by dt) as rnk
from calendar
-- exclude weekends and holidays
-- where isweekend = 0 and isholiday =...
March 25, 2014 at 7:13 am
Dwain,
The link to the article is broken. I am interested in reading it to find out why "specifically" it is faster than using LAG / LEAD.
One thing that is handy...
March 21, 2014 at 6:18 pm
You could also use an offset window function like LAG or LEAD.
WITH C1 AS (
select *, LAG(SeqNo, 1, SeqNo) OVER(PARTITION BY RefID ORDER BY SeqNo, ID) AS prv_SeqNo
from [Sample]
)
SELECT *
FROM...
March 20, 2014 at 8:59 am
Try using NOT EXISTS instead NOT IN.
if exists(
select *
from Responses r
where not exists (
...
March 17, 2014 at 5:14 pm
Try:
SET NOCOUNT ON;
USE tempdb;
GO
DECLARE @Xml TABLE (XmlData XML);
INSERT INTO @Xml
( XmlData
)
SELECT *
FROM OPENROWSET(BULK N'C:\Temp\test.txt', SINGLE_BLOB) O;
WITH XMLNAMESPACES (
'http://www.w3.org/TR/REC-html40' AS ss,
DEFAULT 'urn:schemas-microsoft-com:office:spreadsheet'
)
, C1 AS (
SELECT
N.x.value('(text())[1]', 'nvarchar(256)') AS val,
ROW_NUMBER() OVER(ORDER BY N.x)...
February 27, 2014 at 12:57 pm
We have table-valued parameters since 2008 version.
http://technet.microsoft.com/en-us/library/bb510489(v=sql.105).aspx
I would suggest to start from here and just reach to other approaches if you are not able to leverage it.
February 26, 2014 at 10:39 am
Here you have two possible solutions in case you are also interested in pulling the locale attribute.
DECLARE @XMLwithOpenXML TABLE
(
ID int identity,
XMLData XML,
LoadDatetime Datetime Default(getdate())
);
Insert into @XMLwithOpenXML(xmldata)
values ('<Internationalization>
<contentRecords locale="en_US">
...
February 26, 2014 at 9:42 am
Hope this helps.
Partitioned Table and Index Strategies Using SQL Server 2008
http://technet.microsoft.com/en-us/library/dd578580(v=SQL.100).aspx
I will also suggest all blog posts from Dan Guzman about this theme.
http://weblogs.sqlteam.com/dang/search.aspx?q=table%20partitioning
February 25, 2014 at 1:43 pm
Viewing 15 posts - 16 through 30 (of 113 total)
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy