Viewing 15 posts - 16 through 30 (of 69 total)
A set solution vs an equivalent cursor solution is at least 3 times faster, and usually 10 times faster. That's why a set solution (and the internal engine that makes...
July 7, 2005 at 8:29 pm
This Just won't work.
order by o.requireddate desc
won't work.
July 7, 2005 at 7:48 pm
this will do the job, even in MSAccess I think.
select fname from candidatesmst
where not exists(select * from resumelist where resumelist.candiid= candidatesmst.candiid
)
I think it will work, because it...
July 7, 2005 at 2:48 am
Hi,
cool query
simplicity above ... almost divine
July 7, 2005 at 2:31 am
And, not tested but, the number of weeks per month
declare @d datetime, @n int
set @d = '2005-12-15' -- sample date
set @n = datepart(wk,dateadd(d,-1,dateadd(m,1,dateadd(d, 1-day(@d),@d )))) - datepart(wk,dateadd(d, 1-day(@d),@d ))...
July 7, 2005 at 2:29 am
declare @d datetime, @n int
set @d = '2005-12-15' -- to say anything
set @n = datepart(wk,@d) + 1 - datepart(wk,dateadd(d, 1-day(@d),@d ))
select @n -- the nth week...
July 7, 2005 at 2:15 am
This would be:
SELECT
case Product_ID
when 31 then 1
when 5 then 2
when 7 then 3
when 9 then 4
when 12 then 5
end,
*
FROM Products
WHERE Product_ID IN (31, 5, 7, 9,...
July 7, 2005 at 1:51 am
Also avoid cursor.... , more set oriented
declare @tablename sysname
set @tablename = ''
while (1=1)
begin
select @tablename=min(name)
...
July 7, 2005 at 1:15 am
The execution of this procedure should follow your new Product addition.
create procedure p_copyproduct
(@newProductId int, @prevProductId int)
as
begin
Insert ProductAttribute (ProductId , AttributeId)
select @newProductId , AttributeId
from ProductAttribute
where ProductId =...
July 7, 2005 at 12:59 am
Union will eliminate duplicates:
Insert mastertable
(name, phone, res, calldate)
select name, phone, res, calldate
from table1
union
select name, phone, res, calldate
from table2
July 7, 2005 at 12:41 am
Year included, sorted by month.
select
Year(entrydate) Y
, Month(entrydate) M
, datename(m,entrydate) MName
, count(*) C
from tblparticipants
where entrydate between @start and @end
group by
Year(entrydate)
, Month(entrydate)
, datename(m,entrydate)
order by
Year(entrydate)
, Month(entrydate)
July 7, 2005 at 12:30 am
This could also help, for A(Column1) and B(Column1,Column2), if you only have sql7
create procedure p_listBcols
as
select Column1
, min(Column2) Column2
, convert(varchar(80),min(Column2) ) Col2List
into #x
from B
group by Column1
while...
July 7, 2005 at 12:12 am
This would be enough:
select top 5
o.orderid
, o.customerid
, CONVERT(char(10), o.requireddate, 101) as requireddate
,o.requireddate rd
from orders o
order by rd desc
Since any single...
July 6, 2005 at 11:15 pm
This is an easy one. (Just kidding) The problem might be the synchronization tasks and the miscellaneous tasks (usually daily tasks). All of them must run successfully according to their...
September 30, 2003 at 1:46 pm
Prevent maybe nop but I've remeber my self editing sp_password, so I can log some accounts changes.
From this point I better take the 5th
June 19, 2003 at 12:32 am
Viewing 15 posts - 16 through 30 (of 69 total)