Forum Replies Created

Viewing 15 posts - 1,486 through 1,500 (of 10,144 total)

  • RE: Are the posted questions getting worse?

    Beatrix Kiddo (6/22/2016)


    I'm f@*king terrified.

    Me too, and ashamed of the xenophobes.

    Back to SQL Server, I work for a company that has a lot of trading systems. We are expecting meltdown...

  • RE: Scalar Function - Format Numbers

    Ed Wagner (6/22/2016)


    whymaravele (6/22/2016)


    Hi

    I have this function

    CREATE FUNCTION [dbo].[fnFormatMobileNumber] (@phone VARCHAR(15))

    RETURNS VARCHAR(15)

    AS

    BEGIN

    DECLARE @Formatted VARCHAR(15)

    IF (LEN(@phone) > 10)

    SET @Formatted = '0' + SUBSTRING(@phone,3,9)

    ELSE SET @Formatted = @phone

    RETURN @Formatted

    END

    select

    [dbo].[fnFormatMobileNumber](0842507889)

    I...

  • RE: How to perform multiple STUFF

    DECLARE @JobNum TABLE([JobNum] [NVARCHAR](14) NOT NULL);

    INSERT INTO @JobNum (JobNum) VALUES

    ('ABLobby-ABL-1')

    ,('ABLobby-ABL-2')

    ,('ABLobby-ABL-5')

    ,('ABLobby-ABL-10')

    ,('ABLobby-ABL-11')

    ,('ABLobby-ABL-15')

    ,('ABLobby-ABL-20')

    ,('001656-1-1')

    ,('001656-2-1')

    ,('001656-10-1')

    ,('001656-13-1')

    ,('001656-13-2')

    ,('001656-13-10')

    ,('001656-13-11')

    SELECT *,

    PARSENAME(REPLACE(JobNum,'-','.'),3),

    PARSENAME(REPLACE(JobNum,'-','.'),2) ,

    PARSENAME(REPLACE(JobNum,'-','.'),1)...

  • RE: How to perform multiple STUFF

    Look up PARSENAME as Luis posted. Ideal for this.

  • RE: Are the posted questions getting worse?

    BWFC (6/22/2016)


    jasona.work (6/22/2016)


    So, I'm curious, and I'm also tempted to spin this up in another topic as I suspect this is a contentious issue, what's everyone's feelings / opinions on...

  • RE: problem converting date on procedure.

    astrid 69000 (6/22/2016)


    i know what my error is, i just don't know how to fix it. :w00t:

    It's the opposite way around for us!

  • RE: problem converting date on procedure.

    Aren't you curious to see what your dynamically-constructed statement looks like?

    alter proc ShortReporRequest_sp

    @CompanyName nvarchar(20),

    @RequestDate datetime

    as

    begin

    declare @TableName nvarchar(200)

    ...

  • RE: problem converting date on procedure.

    astrid 69000 (6/22/2016)


    Hi,

    thanks, but it is still not using the date. it doesnt not give an error type anymore, but the outcome of the query is not what requested.

    i do...

  • RE: New T-SQL Fixed Width "Splitter"

    Excellent writeup Alan, thanks for posting this. I had no idea about n-grams, despite having used them for fuzzy-matching for years.

  • RE: Are the posted questions getting worse?

    jasona.work (6/21/2016)


    Geez, where the heck has the year gone?

    We're just under 2 weeks out from the half-way mark of the year...

    Absolute time vs relative time, or don't clock-watch when you're...

  • RE: problem converting date on procedure.

    astrid 69000 (6/21/2016)


    no, it was time, but i dont know what to do to get it working, so i am trying to cast here or there.

    maybe i am calling the...

  • RE: Using data windows in 650M rows table

    This format is preferable because folks can begin working with it straight away:

    CREATE TABLE #Temp (ActionId INT NULL, CustomerId INT NULL, Action CHAR(1) NULL, Subaction CHAR(1) NULL, ACTdatetime DATETIME NULL,...

  • RE: reset counter by year / month / day

    You're welcome.

  • RE: reset counter by year / month / day

    This?

    DENSE_RANK() OVER(PARTITION BY MONTH(yourcolumn) ORDER BY yourcolumn)

  • RE: Using data windows in 650M rows table

    Can you set up some sample data please Celia? It doesn't need to contain all of the columns, just the ones required to help identify the problem domain.

    Cheers.

Viewing 15 posts - 1,486 through 1,500 (of 10,144 total)