Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««123»»

select and condition column+column Expand / Collapse
Author
Message
Posted Thursday, January 24, 2013 5:55 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Thursday, September 1, 2016 2:56 AM
Points: 5,969, Visits: 6,067
Definition of TB_TRACKING_ABV, TB_WORK_ORDER_AGVEN again with indexes please



Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
When a question, really isn't a question - Jeff Smith
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1 & Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger

Post #1411094
Posted Thursday, January 24, 2013 6:03 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Thursday, September 1, 2016 2:56 AM
Points: 5,969, Visits: 6,067
Post the query which is giving you performance problems dont keep changing the query.

Then from that query, post the definition of all tables used within that query along with all of their indexes.




Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
When a question, really isn't a question - Jeff Smith
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1 & Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger

Post #1411100
Posted Thursday, January 24, 2013 6:54 AM


SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Wednesday, August 3, 2016 12:07 AM
Points: 268, Visits: 889
OK sorry, tommorow i will send direct this query, this is what i wrote second, because i founded after that we need the second.
Now i am not at work, tommorow at 7:00 i will send..




thank you for response




How to post data/code on a forum to get the best help: Option 1 / Option 2
Post #1411114
Posted Friday, January 25, 2013 12:09 AM


SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Wednesday, August 3, 2016 12:07 AM
Points: 268, Visits: 889
hello, so programmer solved this frozen with thread, but he said me it will be temporary solution if I tune the query, if its possile

so in attachment i add files like on your web, and inside the files are little notices for this


and I forgot. this query is in procedure.




How to post data/code on a forum to get the best help: Option 1 / Option 2


  Post Attachments 
sqlplan.sqlplan (3 views, 51.55 KB)
table.docx (5 views, 23.40 KB)
tables.xlsx (3 views, 32.53 KB)
Post #1411493
Posted Friday, January 25, 2013 2:05 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Thursday, September 1, 2016 2:56 AM
Points: 5,969, Visits: 6,067
No additional indexes on the tables?

Just primary keys?

Also provide your data in a consumable format, like you have with your tables

E.g.
INSERT INTO TB_WORK_ORDER_ABV VALUES ('dfewrgre','ggergerg','gregergher','gerhreher')





Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
When a question, really isn't a question - Jeff Smith
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1 & Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger

Post #1411534
Posted Friday, January 25, 2013 2:51 AM


SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Wednesday, August 3, 2016 12:07 AM
Points: 268, Visits: 889
INSERT INTO [dbo].[TB_WORK_ORDER_AGVEN]
([ORDER_DATE]
,[COMMIT_NO]
,[BODY_NO]
,[STATION_ID]
,[DATA_TYPE]
,[CAR_CODE]
,[WO_SERIALNO]
,[EXT_COLOR]
,[INT_COLOR]
,[FSC_TDATA]
,[BODY_TYPE]
,[DRIVE_TYPE]
,[TRIM_LEVEL]
,[REPORT_DTIME]
,[RCV_TRID]
,[ERP_RCV_IFTIME]
,[PRT_BC_FLAG]
,[PRT_BC_TIME]
,[PRT_TROL_FLAG]
,[PRT_FEED_FLAG]
,[LOAD_FLAG]
,[LOAD_TIME]
,[INSP_FLAG]
,[PROD_FLAG]
,[PROD_SDATE]
,[PROD_ATIME]
,[ERP_PROD_IFTIME]
,[SHIP_FLAG]
,[SHIP_SDATE]
,[SHIP_ATIME]
,[ERP_SHIP_IFTIME]
,[ERP_SD_IFTIME]
,[ERP_DEL_IFTIME]
,[ORDER_DESC])
VALUES
(<ORDER_DATE, char(8),>
,<COMMIT_NO, char(4),>
,<BODY_NO, varchar(12),>
,<STATION_ID, char(4),>
,<DATA_TYPE, char(2),>
,<CAR_CODE, varchar(3),>
,<WO_SERIALNO, varchar(15),>
,<EXT_COLOR, char(3),>
,<INT_COLOR, char(3),>
,<FSC_TDATA, char(29),>
,<BODY_TYPE, char(10),>
,<DRIVE_TYPE, char(6),>
,<TRIM_LEVEL, char(10),>
,<REPORT_DTIME, varchar(14),>
,<RCV_TRID, numeric(10,0),>
,<ERP_RCV_IFTIME, varchar(14),>
,<PRT_BC_FLAG, char(1),>
,<PRT_BC_TIME, varchar(14),>
,<PRT_TROL_FLAG, char(1),>
,<PRT_FEED_FLAG, char(1),>
,<LOAD_FLAG, char(1),>
,<LOAD_TIME, varchar(14),>
,<INSP_FLAG, char(1),>
,<PROD_FLAG, char(1),>
,<PROD_SDATE, char(8),>
,<PROD_ATIME, varchar(14),>
,<ERP_PROD_IFTIME, varchar(14),>
,<SHIP_FLAG, char(1),>
,<SHIP_SDATE, char(8),>
,<SHIP_ATIME, varchar(14),>
,<ERP_SHIP_IFTIME, varchar(14),>
,<ERP_SD_IFTIME, varchar(14),>
,<ERP_DEL_IFTIME, varchar(14),>
,<ORDER_DESC, varchar(30),>)
GO




