Viewing 15 posts - 3,676 through 3,690 (of 5,103 total)
select @maxi = Max(id) from tableA
Begin tran
insert into TableB (Fld1,Fld2) select Fld1, Fld2 from TableA where Id < @maxi
if @@error <> 0
begin
rollback Tran
return
end
delete from TableA where Id < @maxi
if...
May 26, 2005 at 2:03 pm
select Name, number
from
(Select [Name], count(*) as cnt
from dbo.SysColumns
group by [name] ) Cols
join
(select number
from master.dbo.spt_values
where type ='P' and number > 0) n on n.number<= Cols.cnt...
May 26, 2005 at 11:15 am
something like this will do :
((select itemtype it count(*) c
from table t2 group by itemtype ) m -- get max per type
join numbers on m.c < = n ) --...
May 26, 2005 at 10:08 am
Because bull2000 said that this is a tiered pricing table I assumed that you will have to have different qtys per item to conform a tier. Now if this is...
May 26, 2005 at 9:56 am
What Remi is trying to say is that for the case of three possible tiers it will be something like this:
select item
, min(case when rank = 1 then qty...
May 26, 2005 at 9:41 am
Teresita,
If you don't have a domain, as it was already stated, to create one is not a trivial change!!! I think you will be better of waiting for your network...
May 25, 2005 at 2:56 pm
select id, txtData, 1 ord From Yourtable where txtData ='html'
union all
select id, txtData, 2 ord From Yourtable where txtData <>'html'
order by ord, id, txtData
May 25, 2005 at 1:12 pm
Teresita,
Your SQL Agent is running on a local account. you have to use a domain account for it. If your domain is SQL_Smart then use an account like that for...
May 25, 2005 at 12:45 pm
Not that it matters a lot but it will be friendlier
if
Select Y1.Org_Name, Y2.Org_Name as Region_Name from dbo.YourTable Y1 inner join...
May 25, 2005 at 12:21 pm
It will always matter (the #of items). If you try to load more than 65535 rows on one xl sheet your app will break
May 25, 2005 at 12:11 pm
Do you know if there is a maximum amount of items per item type?
if the answer is yes then you can try a select case construct if is not you will...
May 25, 2005 at 12:04 pm
I can assure you that if the amount of data is large enough, your one sp call per record is going to be VERY SLOW!!!!!!!!!
You definitely need som sort of BULKINSERT...
May 23, 2005 at 12:24 pm
Update P Set Balance = b.Balance
From Patients P join
(select min(patientID) as PatientID, AccountNo from Patients p2 group by AccountNno ) ap
on ap.patientID = p.patientID and p.AccountNo = ap.p.AccountNo
...
May 20, 2005 at 3:53 pm
Viewing 15 posts - 3,676 through 3,690 (of 5,103 total)