Viewing 15 posts - 1,861 through 1,875 (of 1,917 total)
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
Oh dave, how naive i have been.. the bug-pressure banded to me to do some astronimical calculations...thanks man.. thanks a lot..i did not even think in that line..
April 1, 2010 at 2:51 am
Dave, i guess the sample data made confusion.. the cost can be anything, say 1, 4, 7, 11, 13, 12, 22,27, 75,43 etc etc any integer number..
for your second...
April 1, 2010 at 2:17 am
Your code seems to work.. u missed out on the apostrophes at the end.. here is the working version (same ur code with slight modification)..
SET QUOTED_IDENTIFIER OFF
DECLARE @TABLE AS TABLE...
March 31, 2010 at 3:15 am
Viewing 15 posts - 1,861 through 1,875 (of 1,917 total)