Forum Replies Created

Viewing 15 posts - 5,101 through 5,115 (of 5,678 total)

  • RE: Week Part

    Figured it out again (I think):

    DECLARE @beginYear DATETIME

    SET @beginYear = DATEADD (yy, YEAR(getdate()) - 1900 , 0)

    PRINT dateadd( dd, (DATEPART( wk, getdate()) - 1) * 7 - datepart(dw, @beginYear)...


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA

  • RE: Advantage of Stored Procedure?

    Numerous.

    Stored Cache in engine.

    Security allowed execute only on proc and no direct data access.

    Multiple call reusability.

    (Depending on tasks) Can do multi-step processes that a view cannot.

    Helps to protect against SQL...


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA

  • RE: Week Part

    Well, there's

    DATEPART( mm, @date) which will give you the month.

    DATEPART( ww, @date) which will give you the week # in the year.

    You'll use those for sorting.

    For display, you can then:

    DATENAME(...


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA

  • RE: Are the posted questions getting worse?

    Roy Ernest (11/2/2010)


    Thank You. I saw some sunlight about 5 minutes back. So that is a good sign. 🙂 After 24 hrs.. 🙂

    Must have been one wild ride. Glad...


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA

  • RE: Using output of a Stored Procedure in an UPDATE statement

    Nope. I have only used the return value, or selected the results of the exec into a temp table and then used whatever I needed from the #tmp.


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA

  • RE: Life Without a Net

    Gift Peddie (11/2/2010)


    The net is the great equalizer it is the reason very few code sets impress me because most are modified Microsoft or now Oracle code. I have...


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA

  • RE: PARSING a Concatenated string into columns

    Figured out the problem. It's because the 'tabs' are converted to spaces when I copy/paste the code in. Seeing if it works from plain encoding. Yes, plain...


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA

  • RE: help needed with datetimes

    naidu4u (11/2/2010)


    I am unable to structure the code, I mean its becoming really difficult to insert the row column in this tmp table...(by using views since I can really insert...


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA

  • RE: PARSING a Concatenated string into columns

    SQL33 (11/2/2010)


    It looks like this code combines the results of the first few columns and then parses them along with the last column (the MsgText http column) back out. ...


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA

  • RE: Daylight Savings Time

    I must say I'm suddenly quite happy to be living in AZ. We don't mess with that old farmer's wit of a time system. Savings time... bah! ...


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA

  • RE: Detailed RAID explanation and question.

    OS is reading and writing to the drive, SQL is reading/writing to its Data file, and SQL is reading/writing to its Log file.

    Add one more, the tempdb is churning on...


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA

  • RE: Stored Procedure Takes long time on one Server, but quick on another

    What kind of CPU pressure is on your production box? It's a standard signal wait, well, for the class of them. I found this query to help measure...


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA

  • RE: Stored Procedure Takes long time on one Server, but quick on another

    mymail.default (11/2/2010)


    Craig,

    I made the SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;

    and unfortunately it did not improve things at all...

    Strange! There should be something else causing the issue.

    Rats.

    One important thing I...


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA

  • RE: PARSING a Concatenated string into columns

    Alright, end to end code. SQL33, please note, I have no idea what a number of these fields mean, and if I got your spacing off, there should be...


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA

  • RE: Nonclustered Index on Temp Table

    GilaMonster (11/2/2010)


    Correct. Index names only have to be unique within a table, while constraint names have to be unique in the DB

    I so rarely create constraints I'd forgotten that. ...


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA

Viewing 15 posts - 5,101 through 5,115 (of 5,678 total)