Forum Replies Created

Viewing 15 posts - 7,021 through 7,035 (of 7,619 total)

  • RE: Finding combinations of values

    CELKO (12/14/2012)


    .. Total failure.. Besides which, I believe my earlier post was the same idea, except coded correctly 🙂 .

    Yeah, it was awful! :crazy:

    What I wanted to do was...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Need help with a query

    Sorry, I didn't have test data so I couldn't pre-test it myself.

    If you'll post some data as INSERT statements, I'll be happy to correct the query.

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Finding combinations of values

    GSquared (12/14/2012)


    CELKO (12/13/2012)


    My table structure

    Please read just one little book on SQL and RDBMS. Please, just one little book! This is not a table; it has no key;...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Finding combinations of values

    CELKO (12/13/2012)


    My table structure

    Please read just one little book on SQL and RDBMS. Please, just one little book! This is not a table; it has no key; it...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Need help with a query

    SELECT object_name, database_name, DATEPART(Week, event_time) AS EventWeek, SUM(sequence_number) AS [#TimesAccessed],

    DATEADD(HOUR, DATEDIFF(HOUR, 0, event_time), 0) AS [EventHour]

    INTO #EventHour

    FROM ...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Query for a plus sign

    ScottPletcher (12/12/2012)


    CELKO (12/11/2012)


    In COBOL, the display and the internal format of data was the same. Each field had a PICTURE clause to define it. Your question makes sense only in...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Purging Data Increases IO performance?

    It's normal IF the indexing on the data was not optimal, so that you were scanning old data before that has now been removed.

    Note that when you DELETE a large...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Datetime Syntax

    Only 'YYYYMMDD', rather than 'YYYY-MM-DD', is 100% safe:

    INSERT INTO T1 (createdate)

    VALUES ('20120309 12:34:45:567')

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Enhanced Variable Declaration in SQL Server 2005 Mode

    I'd suggesting not using that particular new "enhancement" at all while you still have ANY older instances / compatability settings.

    It doesn't save you that much anyway. Not worth the...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Dynamic SQL

    Whenever possible, you should use:

    EXEC sp_executesql @sql [rather than EXEC(@sql)]

    because it is far less susceptible to SQL injection, although not foolproof depending on what...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Finding combinations of values

    Here's another possible approach, in case you ever have to do (many) more columns 🙂 :

    DELETE FROM dbo.trefClientShares

    WHERE

    CASE WHEN intLMid IS NULL THEN 1 ELSE 0...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: ORDER BY Should be same as my input in IN()

    Based on Dr Codd's rule, ALL existing relational DBMSs are "fundamentally wrong". NONE of them come close to implementing even the initial 12 "rules".

    So, if we all behaved as...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Query for a plus sign

    CELKO (12/11/2012)


    In COBOL, the display and the internal format of data was the same. Each field had a PICTURE clause to define it. Your question makes sense only in that...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Query for a plus sign

    Are you trying to make a numeric comparison against the data? That won't work in SQL Server because the "+" (or "-") sign has to be leading, not trailing....

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Query Problem

    CELKO (12/12/2012)


    Those silly 1960s BASIC “tbl-” prefixes violate ISO-11179 and basic data modeling.

    That's a silly comment because 1960s basic wouldn't allow a "-" (minus) in a name anyway!

    a-b was perfectly...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

Viewing 15 posts - 7,021 through 7,035 (of 7,619 total)