How to post data/code on a forum to get the best help: Option 1 / Option 2
Post #1411552
Posted Friday, January 25, 2013 2:56 AM


SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Wednesday, August 3, 2016 12:07 AM
Points: 268, Visits: 889
this ? or you mean the different format of cell in excel ?
i think that you dont need to use this data because from this table we use just 2column for compare if the order exist or no, so if doesnt exist or was canceled( column data type - SN-SD), if it was canceled i dont want select this you know. so you can edit one for SD .

Yes and one point to TRACKING TABLE

IF in Column COMMIT_NO and ORDER_NO is some value, its mean that station is working ( it appear after scan to program)
if isnt it will be in LAST_COMMIT_NO is not working- last finished sequence




How to post data/code on a forum to get the best help: Option 1 / Option 2
Post #1411554
Posted Friday, January 25, 2013 2:59 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Thursday, September 1, 2016 2:56 AM
Points: 5,969, Visits: 6,067
tony28 (1/25/2013)
INSERT INTO [dbo].[TB_WORK_ORDER_AGVEN]
([ORDER_DATE]
,[COMMIT_NO]
,[BODY_NO]
,[STATION_ID]
,[DATA_TYPE]
,[CAR_CODE]
,[WO_SERIALNO]
,[EXT_COLOR]
,[INT_COLOR]
,[FSC_TDATA]
,[BODY_TYPE]
,[DRIVE_TYPE]
,[TRIM_LEVEL]
,[REPORT_DTIME]
,[RCV_TRID]
,[ERP_RCV_IFTIME]
,[PRT_BC_FLAG]
,[PRT_BC_TIME]
,[PRT_TROL_FLAG]
,[PRT_FEED_FLAG]
,[LOAD_FLAG]
,[LOAD_TIME]
,[INSP_FLAG]
,[PROD_FLAG]
,[PROD_SDATE]
,[PROD_ATIME]
,[ERP_PROD_IFTIME]
,[SHIP_FLAG]
,[SHIP_SDATE]
,[SHIP_ATIME]
,[ERP_SHIP_IFTIME]
,[ERP_SD_IFTIME]
,[ERP_DEL_IFTIME]
,[ORDER_DESC])
VALUES
(<ORDER_DATE, char(8),>
,<COMMIT_NO, char(4),>
,<BODY_NO, varchar(12),>
,<STATION_ID, char(4),>
,<DATA_TYPE, char(2),>
,<CAR_CODE, varchar(3),>
,<WO_SERIALNO, varchar(15),>
,<EXT_COLOR, char(3),>
,<INT_COLOR, char(3),>
,<FSC_TDATA, char(29),>
,<BODY_TYPE, char(10),>
,<DRIVE_TYPE, char(6),>
,<TRIM_LEVEL, char(10),>
,<REPORT_DTIME, varchar(14),>
,<RCV_TRID, numeric(10,0),>
,<ERP_RCV_IFTIME, varchar(14),>
,<PRT_BC_FLAG, char(1),>
,<PRT_BC_TIME, varchar(14),>
,<PRT_TROL_FLAG, char(1),>
,<PRT_FEED_FLAG, char(1),>
,<LOAD_FLAG, char(1),>
,<LOAD_TIME, varchar(14),>
,<INSP_FLAG, char(1),>
,<PROD_FLAG, char(1),>
,<PROD_SDATE, char(8),>
,<PROD_ATIME, varchar(14),>
,<ERP_PROD_IFTIME, varchar(14),>
,<SHIP_FLAG, char(1),>
,<SHIP_SDATE, char(8),>
,<SHIP_ATIME, varchar(14),>
,<ERP_SHIP_IFTIME, varchar(14),>
,<ERP_SD_IFTIME, varchar(14),>
,<ERP_DEL_IFTIME, varchar(14),>
,<ORDER_DESC, varchar(30),>)
GO


With the data from the excel sheet.

It should be many lines of INSERT statements

INSERT INTO table VALUE ('20120101','29443','354643',abcd.........................) etc etc etc for all tables




Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
When a question, really isn't a question - Jeff Smith
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1 & Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger

Post #1411557
Posted Friday, January 25, 2013 3:23 AM


SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Wednesday, August 3, 2016 12:07 AM
Points: 268, Visits: 889
i think if you copy and paste to "Edit" table, it will appear in table no?

i copy data like this without insert .

Or how can i do this ?




How to post data/code on a forum to get the best help: Option 1 / Option 2
Post #1411573
Posted Monday, January 28, 2013 9:29 PM


SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Wednesday, August 3, 2016 12:07 AM
Points: 268, Visits: 889
hello,
please can you help me or is not possible ?

thank you for response




How to post data/code on a forum to get the best help: Option 1 / Option 2
Post #1412744
« Prev Topic | Next Topic »

Add to briefcase ««123»»

Permissions Expand / Collapse