Forum Replies Created

Viewing 15 posts - 5,776 through 5,790 (of 7,613 total)

  • RE: Replace bad vendor query..

    Of course the only ultimate solution to "replace bad vendor query" is "replace bad vendor." 😀

    You can set up a trace with a high threshold(s) to capture really bad queries....

    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 to identify unmatched records for a Foreign Key

    GilaMonster (9/22/2014)


    If Field in Table1 is ever null, that query would return no rows. However since that's the primary key (I assume, since it's the reference for a fk), it's...

    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: use sp_msforeachdb and sp_msforeachtable and sp_spaceused together

    IF OBJECT_ID('tempdb.dbo.#sp_spaceused') IS NOT NULL

    DROP TABLE #sp_spaceused

    CREATE TABLE #sp_spaceused (

    db_name varchar(100) NOT NULL CONSTRAINT sp_spaceused__DF_db_name DEFAULT '',

    name varchar(100)...

    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: LOB data keeps growing and growing...

    You did add 70 rows, so while the growth is a little higher than average, it's not ridiculously high. Yes, you do want to convert to varbinary(max) instead of...

    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: View changing but not able to capture who/what is doing it

    That "DISTINCT" is a big concern. Either the joins are producing dups, and thus the joins need modified, or the code is needlessly forcing SQL to sort the results.

    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: View changing but not able to capture who/what is doing it

    Does the view use "SELECT *" and/or some other generic column name, such as $ROWGUID? [If you posted the view definition, sorry, I didn't see it.]

    You could also create 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: Find weekdays between 2 dates

    Luis Cazares (9/18/2014)


    N stands for "Nothing in particular" 😀

    I support your code if it's accompanied by the proper comments describing what it does. I'm not trying to be pedantic, this...

    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: Counting with Where clauses

    SELECT

    COUNT(C.[Place Referance]) AS [April Total Voids],

    SUM(CASE WHEN [Void End Date] IS NULL THEN 1 ELSE 0 END) AS [April_Still_Voids]

    ...

    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 to format value of a column and insert it into another column of the same table.

    You should use a computed column if possible. If not, you can still take the conversion code from below and use it in an UPDATE:

    ALTER TABLE [HR_DEV_DM].[CFQ_TEST].sp_CFQ_Commercial_Referrals

    ADD CreatedBy_SalesRepSharePointID 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: Find weekdays between 2 dates

    I recommend avoiding unnecessary string conversions/usage, and dependencies on language and/or other SQL settings.

    Not sure what the h "N" means, but I still suggest this style of code instead:

    WHERE DATEDIFF(DAY,...

    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: Importance of RAM for SQL Server 2008 (does bus speed matter?)

    Jeff Moden (9/18/2014)


    ScottPletcher (9/18/2014)


    CPU is typically not the bottleneck nowadays, I/O is. More RAM = bigger buffers = less I/O. Thus, RAM will typically be much more vital...

    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: Importance of RAM for SQL Server 2008 (does bus speed matter?)

    CPU is typically not the bottleneck nowadays, I/O is. More RAM = bigger buffers = less I/O. Thus, RAM will typically be much more vital to performance 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: [Help] Is there any quick way to tell if an object is a table or a view?

    Or:

    SELECT OBJECTPROPERTYEX ( OBJECT_ID('object_name') , 'IsView' ) AS IsViewOrNot

    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: How to perform mathematical formula without using case.

    @luis:

    I believe my code above met your (implied) challenge ;-).

    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: Table to Table Validation

    Use a trigger on InvLoc to keep the total in PStat up to date. No one should be updating the total in PStat directly if they need to be...

    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 - 5,776 through 5,790 (of 7,613 total)