Viewing 15 posts - 3,226 through 3,240 (of 4,085 total)
While it's possible to do this in T-SQL, it's not the best tool for the job. Without knowing how you are planning to use these results, it's difficult to...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
April 16, 2012 at 11:31 am
It sounds like you just want a count of the attributes. If that is the case, you don't need the string splitter.
SELECT SUM(LEN(SelectedAttributes) + 1 - LEN(REPLACE(SelectedAttributes, '|', ''))
FROM...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
April 16, 2012 at 7:23 am
Your design is fundamentally flawed. You're trying to use your stored procedure like a function. Here is what Microsoft has to say on the issue.
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
April 13, 2012 at 10:08 am
You're essentially doing a pivot or crosstab and using any kind of join is an inefficient way of doing that. The following should get you what you need. ...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
April 13, 2012 at 7:26 am
Sean Lange (4/12/2012)
Why are you so stubborn about posting ddl and sample data?
I've come to the conclusion that he's not really interested in answers. He's only interested in monopolizing...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
April 12, 2012 at 11:31 am
Gazareth (4/12/2012)
Think Foreign Key REFERENCES Primary Key 🙂
That's not quite accurate. The foreign key only needs to reference a unique key, it does not need to be the primary...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
April 12, 2012 at 9:32 am
You already have another thread on this same topic. http://www.sqlservercentral.com/Forums/Topic1281058-392-1.aspx You didn't get the answer you wanted there, because you didn't provide the requested information. Starting a new thread...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
April 12, 2012 at 9:25 am
pathankhan (4/12/2012)
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
April 12, 2012 at 7:58 am
xenophilia (4/11/2012)
SELECT Distinct Outcome
, TestNo
, SUBSTRING(RIGHT('SuitePath',DATALENGTH('SuitePath') - 1),1,PATINDEX('%\%',RIGHT('SuitePath',DATALENGTH('SuitePath') - 1)) - 1)
from testsuite
i get this error
Msg 536, Level 16, State 1, Line 1
Invalid length parameter passed to...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
April 12, 2012 at 7:23 am
Since the PATINDEX presumably includes a LIKE, it's bound to be less efficient. This is borne out by a comparison of the stats.
LIKE
(8 row(s) affected)
Table 'XXXXXXXX'. Scan count 1,...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
April 11, 2012 at 2:06 pm
SELECT *
FROM YourTable
WHERE YourField LIKE '%[^A-Z0-9]%'
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
April 11, 2012 at 1:16 pm
hbtkp (4/11/2012)
it doesnt matter , how do i get those value in select stm
In that case, the answer you are looking for is here.
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
April 11, 2012 at 12:38 pm
hbtkp (4/11/2012)
@ stands for group
No, @ stands for the beginning of a variable/parameter definition. '@' may stand for group, but not @.
i have group name item3 ,which i am...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
April 11, 2012 at 12:09 pm
Use a CASE statement.
WITH TestSuite(Col1, Test, Outcome) AS (
SELECT 1, 'test1', 'Passed' UNION ALL
SELECT 2, 'test2', 'Failed' UNION ALL
SELECT 3, 'test3', 'NotExec' UNION ALL
SELECT 4, 'test4', 'Blocked' UNION ALL
SELECT 5,...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
April 11, 2012 at 12:01 pm
You say that you are supplying one parameter, but you don't say what value you're supplying to that parameter.
You say that name contains pen and pencil, but the data provided...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
April 11, 2012 at 11:52 am
Viewing 15 posts - 3,226 through 3,240 (of 4,085 total)