Forum Replies Created

Viewing 15 posts - 4,561 through 4,575 (of 7,613 total)

  • RE: How to catch actual parameter value passed into a stored procedure?

    Sergiy (12/14/2015)


    ScottPletcher (12/14/2015)


    1) I wouldn't advise writing that type of info into error logs.

    Why?

    What do you think Application Event Log is for?

    For Application Events. Stored proc parameters are not...

    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 solve for orders where the status on every item is greater than status of 3

    Select order_number,

    min(serial_number) AS serial_number_min,

    max(serial_number) AS serial_number_max,

    min(status) AS status_min,

    max(status) AS status_max

    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: How to catch actual parameter value passed into a stored procedure?

    Sergiy (12/14/2015)


    You may add something like this into your procedure:

    DECLARE @ProcName sysname, @Param INT

    SELECT @ProcName = OBJECT_NAME(@@PROCID), @Param = 1000

    IF HOST_NAME() = 'My Test Host'

    RAISERROR ('Started procedure %s, Parameter supplied:...

    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: Using count(*) performance

    If you have indexes keyed on tbl2.col1 and on tbl3.col1, then it almost has to be some type of blocking. You could try the query below, might work better,...

    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: Using count(*) performance

    Do you have a nonclustered, nonfiltered index containing tbl2.col1?

    A nonclustered, nonfiltered index containing tbl3.col1?

    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: Best Practice - how to exclude records?

    If you need to know if all the lines have only product_type = 'A' on any kind of regular basis, I'd denormalize and add a flag to the invoice header,...

    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 select 200k data faster in sql

    Jeff Moden (12/12/2015)


    ScottPletcher (12/10/2015)


    Do you have a unique index on Word? You don't want SQL to have to sort the words every time -- that will be extremely slow....

    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: what is the best way to rewite a oracle sql query to sql server 2012

    Here's a few notes on the conversion process, and a sample of the first table converted.

    The double quotes are fine, as long as "SET QUOTED_IDENTIFIER ON" is active, which 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: TempDB Log growing

    Is the log size growing, or just the % used? You don't want the log size to grow dynamically, as that will slow down the database. But tempdb...

    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 catch actual parameter value passed into a stored procedure?

    If it's for a single, specific stored proc, could you just add code to that proc to save the parameter values that came in? You could even have an...

    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 select 200k data faster in sql

    Do you have a unique index on Word? You don't want SQL to have to sort the words every time -- that will be extremely slow. Also, if...

    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: indexing Datetime column

    The clustered index is definitely correct. Date will be mildly more efficient than datetime, but it's not enough of a difference to be a big deal.

    Make sure the fillfactor...

    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: SELECT 1 random row query help, please

    kiril.lazarov.77 (12/10/2015)


    ScottPletcher (12/9/2015)


    Create a separate index of just the IDs. Then select a random ID using ORDER BY NEWID(), then use that ID to get the rest of 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: SELECT 1 random row query help, please

    kiril.lazarov.77 (12/10/2015)


    ScottPletcher (12/9/2015)


    Create a separate index of just the IDs. Then select a random ID using ORDER BY NEWID(), then use that ID to get the rest of 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: how extract values from expressions

    If it's always a "w" followed by a digit or digits, perhaps just this?!:

    declare @testdata table(expression varchar(500))

    insert into @testdata values('[w1+w2+w3/5]'),('[(w1+w2+w3)/5]'),('[(w4-w5*w6)/5]')

    insert into @testdata values('w1')

    insert into @testdata values('2w3')

    insert into @testdata values('4+w5')

    select 'w'...

    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 - 4,561 through 4,575 (of 7,613 total)