Viewing 15 posts - 1,861 through 1,875 (of 1,920 total)
I understood partially your requirement and here is the code for that
SELECT
CASE LOOKUP.COL1
...
April 5, 2010 at 8:25 pm
Jeff Moden (4/5/2010)
That will work for only 1 level of approval.
Jeff i did not have the time to execute the query, my bad :doze:.. but the solution using the recursive...
April 5, 2010 at 7:48 pm
the solution i have provided is created by me closely following the recursive-cte explanation give in BOL 2008 (http://msdn.microsoft.com/en-us/library/ms186243.aspx).. excellent article with the example walk-thro.. u ll find it very...
April 5, 2010 at 3:50 am
What you have in hand is a classic "running total" statement..
i suggest you go thro the following excellent article by Jeff Moden to get the gist and solutions of...
April 5, 2010 at 3:00 am
This will also give u the result u wanted..
SELECT
EH.EmpID AS EmpID,
EH1.EmpName AS EmpName ,
EH.EmpName EmpApproverName
...
April 5, 2010 at 2:56 am
Please inform here if that code fixed your issue 🙂
April 5, 2010 at 2:49 am
You can acheive with a recursive CTE....
Here is a good example:
if object_id('Emp_Hierarchy') is not null
drop table Emp_Hierarchy
Create table Emp_Hierarchy
(
EmpId int identity(1,1) not null constraint pk_EmpId Primary key,
EmpName varchar(128) not...
April 5, 2010 at 2:45 am
The best place is the forums in this very website.. if u need real time examples/problems on a topic, say "inner joins" as you mentioned, just go up to the...
April 4, 2010 at 11:28 pm
Buddy, thats a huge requirement.
1. Find out the who are FKs
2. Check for the Cascade rule.
3. Create a script to compare table in this relationship
4. Create a set-based code to...
April 4, 2010 at 10:49 pm
Buddy, here is the code u had requested.. It will loop thro the PubName CTE and execute sp_helpArticle for each PublicationName without WHILE Loop. Please note that i have commented...
April 4, 2010 at 10:29 pm
Tara, from your expected result set, i see u want the minimum date for the combination of size and DB name..
(if the above statement is right, then can u pls...
April 3, 2010 at 10:53 pm
David, as in Gail's reply, please go thro that article which Gail wrote about the SQL-Injection probelms with dynamic sql and how to counter them.. excellent article that.. and take...
April 1, 2010 at 4:26 am
U need to do it using dynamic SQL mate..
please go through the following thread which is similar to ur request and find this post
http://www.sqlservercentral.com/Forums/Topic892483-338-1.aspx#bm892554
April 1, 2010 at 3:44 am
yes Arjun, i have to tweak ti for performance now.. i have added lot of garbage in that.. should clean the code.. once done, i wil post the optimized...
April 1, 2010 at 3:41 am
Thanks Arjun for an aliter code 🙂
Infact, i used a temporary table to old the data ranges and then joined it to get the ranges, much like your code...
April 1, 2010 at 3:27 am
Viewing 15 posts - 1,861 through 1,875 (of 1,920 total)