Viewing 15 posts - 3,226 through 3,240 (of 4,087 total)
Crystal Reports has a crosstab object that was specifically designed for this type of operation. It's MUCH, MUCH easier to do this Crystal than in T-SQL.
Drew
April 16, 2012 at 11:55 am
Here are two different ways to do it.
DECLARE @dateString DATETIME
SET @dateString = '2012-04-05'
SELECT @dateString,
CASE WHEN DATEPART(DAY, @dateString) < 10
THEN STUFF(CONVERT(varchar(10), @dateString, 103), 1, 1, '')
ELSE CONVERT(varchar(10), @datestring, 103)
END
,RIGHT(CONVERT(varchar(10), @dateString,...
April 16, 2012 at 11:52 am
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...
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...
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.
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. ...
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...
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...
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...
April 12, 2012 at 9:25 am
pathankhan (4/12/2012)
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...
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,...
April 11, 2012 at 2:06 pm
SELECT *
FROM YourTable
WHERE YourField LIKE '%[^A-Z0-9]%'
Drew
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
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...
April 11, 2012 at 12:09 pm
Viewing 15 posts - 3,226 through 3,240 (of 4,087 total)