Viewing 15 posts - 766 through 780 (of 1,229 total)
Can you post the code in the stored procedure?
December 14, 2011 at 10:58 am
Narud (12/14/2011)
<<snip>>
And use it in this ways
SELECT Value FROM dbo.fString2Table('1,2,3,4,5', ',')
Or
SELECT Value FROM dbo.fString2Table('1,2,3,4,5', ',')
...
December 14, 2011 at 9:07 am
boeledi (12/14/2011)
Simply use the following:
SELECT COALESCE(( sqlstatement), 0)
For example
SELECT A.*, Score = 100 * ( SELECT COALESCE( ( SELECT ftt.RANK FROM tbl_description TD INNER...
December 14, 2011 at 9:01 am
Have you tried APPLY?
SELECT A.*, x.Score
FROM tbl_owners A
OUTER APPLY (
SELECT Score = ftt.[RANK]
FROM tbl_description TD
INNER JOIN CONTAINSTABLE(dbo.tbl_description, [description], @freetext_keywords) AS ftt
ON TD.description_id = ftt.
WHERE TD.owner_id = A.owner_id
) x
WHERE
{{my conditions}}
December 14, 2011 at 6:21 am
DROP TABLE #Sample
CREATE TABLE #Sample (avalue INT, adate DATETIME)
INSERT INTO #Sample (avalue, adate)
SELECT 5, '01/01/2011 00:00:00' UNION ALL
SELECT 5, '02/01/2011 00:00:00' UNION ALL
SELECT 5, '03/01/2011 00:00:00' UNION ALL
SELECT 10, '04/01/2011...
December 14, 2011 at 5:56 am
There's some strange date/time arithmetic going on here. If it's fixed, you won't need datetime functions around columns - there are better ways.
What datatype are the following: @ToDate, @FromDate, SP.InTime,...
December 14, 2011 at 4:42 am
Sean Lange (12/13/2011)
Can you put together some ddl and sample data? It sure make life a lot easier without having to create your structures and data. 😉
A list of the...
December 13, 2011 at 11:22 am
;WITH Preaggregate AS (
SELECT
Category,
[MonthEntered]= DATENAME(month,DateEntered),
[TotYes]= SUM(CASE WHEN Answer = 1 THEN 1 ELSE 0 END),
[TotNo]= SUM(CASE WHEN Answer = 0 THEN 1 ELSE 0 END)
FROM PublicSurvey s
GROUP...
December 13, 2011 at 9:22 am
sami.sqldba (12/13/2011)
DECLARE @NUMBER VARCHAR(50)DECLARE @FINAL VARCHAR(50)
SET @NUMBER = '1,2,3,4,5'
SET @FINAL = '''' + REPLACE (@NUMBER,',', ''',''') + ''''
SELECT @FINAL
How might this work?
DECLARE @NUMBER VARCHAR(50)
DECLARE @FINAL VARCHAR(50)
SET @NUMBER = '1,2,3,4,5'
SET @FINAL...
December 13, 2011 at 7:10 am
duggal.priyanka06 (12/13/2011)
I have the following query where @User::Cob_Dt is a variable giving me the previous business day.The
following gives me day of a month i.e. 2011-12-31 00:00:00.000
declare @cob_dt...
December 13, 2011 at 3:56 am
Jeff Moden and others have conducted extensive research into running totals using existing versions of SQL Server, the results of which are published here[/url]. Denali offers a completely new and...
December 13, 2011 at 2:30 am
sql_jr (12/13/2011)
inner join dbo.people p with(nolock)
on r.people_id = p.people_id
You'd think...
December 13, 2011 at 1:39 am
Hi Dev, yes I do. There's a good reason - if a project here takes a while to resolve, and some take hours or even days, it wouldn't look good...
December 13, 2011 at 1:24 am
First thing I'd do is get the correlated subquery out of the result set and into the FROM list to ensure that it's not being run once for every row...
December 13, 2011 at 1:21 am
Viewing 15 posts - 766 through 780 (of 1,229 total)