Viewing 11 posts - 1 through 11 (of 11 total)
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]...
September 5, 2014 at 1:24 pm
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,...
September 5, 2014 at 1:03 pm
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...
July 2, 2014 at 9:22 am
will you please help me. I am not sure I follow the tempt able part.
thanks,
Navie
July 2, 2014 at 8:20 am
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...
May 20, 2014 at 7:14 pm
thank you!
i will try this. This will help me.
thanks,
May 19, 2014 at 11:49 am
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...
May 19, 2014 at 10:57 am
in results i like to see for recordcount_ resourcenumid = 20003
table name ...
May 19, 2014 at 9:52 am
in the result i want to see like this:
servername, databasename, tablename, columnname, recordcount for id 20003,20004 and 20005
thanks
May 19, 2014 at 9:40 am
yes, this gives me column name, but i also wants to get total record for RDSOURCENUMID= 20003, 20004,20005
May 19, 2014 at 9:38 am
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...
May 19, 2014 at 9:08 am
Viewing 11 posts - 1 through 11 (of 11 total)