Viewing 15 posts - 226 through 240 (of 367 total)
You surely can write your query without the cursor.
You can use table-valued funcions (inlined or not), and make calculations set-by-set,
not row-by-row.
Temp tables or table variables could help.
If you would describe...
April 18, 2012 at 8:21 am
hbtkp (4/17/2012)
no this i need to do from udf which returns tableand i need to put in while or for condition
You'r the man, hbtkp! I'd buy you a beer if...
April 17, 2012 at 4:29 pm
I doubt it goes as many table scans as there are partitions, but you can check logical reads with profiler.
Do they match partition size or whole table size, and you...
April 17, 2012 at 3:59 pm
Umar, you are welcome!
Vedran
March 19, 2012 at 4:41 am
Within the CTE, where prev_Sequence is defined, you can access any column from previous row. E.g.
prev_Adm_datetime = prev.Adm_datetime
Try to learn, not just use the solution. For example, execute inner...
March 19, 2012 at 2:30 am
Probably You could use Import Wizard (Right-click on database in Object Explorer->Tasks->Import Data), and on the page "Specify Table Copy or Query" select option "Write a query to specify the...
March 18, 2012 at 5:38 pm
What are you trying to achieve, what is the logic for the rows in result ?
If you are trying to find duplicates:
select st.*
FROM SourceTbl st
JOIN
(-- find duplicate valus
select s.Col_2, s.Col_3
from...
March 18, 2012 at 5:30 pm
I'm sorry you never sent a complete example. That is, script that prepares your test data.
It would really help you to get the answer more quickly.
Please read this best practices...
March 18, 2012 at 4:44 pm
EXECUTE .. AT .. does not exist in SQL 2000
March 15, 2012 at 8:47 pm
Try this Addin: http://www.sqlxdetails.com
it does work with different db's on the same server (and the current db of course), but not (yet) over db link.
This example with procedure...
March 15, 2012 at 8:46 pm
In even longer example, You should achieve these groups:
(id, Sequence, SequenceNum, GroupId)
1 First 1 1
2 Final 3 1
3 Middle 2 3
4 ...
March 15, 2012 at 8:41 pm
After your explanation I understand that you want to allow updates that are within the same transaction as INSERT command.
You could read unique transaction id and in INSERT procedure store...
March 14, 2012 at 4:49 pm
Use proper datatypes. Store date in date (not in varchar), int in int, etc.
If you already have it wrong (dates in varchar field), why do you try to convert them...
March 14, 2012 at 8:00 am
"The last update should not succeed" - why?
In your example there is no update that would not succeed.
And there is no command that inserts "ABCD".
First INSERT sets "A", then UPDATE...
March 14, 2012 at 7:41 am
Your procedure design is completely flawed. Do not build large "UNION ALL", but instead put required data into (temp) tables,
and then use one simple INSERT command that joins your prepared...
March 14, 2012 at 7:23 am
Viewing 15 posts - 226 through 240 (of 367 total)