Forum Replies Created

Viewing 15 posts - 6,871 through 6,885 (of 7,619 total)

  • RE: Conversion

    Not 100%, as I don't have any table definition to look at.

    But if fromdate and todate are both in the text format above, then something like:

    SELECT

    ...other_columns...

    ...

    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: Conversion

    select

    convert(varchar(20), cast(stuff(substring(string, 5, 15), CHARINDEX(':', substring(string, 5, 15)) - 3, 0, RIGHT(string, 5)) as datetime), 120)

    from (

    select 'Mon...

    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: WHERE vs. GROUP BY again

    Igor Makedon (1/28/2013)


    Fine!

    Are the folowing two SELECT statements equvalent (i.e. -- see my original question, -- "return exactly the same row set" no matter "what data is")?

    [font="Courier New"]SELECT xx 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: WHERE vs. GROUP BY again

    WHERE and HAVING are fundamentally different; they should never be thought of as equivalent or interchangeable. That is, for a given query/subquery, only one of them is right to...

    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: Stored procedure explanation

    Bhuvnesh (1/28/2013)


    niha.736 (1/27/2013)


    How can I go with this SP's while creating or modifying.

    if exists (select 1 from sysobjects where name = 'getNotificateProduct')

    DROP PROCEDURE [dbo].[getNotificateProduct]

    GO

    Create PROCEDURE [dbo].[getNotificateProduct]

    (

    )

    begin

    ....

    ....

    end

    IS...

    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: Can't shrink physical logfile size.

    SQL will tell you if/why it won't shrink the log:

    SELECT log_reuse_wait_desc, * --col name may be a little off, from memory, but it's at least close

    FROM sys.databases

    WHERE name = 'yourDbName'

    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: create synonym to schema

    Nope, you have to synonym every object:

    [LiveServer].[Databade].[TheSchema].[ObjectName1] --> [DevServer].[Databade].[TheSchema].[ObjectName1]

    [LiveServer].[Databade].[TheSchema].[ObjectName2] --> [DevServer].[Databade].[TheSchema].[ObjectName2]

    etc.

    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: Any chance of success?

    The only real "success" is for the 3rd party hack cashing the checks. Anyone trying to implement or maintain this system is, as "The Big Bang Theory" put 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: Computed column with/with out PERSISTED

    Jeff Moden (1/28/2013)


    My personal opinion is that if you're not going to persist a calculated column, write a derived table or view, instead. That way, no one can screw...

    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: Foreign Keys,Deadlocks, Partioning,OLTP ......what is the best setup?

    Just curious:

    How did you determine that the deadlocking was due to FK lookups?

    Legitimate FKs should be used when possible. FK definitions in SQL itself are vastly more efficient...

    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 find if a job ran successfully?

    ScottPletcher (1/25/2013)


    MyDoggieJessie (1/25/2013)


    And Yes, changing the job name itself would still cause an issue, however hopefully changes like that would be made by a DBA or otherwise communicated that 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: How to find if a job ran successfully?

    MyDoggieJessie (1/25/2013)


    And Yes, changing the job name itself would still cause an issue, however hopefully changes like that would be made by a DBA or otherwise communicated that a change...

    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 find if a job ran successfully?

    MyDoggieJessie (1/25/2013)


    newdba_sql (1/25/2013)


    Yeah... For somereason I was putting job name but not the job id......:w00t:

    So this script will check if the job's last run status is successful, then it will...

    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: where fldValue=123 vs join to table with one row

    Sean Pearce (1/25/2013)

    PLEASE NOTE: You have not aliased all your columns so I have no idea which tables they come from. You must edit the following queries to remove any...

    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: Subtracting specific dates from today

    Of course if you just code your dates as 'YYYYMMDD', conversion always works, and you don't have to waste a second on any of that other garbage.

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