Quantcast
Channel: Help with cursor (logic)
Browsing latest articles
Browse All 13 View Live

Help with cursor (logic)

Kent,Would an OUTER APPLY be more appropriate as moved_to can be NULL? GeorgeGeorge, In this case I don't think an OUTER APPLY is necessary because the REF_NO column is NOT NULL and I think there must...

View Article



Help with cursor (logic)

Kent could you explain your reply?  Can ANYONE Suggest the book i need? LOLAlso,I want to check if a tbl is there if its not creat the table,, but i am not getting it...IF NOT...

View Article

Help with cursor (logic)

Ok Thanks for all the help, this is the mess i created to get what i needed any suggestions on cleaning it up appreciated!    SELECT  L.REF_No            , L.Acct_No    into #tblMeh    FROM TblAccounts...

View Article

Help with cursor (logic)

Kent,Would an OUTER APPLY be more appropriate as moved_to can be NULL?George

View Article

Help with cursor (logic)

Kent could you explain your reply?  Can ANYONE Suggest the book i need? LOL Also, I want to check if a tbl is there if its not creat the table,, but i am not getting it... IF NOT...

View Article


Help with cursor (logic)

My reply from last night does not perform particularly well.  I read all of this again and realized that I had misunderstood the objective.  This query might be closer to what you are after:SELECT...

View Article

Help with cursor (logic)

Thanks guys, i havent checked yet but will as soon as i am at work.Thanks so much for the help!  As you can tell i needed it!McC

View Article

Help with cursor (logic)

Also posted here: http://www.dbforums.com/microsoft-sql-server/1640549-help-cursor-logic.htmlGeorge

View Article


Help with cursor (logic)

Trying to follow this I wrote the following SQL:CREATE TABLE TblAcc([Ref_No] [int] NOT NULL,[MOVED_TO] [int] NULL,[Acct_No] [char](20) NOT NULL)CREATE TABLE Tbl_REF_No_AuditTrail([Ref_No] [int] NOT...

View Article


Help with cursor (logic)

Perhaps you need to do something more like:select  ref_no,  moved_to,  acct_nofrom( select    ref_no,    moved_to,    acct_no,    row_number() over    ( partition by Acct_No      order by ref_no    )...

View Article

Help with cursor (logic)

Trying to follow this I wrote the following SQL:CREATE TABLE TblAcc([Ref_No] [int] NOT NULL,[MOVED_TO] [int] NULL,[Acct_No] [char](20) NOT NULL)CREATE TABLE Tbl_REF_No_AuditTrail([Ref_No] [int] NOT...

View Article

Help with cursor (logic)

I don't think you need a cursor for this.  Does this return what you are looking for?SELECT A.Ref_No,           M.Moved_To,           A.Acct_NoFROM   TblAcc AJOIN    (SELECT MIN(Ref_No) AS first_ref,...

View Article

Help with cursor (logic)

I have a Table that has Ref_No and Acct_NoThe ref_no is unique but the Acct_No have duplicatesThe data looks like:Ref_No Acct_No1 1002 1003 1004 1015 101I want to make an audit trail table showing that...

View Article

Browsing latest articles
Browse All 13 View Live




Latest Images