Viewing 15 posts - 3,676 through 3,690 (of 4,087 total)
My previous post contains all the information specific to XML. The rest is standard SQL stuff. You declare an XML variable and set the value of the variable...
July 25, 2011 at 11:56 am
I used an XML variable. If you use an XML column, you'll probably need to use CROSS APPLY in order to evaluate for each row.
Drew
July 25, 2011 at 9:19 am
Sugsy (7/22/2011)
Just for the record Kingston's suggestion works fine n'all
Actually, it doesn't. It works as long as the last three characters aren't repeated anywhere else in the string, but...
July 22, 2011 at 11:45 am
Eric M Russell (7/21/2011)
SQL_By_Chance (7/21/2011)
July 22, 2011 at 7:51 am
It helps if you provide expected output based on the data provided. As it is, I had to guess at what you were looking for.
The following code should at...
July 20, 2011 at 12:46 pm
There is a separate forum for Analysis Services http://www.sqlservercentral.com/Forums/Forum17-1.aspx. You might get a better answer in that forum.
Drew
July 14, 2011 at 2:41 pm
It's not an arbitrary behavior, it's just that you can't predict the value for the week based on the values for each day.
If the same five users log in every...
July 14, 2011 at 8:51 am
From BOL http://msdn.microsoft.com/en-us/library/ms175623.aspx:
SSAS aggregrate functions fall into three categories: additive, semiadditive, and nonadditive.
DistinctCount is nonadditive, which is why you don't get the results you expect when you compare the...
July 14, 2011 at 7:16 am
Lowell (7/11/2011)
this seems to work for me:
The OP asked to specifically break on spaces. This only seems to work, because this particular test string has spaces at positions 60...
July 11, 2011 at 9:03 am
kramaswamy (7/7/2011)
select Letter, COUNT(*)from #Letters
LEFT JOIN Emp ON SUBSTRING(Name,1,1) = Letter
group by Letter
SUBSTRING is not SARGable, so it's better to write this using LIKE.
select Letter, COUNT(*)
from #Letters
LEFT JOIN Emp ON...
July 7, 2011 at 1:29 pm
Use FOR XML PATH instead of FOR XML AUTO.
Another options is to use the ELEMENTS directive.
FOR XML AUTO, ELEMENTS
Drew
July 7, 2011 at 6:55 am
The expression in the COMPUTE clause's aggregate has to EXACTLY match an expression in the SELECT clause. Your SELECT clause contains a function call, whereas your COMPUTE clause does...
July 6, 2011 at 3:10 pm
The problem is with the following fields: mersum.subisonum and mersum.repnum.
You're grouping on the actual values (including NULLs), so you could potentially have a row with NULL and another with 0...
July 6, 2011 at 12:23 pm
sqlusers (6/30/2011)
CREATE TABLE tblGetEmp (EmpName CHAR(8),Salary INT,Dept CHAR(1))
INSERT INTO tblGetEmp
SELECT 'aaa',10000,'a' UNION ALL
SELECT 'bbb',16662,'a' UNION ALL
SELECT 'rrr',73637,'a' UNION ALL
SELECT 'jhfdj',87683,'b' UNION ALL
SELECT 'jhk',7382,'b' UNION ALL
SELECT 'ewkjhk',98798,'b'...
June 30, 2011 at 7:32 am
Viewing 15 posts - 3,676 through 3,690 (of 4,087 total)