Viewing 15 posts - 6,406 through 6,420 (of 15,381 total)
NineIron (10/25/2013)
I've got two CTEs. CTE1 returns one record. CTE2 returns 12. Can I join the two so that, for each record in CTE2, it returns the record from CTE1?
Use...
October 25, 2013 at 8:10 am
Hi and welcome to the forums. In order to help we will need a few things:
1. Sample DDL in the form of CREATE TABLE statements
2. Sample data in the form...
October 25, 2013 at 7:45 am
Bill given that the OP state business is asking for this I suspect this is not a one time situation. They are looking for something to use repeatedly. The excellent...
October 24, 2013 at 12:51 pm
Honestly, the function posted is fraught with issues. There is all kinds of casting/converting both explicitly and implicitly.
If we are going to demonstrate how to do somebody's homework we should...
October 24, 2013 at 12:48 pm
Suresh Babu Palla (10/24/2013)
October 24, 2013 at 11:00 am
sqlislife (10/24/2013)
To answer your question, the query is simply trying to delete row by row based on a certain join condition. Its currently...
October 24, 2013 at 10:57 am
Suresh Babu Palla (10/24/2013)
I wanted to return the business date from the table which i am passing as parameter. Let me know how to correct it ?
Well to "correct" this...
October 24, 2013 at 10:47 am
You might also try reading this article. http://www.sqlservercentral.com/articles/62867/%5B/url%5D
Many many many times a tally/numbers table can be used in place of looping.
October 24, 2013 at 10:36 am
sqlislife (10/24/2013)
You are right, the data is really something I just made up and created on the fly, you are right there is no...
October 24, 2013 at 10:35 am
dmartin 38210 (10/24/2013)
case when DATEPART(DW, SED.earlieststartdate) = 2 then 'Monday' else
case when DATEPART(DW, SED.earlieststartdate) = 3 then 'Tuesday' else
case...
October 24, 2013 at 10:24 am
I had put together my own version but saw Keith posted one too.
I created some ddl to work with which I will post. I converted Keith's to use the same...
October 24, 2013 at 9:31 am
You are welcome. Glad that worked for you.
October 24, 2013 at 9:13 am
I sure don't see anything that indicates the speed issue is from the query side of this. Generating a 95 page excel doc is going to take some time for...
October 24, 2013 at 8:17 am
Do be careful here. The fine code that Bhuvnesh posted will have issues if you have gaps in your identity column.
declare @updatedef table ( id int identity, tablename varchar(30),...
October 24, 2013 at 8:03 am
Please post ddl and consumable data in the future. The query itself is pretty trivial but setting up the problem from a spreadsheet is painful.
Here is one way to do...
October 23, 2013 at 2:35 pm
Viewing 15 posts - 6,406 through 6,420 (of 15,381 total)