Forum Replies Created

Viewing 15 posts - 6,151 through 6,165 (of 7,619 total)

  • RE: Looking for elegant solution! Finding match over multiple rows

    I've coded checks for just Animal table groupings. Please check and see if it produces the results you want.

    Edit: This is doing only full matches but partial matches could...

    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: SQL script to LOOP in and find sequence gap on Unique column

    It's possible but it's huge overhead you should probably avoid.

    You can use ROW_NUMBER() to sequentially number the data when you read it rather than having to physically update the values...

    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: Eliminating duplicates while insert

    You could try something like this and see if it helps:

    WITH cte_OrderProjectType AS

    (

    select A.Orderid, min(B.TypeID) , min(C.CTType) , MIN(D.Area)

    from tableA A inner join (

    select PID,...

    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: Eliminating duplicates while insert

    Please add an alias to columns in the SELECT:

    select ?.Orderid, min(?.TypeID) , min(?.CTType) , MIN(?.Area)

    Otherwise we can't really rewrite any of the code.

    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 on datediff

    What specifically does the data in the "Verdate" look like?

    For example, is it 'yyyymmdd hh:mm'?

    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: Deadlock prediction

    First properly tune the indexes, in particular getting the correct clustering index (hint: very often this means not clustering on an identity column). That is usually the single biggest...

    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 create a temp table in a procedure rather than usinh INTO #temptable

    Easiest way with accuracy to me is to run the code for each table create without producing any data, then script out the CREATE TABLE statement to copy into 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: Why would you create a foreign key and then disable it?

    Another possibility:

    It also provides documentation of the FK relationships.

    I suspect they wanted their application to be able to run on many different dbs. Some don't (or didn't) directly support...

    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: Index Breakdown

    Excellent! The other thing you need to include in your analysis is the "missing index" info from SQL (DMVs sys.dm_db_missing_index*).

    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: database owner option for sql srever 2005

    Is there anywhere Database owner log is logged in sql server 2005.

    sys.databases contains the owner of the db. That view is stored in the master db. ...

    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 Loading from Staging to Development -

    patla4u (4/9/2014)


    Thanks for your Reply.

    I understood that, I don't need to disable clustered index. Can I ask you Why?

    Thanks

    Bhavesh

    If you disable the clustered index, you've disabled the table, since 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: Percent Difference

    4 / 1172.0 is less than 1%, ~0.34%.

    To show less than 1%, change your code to this:

    CONVERT(DECIMAL(5, 2), (CAST(ProductionCnt.Count AS FLOAT)

    - CAST(avgcnt.Count AS FLOAT))

    / CAST(avgcnt.Count AS FLOAT) * 100) 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: Data Loading from Staging to Development -

    >> Do I need to disable Index while loading data from Dev to staging ? <<

    Can't say for sure without more details, but if it is a large % 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: Find the Numbers from a string

    Underlying code/logic:

    SELECT

    string,

    --len(string), last_numeric_char, length_of_numeric,

    SUBSTRING(string, last_numeric_char - length_of_numeric + 1, length_of_numeric)

    FROM (

    SELECT '123756zxfggr123456' AS string...

    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: The character string that starts with ... is too long. Maximum length is 4000

    I believe the "EXECUTABLE FILE = " is supposed to be a file path to the executable, not the executable binary code itself.

    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 - 6,151 through 6,165 (of 7,619 total)