Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
ramu143
Yak Posting Veteran
64 Posts |
Posted - 2008-05-16 : 03:12:48
|
| SET QUOTED_IDENTIFIER OFF GOSET ANSI_NULLS ON GOCREATE proc CPROC_15PLUS -- '2008','04','01','15'@pYear int, @pMonth int, @pDay1 int,@pDay2 int asbegindeclare @pOperator varchar(32)set nocount onDECLARE carname CURSORFOR select displayname from CLIST_15PLUS(nolock) open carnamefetch next from carname into @pOperatorwhile(@@fetch_status<>-1)begininsert into CDATA_15PLUS --SELECT * INTO [CDATA_7PLUS'+@pDay1+''-''+@pDay2+''+@pYear+'] FROM exec carr_summary_Datewise @pYear,@pMonth,@pDay1,@pDay2,@pOperatorfetch next from carname into @pOperatorendCLOSE carnameDEALLOCATE carnameset nocount offendGOSET QUOTED_IDENTIFIER OFF GOSET ANSI_NULLS ON GOwhen ever i am executing this procedure its taking more timegive me any modification in this one fro faster running |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-05-16 : 04:28:21
|
| I can one possible improvemnt can be using WHILE loop instead of cursor. Also what does the sp carr_summary_Datewise do? |
 |
|
|
ramu143
Yak Posting Veteran
64 Posts |
Posted - 2008-05-16 : 04:44:55
|
| carr_summary_Datewise throgh this sp they are geeting data daily report |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-05-16 : 05:15:38
|
quote: Originally posted by ramu143 carr_summary_Datewise throgh this sp they are geeting data daily report
Have you executed it individually and checked how long it takes? |
 |
|
|
|
|
|