Forum Replies Created

Viewing 15 posts - 1,861 through 1,875 (of 1,922 total)

  • RE: Dynamic SQL

    rahul.koduru (4/5/2010)


    But, the example I provided is really a short version of what I really need.

    In the actual problem,

    thats the turning point, please be specific with what your requirement...

  • RE: Dynamic SQL

    Thanks Lynn for checking that out!! i was kind of reluctant to post it without testing.. now that u tested and decorated the code, the OP can directly us that.....

  • RE: Deleting the columns from the same database through the script

    hi there, here is the code u asked for.. check the output of this from that print statement.. if that matches your requirement, uncomment the exec part and your requirement...

  • RE: Dynamic SQL

    I understood partially your requirement and here is the code for that

    SELECT

    CASE LOOKUP.COL1

    ...

  • RE: I don't know how to do it :(

    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...

  • RE: I don't know how to do it :(

    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...

  • RE: Update current period data based on previous period data

    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...

  • RE: I don't know how to do it :(

    This will also give u the result u wanted..

    SELECT

    EH.EmpID AS EmpID,

    EH1.EmpName AS EmpName ,

    EH.EmpName EmpApproverName

    ...

  • RE: I don't know how to do it :(

    Please inform here if that code fixed your issue 🙂

  • RE: I don't know how to do it :(

    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...

  • RE: Any Recommended Sites or Books for Practising SQL/SQL Server

    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...

  • RE: Cascade delete rule on multiple tables

    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...

  • RE: Pass value of one column as input

    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...

  • RE: unique result

    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...

  • RE: Improve Stored Procedure

    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...

Viewing 15 posts - 1,861 through 1,875 (of 1,922 total)