Forum Replies Created

Viewing 12 posts - 136 through 147 (of 147 total)

  • RE: How Can I know calling procedure origin?

    You could add an additional input to the SP and pass the name of the SP calling into it (OBJECT_NAME(@@PROCID))

  • RE: Update Statistics script

    SET NOCOUNT ON

    DECLARE @StatsToUpdate TABLE ( StatName NVARCHAR(MAX) )

    DECLARE @StatUpdating NVARCHAR(MAX)

    INSERT INTO @StatsToUpdate

    ( StatName

    ...

  • RE: Query help

    DECLARE @table TABLE

    (

    ProposalId INT,

    RiskId INT,

    RiskTaken BIT

    )

    INSERT INTO @table

    SELECT 1, 1, 1

    UNION ALL SELECT 1,2,0

    UNION ALL SELECT 1,3,0

    UNION ALL SELECT 2,1,0

    UNION ALL SELECT 2,2,0

    UNION ALL SELECT 2,3,0

    ;

    WITH ProposalRisk

    AS

    (SELECT DISTINCT ProposalId FROM...

  • RE: Indexed Views - why don't they improve performance?!!!!

    lestatf4 (1/23/2013)


    Here is the script, is should return a years worth of data from @month and @year.

    Surely the column order in the query is irrelevant to the optimizer?

    create view...

  • RE: Calculations in SSRS

    CREATE TABLE #ExamResults

    (

    Pass_Fail CHAR(1) ,

    ExamScore INT,

    )

    INSERT INTO #ExamResults

    ...

  • RE: Calculations in SSRS

    You can't do this directly.

    You would need to add a text box (name it Outcome) into say a table / matrix on the report which shows the records and the...

  • RE: Two Rows Returned as One for Reporting

    Ah yes. I misread the original spec. Your method way better

  • RE: Stored procedure help

    Are you able to alter the staging table to add an extra column in there? If so there is a nice solution to this similar to the one we...

  • RE: Two Rows Returned as One for Reporting

    This is is no way elegant or the best solution to the problem and I have made some assumptions about the table field types and lengths etc and will be...

  • RE: Crystal report problem

    Depends on where you have the sub report? Is it in a group footer? It may be worth putting in whileprintingrecords; on the sub report

  • RE: Dynamic SQL to change Recovery Model

    Probably not the most efficient or elegant way to do it but works for me

    DECLARE @sql NVARCHAR(MAX);

    DECLARE @dbs TABLE

    (

    ...

  • RE: Reporting based upon a search for a Company

    Create a text box parameter called searchstring so the user can enter the search string they want.

    Create a dataset with the following condition:

    select * from <yourtable> where <yourfield> like '%'...

Viewing 12 posts - 136 through 147 (of 147 total)