Forum Replies Created

Viewing 15 posts - 3,496 through 3,510 (of 7,613 total)

  • RE: Help with T-SQL (2008R2)

    CASE WHEN ALTotalUnits / TotalProfiledHours >= 3 THEN <higher than 3 weeks>
    CASE WHEN ALTotalUnits / TotalProfiledHours < 3 THEN <lower than 3 weeks>

    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: Restore master to see system tables

    Alter the schema on those tables/views to 'dbo', then you should be able to view them just fine.

    If it doesn't allow that, you'd have to script them out,...

    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: I am wondering if this is the best solution for my issue

    Yeah, STUFF is good stuff!

    Another thing to note is that you need to STUFF from right to left.  Otherwise the stuffed chars throw off the byte locations.

    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 runs for ages but the internal select executes in seconds

    If you're literally using "*" in the view, refreshing the view is often needed too.  Not sure if that works for remote tables, but presumably it would (or SQL would...

    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: null date parameter for a stored procedure

    patrickmcginnis59 10839 - Friday, March 16, 2018 11:52 AM

    You really have to separate the two. If you try to apply a...

    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: null date parameter for a stored procedure

    sgmunson - Friday, March 16, 2018 7:44 AM

    MMartin1 - Thursday, March 15, 2018 11:49 AM

    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: Data schema or technology change?

    Cluster the table by the most common search.  Most searches aren't totally random each time.  If this one really is, use an int (or bigint) key, not a char(20) one...

    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: Debugging Subquery returned more than 1 value

    It doesn't look like you're passing a date, you're passing an id instead, which will get interpreted as a date but it won't be the date you expect or want.

    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: null date parameter for a stored procedure

    dmbaker - Thursday, March 15, 2018 6:49 AM

    MMartin1 - Wednesday, March 14, 2018 10:35 PM

    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: null date parameter for a stored procedure

    sgmunson - Wednesday, March 14, 2018 11:41 AM

    ScottPletcher - Tuesday, March 13, 2018 2:44 PM

    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: null date parameter for a stored procedure

    sgmunson - Tuesday, March 13, 2018 2:32 PM

    ScottPletcher - Tuesday, March 13, 2018 2:03 PM

    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: null date parameter for a stored procedure

    sgmunson - Tuesday, March 13, 2018 12:12 PM

    ScottPletcher - Tuesday, March 13, 2018 11:49 AM

    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: running trigger before deletion

    sgmunson - Tuesday, March 13, 2018 12:17 PM

    ScottPletcher - Tuesday, March 13, 2018 12:00 PM

    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: running trigger before deletion

    You should seriously consider specifying "ON DELETE SET NULL" in the FK relationship and let SQL do this for you rather than writing it yourself.

    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: null date parameter for a stored procedure

    sgmunson - Tuesday, March 13, 2018 11:40 AM

    ScottPletcher - Tuesday, March 13, 2018 11:30 AM

    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 - 3,496 through 3,510 (of 7,613 total)