Viewing 15 posts - 286 through 300 (of 1,347 total)
To place the value into a resultset, you need a user-defined function, not a stored procedure.
Having said that, using a user-defined function, where the function itself performs a query on...
August 24, 2006 at 1:45 pm
select maintitle
from (
select 0 As PrimarySort, '' as ord_num, 'this book at top of the list' AS maintitle
union ALL
select 1, s.ord_num, t.title AS maintitle
from titles t, sales s
...
August 24, 2006 at 9:14 am
There is no WHERE clause on your INSERT inside the loop.
Each time it executes it is replicating the whole Policy_Product table into Policy_Product_New.
I would create a 2 column temp table,...
August 24, 2006 at 8:54 am
What is the data type of SERV_DATE ? Is it a true datetime ? Is it possible for a patient to have 2 visits in the same day, and could...
August 22, 2006 at 2:59 pm
What I don't get is ... you are LEFT JOINING the derived_table, but not using any of the columns in derived_table in the resultset.
As you know, if you LEFT JOIN...
August 22, 2006 at 2:46 pm
Are you sure your sample data in @tblContacts is correct ?
Why do Bob Zimmerman and Carla Franks have the same Contact ID ? If these persons don't have unique Contact...
August 22, 2006 at 2:02 pm
The RTRIM(err) != '' will definitely not be sargable.
What is in the [err] column that forces you to RTRim it ? Can it have leading spaces also ? If it...
August 22, 2006 at 1:13 pm
This is the problem I'm referring to:
select distinct 1
from exc as e
where e.ssn=k.ssn
and rtrim(err) != ''
and col_dat in ('2006-07-01','2006-07-02', etc . )),...
August 22, 2006 at 11:53 am
Depends on version of VB. If it's VB6 and an in-process COM DLL, then you can probably use the sp_OA_Create and related stored procedures to instantiate a COM object and...
August 22, 2006 at 11:21 am
>>The main query has three columns that are subquerys on big tables that use the != operator.
So, the query is of the form ...
SELECT
(SELECT Column FROM OtherTable WHERE ...) As Column1,
...
August 22, 2006 at 11:17 am
>>And I understand SQL normally works oldest to newest rows.
Where did you get that understanding ? There is no inherent order in which SQL updates under the hood. It...
August 22, 2006 at 10:35 am
T-SQL is parsed.
Then it is executed.
The parsing step doesn't deal with the fact that your 2 SELECT INTO's are in mutually exclusive conditional blocks, so it throws the error at...
August 22, 2006 at 10:28 am
This works as long as cosize is an integer type:
Create Table #test (
cosize int
)
Insert Into #Test
Select 1 Union All
Select 4 Union All
Select 9 Union all
Select 35 Union All
Select 95...
August 22, 2006 at 9:59 am
Should have tested first - that code still returns job 111.
Here's a corrected, tested solution:
SELECT j.job_id
FROM #Jobs As j
INNER JOIN #Activities As a
ON (j.job_id = a.job_id)
GROUP BY j.job_id
HAVING COUNT(*)...
August 21, 2006 at 5:16 pm
Viewing 15 posts - 286 through 300 (of 1,347 total)