Reputation
1,225
Top tag
Next privilege 2,000 Rep.
Edit questions and answers
Badges
2 10
Newest
 Yearling
Impact
~42k people reached

Apr
16
comment How can I replace the cursor in the below query?
Well, it's hard to say. You either need to put some serious effort into analyzing your procedure and rewriting the code in it's entirety. Failing that, you should ( like @Spörri suggested ), at least start with declaring your cursor as FAST_FORWARD. You might also want to remove the max selection statement from within the cursor, since it's redundant to run this for each iteration. If you need the max value, you can always move that statement to outside of the cursor. Also, the deletion from tmpFinalResult doesn't seem to server any purpose.
Apr
16
comment How can I replace the cursor in the below query?
Possibly if you deconstruct the statement within the procedure you could rewrite this a set based operation. How complex is the logic in the procedure ?
Apr
16
comment How can I replace the cursor in the below query?
Is the procedure call ( core.usp_GetMonitoringPeriod ) required ? If so, you can't really avoid using a row-by-row processing method.
Apr
8
comment SQL Server 2012 Express installation failed
Have you tried running the SQLServer service under a different user account ?
Mar
26
awarded  Yearling
Mar
16
answered Single select from template record oracle
Jan
9
comment How to create script file with PL/SQL?
Depending on your client, you might actually also want to try to look into using the DMBS_OUTPUT package and simply just write the output to the output screen of your client, and then saving that result as a file. It's not very elegant, but it would work.
Jan
9
answered Using Oracle Datapump when target table has additional column
Jan
9
comment How to create script file with PL/SQL?
There's not a specific package to achieve this, but you might find this helpful ; dba-oracle.com/t_oracle:__write_a_file_to_to_a_client_pc.htm
Jan
9
comment How to create script file with PL/SQL?
You sure can. Check out the stuff I just added to my answer
Jan
9
revised How to create script file with PL/SQL?
added 1809 characters in body
Jan
7
answered How to create script file with PL/SQL?
Dec
17
revised can I use many-to-many relation with weak entity
added 541 characters in body
Dec
17
answered can I use many-to-many relation with weak entity
Dec
4
comment How should I delete branch from adjacency list in SQL Server?
Just added another version of the proc, it goes by the parentNodeId. Should only iterate over the number of levels.
Dec
4
revised How should I delete branch from adjacency list in SQL Server?
added 945 characters in body
Dec
3
answered How should I delete branch from adjacency list in SQL Server?
Oct
14
answered index rebuild/reorganize frequency
Oct
6
answered How to I establish a 1 to 1 relationship
Oct
2
answered Populate one table with data from another one on selected cells