Forum Replies Created

Viewing 11 posts - 1 through 11 (of 11 total)

  • RE: SP TO UPDATE COLUMNS MONTHLY

    here is table structure:

    dbo.test.item([RDITEMNUMID] [decimal](28, 0) NOT NULL,

    [RDITEMCHARID] [varchar](50) NOT NULL,

    [RDSOURCENUMID] [int] NOT NULL,

    [RDSOURCETBLID] [int] NOT NULL,

    [ITEMNUMBER] [varchar](50) NULL,

    [ITEMNAME] [varchar](50) NULL,

    [ITEMCOMMODITYCODE] [varchar](50) NULL,

    [ITEMCOMMODITYNAME] [varchar](50) NULL,

    [ITEMCOMPANY] [varchar](50) NULL,

    [HITS_YEAR3] [decimal](28, 0) NULL,

    [HITS_YEAR2]...

  • RE: SP TO UPDATE COLUMNS MONTHLY

    Get date in where condition will also change with each moth like

    AND MT.TRANSACTIONDATE BETWEEN DATEADD(MONTH, DATEDIFF(MONTH, 0, GETDATE())-2, 0) --First day 2 months ago

    AND DATEADD(MILLISECOND, - 3, DATEADD(MONTH, DATEDIFF(MONTH,...

  • RE: curser problem

    Thank you very much. now, I can fix step 2 as well. it helped me to see the problem. when I write this script, I new that step 2 and...

  • RE: cursor problem. not working properly

    will you please help me. I am not sure I follow the tempt able part.

    thanks,

    Navie

  • RE: help with store procedure

    their is only select statement in SP.

    ALTER PROCEDURE [dbo].[ALTER PROCEDURE [dbo].[zUSP_PROD_HIER_CODE]

    AS

    BEGIN

    SELECT SOFACTS.RDFACTSEXTNUMID

    ,SOFACTS.RDSOURCENUMID

    ,SOFACTS.RDFACTSEXTCHARID

    ,SOFACTS.RDFACTSHDRNUMID

    ,SOFACTS.RDFACTSHDRCHARID

    ,SOFACTS.RDSOURCETBLID

    ,SOFACTS.RDTRANSTYPENUMID

    ,

    --SETS.SETNAME,

    --FCOPRODHIER_ITEMCAT.RDATTRIBUTE001CHARCODE,

    CASE

    WHEN CHARINDEX('AP-', Upper(SETS.SETNAME)) > 0

    THEN 'DKZZZZZZ'

    ELSE ISNULL(FCOPRODHIER_ITEMCAT.RDATTRIBUTE001CHARCODE, 'ZZZZZZZZ')

    END 'PROD_HIER_CODE'

    ,SOFACTS.RDINSERTDATE 'SOFACTS_RDINSERTDATE'

    ,SETS.RDINSERTDATE 'SETS_RDINSERTDATE'

    ,FCOPRODHIER_ITEMCAT.RDINSERTDATE 'ITEMCAT_RDINSERTDATE'

    ,SOFACTS.[RDINSERTINDICATOR]

    ,SOFACTS.[RDINSERTDATE]

    ,SOFACTS.[RDCHANGEINDICATOR]

    ,SOFACTS.[RDCHANGEDATE]

    ,SOFACTS.[RDDELETEINDICATOR]

    ,SOFACTS.[RDDELETEDATE]

    ,SOFACTS.[RDPURGEDATE]

    FROM RD_CMMart.dbo.STAR_ITEMCATEGORY FCOPRODHIER_ITEMCAT

    RIGHT OUTER JOIN RD_CMMart.dbo.STAR_ITEM_CATEGORY_XREF FCOPRODHIER_ITEMCATXREF...

  • RE: count from multiple tables for same column exists in database

    thank you!

    i will try this. This will help me.

    thanks,

  • RE: count from multiple tables for same column exists in database

    Yes, i read article. lets try this. here is script which helps me to get column name 'rdsourceidnum from all tables in database it is exits.

    use RD_CMMart

    go

    DECLARE @dtNow datetime...

  • RE: count from multiple tables for same column exists in database

    in results i like to see for recordcount_ resourcenumid = 20003

    table name ...

  • RE: count from multiple tables for same column exists in database

    in the result i want to see like this:

    servername, databasename, tablename, columnname, recordcount for id 20003,20004 and 20005

    thanks

  • RE: count from multiple tables for same column exists in database

    yes, this gives me column name, but i also wants to get total record for RDSOURCENUMID= 20003, 20004,20005

  • RE: count from multiple tables for same column exists in database

    i have to create a job. this query, gives me table names in database with column name with where condition. now, from here, i also need to get count...

Viewing 11 posts - 1 through 11 (of 11 total)