Forum Replies Created

Viewing 15 posts - 526 through 540 (of 1,229 total)

  • RE: Get month names ordered using recursion

    Used as a function:

    CREATE FUNCTION [dbo].[DelimitedSplit8K_CTE]

    --===== Define I/O parameters

    (@pString VARCHAR(8000), @pDelimiter CHAR(1))

    RETURNS TABLE WITH SCHEMABINDING AS

    RETURN

    WITH Splitter AS (

    SELECT...

  • RE: Get month names ordered using recursion

    Here's one way of limiting the rowcount:

    DECLARE @pString VARCHAR(8000), @pDelimiter CHAR(1)

    SET @pString = 'one,TWO,THREE,FOUR,five,six,seven,eight,nine,ten,eleven,twelve,thirteen,fourteen,fifteen,sixteen,seventeen,eighteen,nineteen,twenty,twenty one,twenty two,twenty three,twenty four'

    SET @pDelimiter = ','

    SELECT

    ItemNumber = CAST(0 AS BIGINT),

    Item = LEFT(@pString, CHARINDEX(@pDelimiter,@pString+@pDelimiter,0)-1)...

  • RE: Creating a select query as an object. Then adding the results of this record set to the message source of an email

    Debbie Edwards (2/7/2012)


    Hi thanks for the replies.

    I was hoping to not have to create additional csv files, I was hoping to keep everything as simple as possible by having them...

  • RE: Creating a select query as an object. Then adding the results of this record set to the message source of an email

    Have you tried playing with HTML body format messages? The flexibility it offers is a real eye opener:

    -- make some data to play with:

    SET NOCOUNT ON

    DROP TABLE #Table1

    CREATE TABLE #Table1...

  • RE: Using split funtion for multiple values

    pwalter83 (2/6/2012)


    ChrisM@home (2/6/2012)


    pwalter83 (2/6/2012)


    Hi,

    I need to use the split function to display values separated by comma(,). However, the problem I am facing is that the values itself are separated by...

  • RE: Using split funtion for multiple values

    pwalter83 (2/6/2012)


    Hi,

    I need to use the split function to display values separated by comma(,). However, the problem I am facing is that the values itself are separated by space. For...

  • RE: Join performance

    This is something of a long shot based on observation. There are two key changes.

    UPDATE c SET

    MATCH_FLAGS = CASE WHEN c.MATCH_FLAGS&1 = 1 THEN 4 ELSE c.MATCH_FLAGS +...

  • RE: Guidance on returning result set for previous month

    Cadavre (2/1/2012)


    WHERE date_received >= DATEADD(MONTH, DATEDIFF(MONTH, 0, GETDATE()) - 1, 0) AND

    date_received < DATEADD(MONTH, DATEDIFF(MONTH, 0, GETDATE()), 0)

    Too quick for me today mate...

  • RE: Guidance on returning result set for previous month

    A reasonably good way to do this is to calculate a start and end date for your range. Here's a little standard date arithmetic to give you some ideas:

    SELECT DATEADD(month,DATEDIFF(month,0,GETDATE())+1,-1)...

  • RE: Need to perform a count based on dates from different tables

    Hi Michael

    Something is still bugging me about this project. Of these three tables...

    StagingViews.ClaQuestionView

    Staging.ClaCases

    AF_Fraud_Jan_24

    ...which if any are created or altered by the exercise "find individuals (NameID) where a motor claim was...

  • RE: Need to perform a count based on dates from different tables

    Hi Michael

    I've got a hunch that this problem could be resolved with something simple like so:

    SELECT af.*, d.*

    FROM AF_Fraud_Jan_24 af

    INNER JOIN (

    SELECT cc.NameID, cqv.ClaCaseID, cqv.Answer, cqv.QuestionDate

    FROM StagingViews.ClaQuestionView cqv

    INNER JOIN Staging.ClaCases...

  • RE: Restart Counting with Row_Number()

    SQLRNNR (1/26/2012)


    ChrisM@home (1/26/2012)


    SQLRNNR (1/26/2012)


    ChrisM@home (1/26/2012)


    SQL Kiwi (1/26/2012)


    ...Using an rCTE for this sort of sequencing problem isn't as new as that other thread we participated on recently, and the logic (to...

  • RE: Restart Counting with Row_Number()

    SQLRNNR (1/26/2012)


    ChrisM@home (1/26/2012)


    SQL Kiwi (1/26/2012)


    ...Using an rCTE for this sort of sequencing problem isn't as new as that other thread we participated on recently, and the logic (to me anyway)...

  • RE: Restart Counting with Row_Number()

    SQL Kiwi (1/26/2012)


    ...Using an rCTE for this sort of sequencing problem isn't as new as that other thread we participated on recently, and the logic (to me anyway) is a...

  • RE: Nasty Deadlock Issues

    Artoo22 (1/26/2012)


    fahey.jonathan (1/25/2012)


    For anyone else trying to read the SQL plan files, when I downloaded them, they showed up with an "xml" extension so I had to rename them with...

Viewing 15 posts - 526 through 540 (of 1,229 total)