Forum Replies Created

Viewing 15 posts - 16 through 30 (of 136 total)

  • RE: Using Select Statement inside Case result

    Hi laurie-789651,

    Thanks for your reply. Actually what i want is the rows that does not have 'Metro Fibre' or 'Metro Wireless'.

    What i actually want are the rows that do not...

  • RE: How to Find Percentage using a recursive cte

    GilaMonster (4/25/2016)


    Just one point. CTEs don't start with a ;.

    The semicolon is a row terminator. Your code should be

    declare @Parameter nvarchar(4000);

    set @Parameter = 'Urbanisation';

    With tmp as (

    Select Count(*) as Base,...

  • RE: Using Column Names as Parameters

    Hugo Kornelis (4/23/2016)


    That's effectively the same question you asked in your first message, and the first answer you got (from GilaMonster) still applies.

    There are scenarios that call for this type...

  • RE: How to Find Percentage using a recursive cte

    Ok guys,

    seems like i solved my problem myself

    This is the code that solves the problem:

    declare @Parameter nvarchar(4000)

    set @Parameter = 'Urbanisation'

    ;with tmp as (

    Select Count(*) as Base, DayOfInterview, COUNT(DayOfInterview) as DaysOfInt,...

  • RE: How to Find Percentage using a recursive cte

    Luis Cazares (4/22/2016)


    Please post DDL (CREATE TABLE statement) for the table.

    Edit:

    Correct your sample data, be sure it runs correctly.

    Also, share what you're trying to do with this data. You might...

  • RE: Using Column Names as Parameters

    Well guys,

    I think i found a solution to my code problem, the solution was to use a recursive cte and group by the field you want, that gives you...

  • RE: Using Column Names as Parameters

    GilaMonster (4/21/2016)


    I strongly recommend, with only a few columns like you appear to have, to avoid dynamic SQL.

    It's easy to get wrong, and it's prone to horrible security flaws...

  • RE: Using Column Names as Parameters

    Thanks for your reply,

    so how do i do the dynamic sql?

    Tim

  • RE: String Manipulations

    Luis Cazares (4/7/2016)


    Is this what you're looking for?

    DECLARE @tbl_MediumResults TABLE(

    Answer VARCHAR(8000)

    );

    INSERT INTO @tbl_MediumResults

    SELECT '{"Sunday:"[3,4,5,]},{"Monday:"[1,6,]},{"Tuesday:"[5,6,7,]},{"Wednesday:"[6,7,]},{"Thurday:"[5,6,]},{"Friday:"[5,6,]},{"Saturday:"[1,6,7,]},'

    UNION ALL

    Select '2,3,4,5,6'

    SELECT Answer,

    CASE

    ...

  • RE: String Manipulations

    Thanks guys for your help.

    Please i have another request, i've been trying to do some manipulations on the code, but i'm not getting the expected result.

    Please what if i have...

  • RE: String Manipulations

    Reading the article I mentioned in my post.

    Thanks Luis,

    This is what i needed, it works now

    Thanks very much

    Tim

  • RE: String Manipulations

    Thanks Luis for your reply,

    but please look below at the error being generated:

    (1 row(s) affected)

    Msg 208, Level 16, State 1, Line 8

    Invalid object name 'dbo.DelimitedSplit8K'.

    Please how do i overcome that?

    Thanks

    Tim

  • RE: Recover from error log scan number(93799:2191:1) database not valid

    GilaMonster (1/20/2015)


    Can you restore a backup?

    If so, do so.

    If not, you'll have to hack the DB into the server and repair it, you may lose data, you may...

  • RE: Recover from error log scan number(93799:2191:1) database not valid

    GilaMonster (1/20/2015)


    timotech (1/20/2015)


    Hi Everybody,

    Please how do i recover from this error while trying to attach my database:

    Could not open new database 'MediaMonitoring'. Create database is aborted

    msg 9003, level 20, state...

  • RE: Recover from error log scan number(93799:2191:1) database not valid

    free_mascot (1/20/2015)


    If your database is not production than you can attached mdf file without any ldf file and it will automatically take care of creating new ldf file. check following...

Viewing 15 posts - 16 through 30 (of 136 total)