Forum Replies Created

Viewing 15 posts - 7,651 through 7,665 (of 8,753 total)

  • RE: Are the posted questions getting worse?

    SQLRNNR (7/31/2014)


    William J. Fellows (7/31/2014)


    To qualify my statement, Steve stares at my legs a lot. 😛

    Well, you have good looking legs.

    :exclamation:Unwanted details:sick:

  • RE: Are the posted questions getting worse?

    William J. Fellows (7/31/2014)


    To qualify my statement, Steve stares at my legs a lot. 😛

    Think you got it wrong, he's not the tallest tree in the forest:-P

    😎

  • RE: Are the posted questions getting worse?

    Steve Jones - SSC Editor (7/31/2014)


    Just dropped over to the Heap Consultancy and I see a comment from Bill in KC about me staring at him from the login banner...

  • RE: Missing Century in Date

    Quick fix for your update

    😎

    declare @mycutoff date = '01/01/2020';

    select [Date] = CONVERT(VARCHAR(10),CASE WHEN convert(datetime,'7/26/29',1) >= @mycutoff THEN DATEADD(YEAR,-100,convert(datetime,'7/26/29',1)) ELSE convert(datetime,'7/26/29',1) END,103)

    Result

    26/07/1929

  • RE: Missing Century in Date

    SQLSeTTeR (7/31/2014)


    Gents - the birthday is 1929 not 2029. I would prefer not to update the server because I don't now the impact.

    Sorry, didn't notice the century before, looks...

  • RE: Missing Century in Date

    Further on Michael's excellent advice, the CONVERT function takes the third optional parameter [style], controls the style of the input/output.

    😎

    select [Date] = CONVERT(VARCHAR(10),convert(date,'7/26/29',1),101)

    Results

    07/26/2029

    European

    select [Date] = CONVERT(VARCHAR(10),convert(date,'7/26/29',1),103)

    Result

    26/07/2029

  • RE: XML Query Help row with no data

    Phil Parkin (7/31/2014)


    Don't think this works if there is no underlying row selected.

    You are right Phil, works for columns but not rows;-)

    Here is a workaround

    😎

    declare @address table

    (

    AddressID int,

    AddressType...

  • RE: XML Query Help row with no data

    Use the ELEMENTS XSINIL after the FOR XML clause.

    😎

  • RE: Bulk insert with SQLINT changes int vlaues

    terry999 (7/31/2014)


    Thanks

    Where do I put the -c I tried

    BULK INSERT tBCP FROM 'C:\temp\tbcp.csv'

    WITH (FORMATFILE='C:\temp\fmt.fmt', DATAFILETYPE='char')

    It doesn't work

    Ooops, my bad, I was thinking in bcp:-P

    Should be DATAFILETYPE = 'char'

    😎

  • RE: common Table(cte) in store procedure?

    Sivaganesh Tamilvendhan (7/31/2014)


    Hi,

    while writing store procedure in db

    most of Time i will Use common Table to write select quries

    for selecting more than seven table whether...

  • RE: Bulk insert with SQLINT changes int vlaues

    You might want to add -c (character format) as it looks like it is using native (-n) format.

    The 21 -> 50 49 -> 12594 is because it translates the character...

  • RE: Bulk insert with SQLINT changes int vlaues

    Quick question, does 7 get translated to 55? Looks like it is reading the character code values as the actual values, change it to SQLCHAR and then convert to int.

    😎

  • RE: Group Count

    Do you mean something like this?

    😎

    select * from (

    select

    [MediaName]

    ,[Spend]

    ,[ClientName]

    ,[BookingYear]

    , ROW_NUMBER() OVER(ORDER BY [Spend] DESC) As Row

    from(

    select

    lhe.LHECRELongDesc as [MediaName]

    ,cast(sum(spo.SPODiscountedCost) as money) as [Spend]

    ,cli.CLILongDesc AS...

  • RE: HI...Sample INSERT statement script needed to insert 500 million rows into in-memory table sql server 2014

    Quick suggestion, create multiple views on the source server, i.e. vw_source_1_100000000, vw_source_100000001_200000000 etc. where you filter the rows into the right sized chunks.

    Then use the import/export thingy to append...

  • RE: How to Reduce the Table Size...

    Chowdary's (7/30/2014)


    Hi Eirikur Eiriksson,

    Pls find the below

    1. What is the output of this query?

    A:Enterprise Edition (64-bit),3

    2. Can you post the CREATE TABLE script for the table?

    A.PFA

    3. Is this a production...

Viewing 15 posts - 7,651 through 7,665 (of 8,753 total)