Viewing 15 posts - 8,341 through 8,355 (of 8,731 total)
With UNION of 2 statements above, does this mean recursive being called twice or was it just one?
Yes, you can check the execution plan.
another word where in the code...
October 3, 2012 at 12:12 pm
Yes, and there's a better way for you to post the question so we can help you.
If you give us DDL, Sample Data and Expected Results, we'll be able to...
September 28, 2012 at 12:03 pm
I would like to know more about those methods. Could you tell me where to find information? I couldn't find much.
This is what I came with. It's doing many reads.
DECLARE...
September 27, 2012 at 2:54 pm
For the many to many relationship, I might have a better example. I'm not sure if it's commonly used, but I've seen it.
If you have invoices and payments in a...
September 27, 2012 at 2:08 pm
I found a way to do this. Might not be optimal but it's a way.
However, I want to know what is this for, as Craig asked.
September 27, 2012 at 1:59 pm
Sean Lange (9/27/2012)
Luis Cazares (9/27/2012)
I disagree, varchar can hold up to 8000 characters in 2000 (nvarchar will only hold up to 4000, though).http://msdn.microsoft.com/en-us/library/aa258242(SQL.80).aspx
Another option is to use text columns
Doh!!! You...
September 27, 2012 at 12:10 pm
I have questions regarding foreign key and about parent-child relationship:
1. What is the purpose of self referential foreign keys ? or why do we create it?
To make a reference to...
September 27, 2012 at 12:03 pm
I disagree, varchar can hold up to 8000 characters in 2000 (nvarchar will only hold up to 4000, though).
http://msdn.microsoft.com/en-us/library/aa258242(SQL.80).aspx
Another option is to use text columns
September 27, 2012 at 10:00 am
anthony.green (9/27/2012)
WHEREISNULL(SUM(BF.GLOBAL_FEE_TAKEN), 0.00) < ISNULL(SUM(BF.FEE_AMOUNT), 0.00)
Shouldn't that be on the HAVING clause (after the GROUP BY)?
September 27, 2012 at 8:11 am
Could you use something like this?
If it works, do you understand it?
;WITH CTE AS(
selectcalcid,
salesamount,
productid,
ROW_NUMBER() OVER( PARTITION BY productid ORDER BY calcid) rn
from #abc t1
--where productid IN (58, 62, 65)
)
SELECTcte1.productid,
cte1.calcid,
cte1.salesamount,
cte2.calcid...
September 26, 2012 at 2:19 pm
Both tables are far to large as this is a running system to give a copy, I am just trying to create a query for a report.
That's why you're asked...
September 26, 2012 at 10:01 am
Something similar to Lowell's but I believe he missed something.
AND NextReviewDate >= CASE WHEN @Due = 'Over Due' THEN '19000101'
WHEN @Due = 'Due In 30 Days' THEN GETDATE()
WHEN...
September 26, 2012 at 9:16 am
It seems that I like the other solutions better than mine.
Laurie, you should drop the else from your cases to allow negative numbers.
Mine won't work when all the flags are...
September 26, 2012 at 8:44 am
With some help from this article from Dwain, I came up with a solution:
An Alternative (Better?) Method to UNPIVOT (SQL Spackle)[/url]
WITH Original AS( SELECT ROW_NUMBER() OVER( ORDER BY (SELECT NULL))...
September 26, 2012 at 8:26 am
Sean Lange (9/26/2012)
Are you sure that works?
For me it has errors. There's no such thing as "DELETE field FROM Table" as it will delete the entire row. And AFAIK you...
September 26, 2012 at 7:58 am
Viewing 15 posts - 8,341 through 8,355 (of 8,731 total)