Viewing 15 posts - 616 through 630 (of 1,156 total)
1: I would think that quering the linked server and open query, would not make that big a performance impact.
You may only want to return columns that you need and...
February 19, 2008 at 11:36 am
I would diffently do the join. You can either use the XML I provided or a udf. I would prefer the xml though. I dont know how...
February 19, 2008 at 10:42 am
you could use xml
DECLARE @x XML
SET @x = '<i>' + REPLACE( @filter, ',', '</i><i>') + '</i>'
SELECT *
FROM MyTable
WHERE [Status]
IN (SELECT x.i.value('.', 'VARCHAR(7)')
FROM @x.nodes('//i') x(i))
edited to fix xml tags
February 19, 2008 at 8:06 am
The 2005 instance is maintain seperately from the 2000 instance. Restoring the database in SQL 2005 will not effect any of your 2000 code or objects. You may...
February 18, 2008 at 8:50 pm
You can also do a count case.
SELECT ID,
COUNT(CASE WHEN AMOUNTDUE > 0 THEN ID END) AS [GT 0],
COUNT(CASE WHEN AMOUNTDUE < 0 THEN ID END) AS [LT 0],
COUNT(CASE WHEN...
February 18, 2008 at 3:01 pm
You could use a sum case for this something along the lines of:
SELECT ID,
SUM(CASE WHEN AMOUNTDUE > 0 THEN 1 ELSE 0 END) AS [GT 0],
SUM(CASE WHEN AMOUNTDUE <...
February 18, 2008 at 2:38 pm
Oh and thanks for the correction Grant. 😀
February 18, 2008 at 1:20 pm
Gotcha. I misunderstood the requirement. I thought we were deleting all rows of a particular id, where at least on row had a status of "Checked".
Yeah, we would...
February 18, 2008 at 1:19 pm
I would make this a stored procedure, unless you are calling this proceedure from select statements and where clauses.
February 18, 2008 at 1:11 pm
Something like this would work:
DELETE
FROM MYTABLE
WHERE MYKEY IN (
SELECT MYKEY
FROM MYTABLE
WHERE STATUS = 'CHECKED'
)
February 18, 2008 at 1:03 pm
Sweet, 😀
I am glad everything worked out and thanks for the feedback.
February 17, 2008 at 2:40 pm
Good article Jeff.
I guess the method of choice comes down to knowing your data. If his column is what I think it is, an integer column converted...
February 17, 2008 at 12:24 am
I am not sure why this is not working right for you. I would reduce the number of nested IF by coding the block like this:
IF EXISTS(
SELECT...
February 16, 2008 at 6:38 pm
If you are going to break the code up like this then, you must address the begin correctly. A begin must proceed an if not prior to. You...
February 16, 2008 at 11:34 am
Viewing 15 posts - 616 through 630 (of 1,156 total)