Forum Replies Created

Viewing 15 posts - 3,676 through 3,690 (of 5,103 total)

  • RE: truncate Log

    dbcc shrinkfile (database_log_file_name, 200)

     

  • RE: Copy from a table then delete

    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...

  • RE: Can this be done without using cursor?

    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...

  • RE: Can this be done without using cursor?

    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 ) --...

  • RE: Can this be done without using cursor?

    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...

  • RE: Can this be done without using cursor?

    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...

  • RE: Login failed for user ''''(null)''''

    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...

  • RE: sql help please

    No problem, Happy to help

  • RE: sql help please

    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

     

  • RE: Login failed for user ''''(null)''''

    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...

  • RE: SELF JOIN

    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...

  • RE: Can this be done without using cursor?

    It will always matter (the #of items). If you try to load more than 65535 rows on one xl sheet your app will break

  • RE: Can this be done without using cursor?

    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...

  • RE: Import from XML to SQL Server 2000

    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...

  • RE: Selectively update one row

    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

        ...

Viewing 15 posts - 3,676 through 3,690 (of 5,103 total)