Forum Replies Created

Viewing 15 posts - 901 through 915 (of 3,957 total)

  • RE: How to call a function returning a scaler (String) in a view.

    Sean Lange (1/16/2014)


    pooja.sharma 54426 (1/16/2014)


    Please create an empty database and run following sqls.

    Add some data into them .

    Nice job posting the ddl. Can you post some data? Remember we are...

  • RE: How to get net sales from these table?

    raghuldrag (1/16/2014)


    Hi dwain.c,

    Thanks for ur reply.....

    i need the o/p like each item wise (i.e you wrote the code for max item ,

    now each item...

  • RE: How to call a function returning a scaler (String) in a view.

    Sorry to tell you this but I don't open zip files from unknown sources (virus-phobia).

    Post the SQL in line using the SQL code tag to make it pretty.

  • RE: How to call a function returning a scaler (String) in a view.

    pooja.sharma 54426 (1/15/2014)


    declare @cols NVARCHAR(MAX)

    select @cols = STUFF((SELECT distinct ',' + QUOTENAME(c.propName)

    ...

  • RE: Using CROSS APPLY to UNPIVOT data

    Maybe this will help then.

    CREATE TABLE #TxCycle(

    Cycle INT NOT NULL,

    PatientID INT NOT NULL,

    ALOPECIA TINYINT,

    Causality1 TINYINT,

    Relatedness1 TINYINT,

    ANEMIA TINYINT,

    Causality2 TINYINT,

    Relatedness2 TINYINT,

    BLOOD TINYINT,

    Causality3 TINYINT,

    Relatedness3 TINYINT);

    SELECT OBJECT_ID('tempdb..#TxCycle')

    SELECT name

    FROM tempdb.sys.all_columns

    WHERE object_id = OBJECT_ID('tempdb..#TxCycle') AND...

  • RE: How to call a function returning a scaler (String) in a view.

    pooja.sharma 54426 (1/15/2014)


    HI,

    I am not getting how to use Table valued functions as columns that i need to fetch are not constants rather they are dynamic "' + @cols +...

  • RE: Using CROSS APPLY to UNPIVOT data

    pietlinden (1/15/2014)


    CREATE TABLE #TxCycle(

    Cycle INT NOT NULL,

    PatientID INT NOT NULL,

    ALOPECIA TINYINT,

    Causality1 TINYINT,

    Relatedness1 TINYINT,

    ANEMIA TINYINT,

    Causality2 TINYINT,

    Relatedness2 TINYINT,

    BLOOD TINYINT,

    Causality3 TINYINT,

    Relatedness3 TINYINT);

    The one thing I was wondering was this: how do I...

  • RE: How to call a function returning a scaler (String) in a view.

    pooja.sharma 54426 (1/15/2014)


    Hi,

    Actually my function is returning a dynamic query .

    Step 1 : Create a function returning property names in CSV format

    Create FUNCTION dbo.fxnGetPropertyColsQuery

    (

    )

    RETURNS NVARCHAR(MAX)

    AS

    BEGIN

    declare @Return ...

  • RE: How to call a function returning a scaler (String) in a view.

    pietlinden (1/15/2014)


    Can you just create it as a table-valued function?

    CREATE FUNCTION [dbo].[GenerateCalendar]

    (

    @FromDate...

  • RE: Join

    ashley.shookhye (1/14/2014)


    Thing is where there is no purchase, it is showing up a record where purchase is 0 and same goes for issues if there is no issue for that...

  • RE: Finding Date Ranges

    JackG (1/14/2014)


    I hope you used the CROSS APPLY VALUES approach to UNPIVOT.

    You can read about it in the first article in my signature links.

    I did do unpivot. I'll check...

  • RE: Finding Date Ranges

    JackG (1/14/2014)


    WOOHOO! That did it!

    I unpivoted the start & end date into one date column. (had to group them to eliminate duplicates for some records) I...

  • RE: Are the posted questions getting worse?

    Grant Fritchey (1/14/2014)


    dwain.c (1/14/2014)


    Grant Fritchey (1/14/2014)


    DTA!!!!!!

    Burn it with fire!!!

    And here I thought I was the only one that felt this way. 😛

    Nope. And I'm starting the rewrite on the...

  • RE: Are the posted questions getting worse?

    Grant Fritchey (1/14/2014)


    Sean Lange (1/14/2014)


    Here is a true story from the field that a buddy of mine shared with me yesterday.

    Yesterday my supervisor sent me an email regarding a view...

  • RE: Problem with SQL Query

    Sean Lange (1/14/2014)


    Of course those temp tables will be dropped implicitly when the connection closes. I know you know that but I mention it for the sake of completeness.

    True enough....

Viewing 15 posts - 901 through 915 (of 3,957 total)