Forum Replies Created

Viewing 15 posts - 61 through 75 (of 388 total)

  • RE: copy/paste multiple columns

    liver.larson (10/11/2013)


    nifty.

    Is there any way to structure the shortcut so you don't have to wrap the parameter in ' ', so I could just highlight my database.schema.objectname and...

  • RE: copy/paste multiple columns

    Micha-1016108 (10/10/2013)


    Very helpfully, especialy with the shurtcut.

    WHY do you have posted this not 5 years ago!!

    BUT I always get an Error when I marked for example schema.tablename and press...

  • RE: copy/paste multiple columns

    I like it -> 5 stars from me. Nice idea, and easily extensible. I'm not sure I'd have gone for the dynamic sql...I'd have left it to the...

  • RE: aggregation rules ( Max or Join )

    Have a play with the code below. The other columns aren't really a problem...you can just include them.

    I'm sure this could be done a lot more concisely, but this...

  • RE: Does anyone else...

    For more on the xml approach, check out this article (the url is for part 2, but part 1 will give you the introduction.)

    http://www.sqlservercentral.com/articles/XML/66518/

  • RE: Replacement for a whole mess of left joins?

    This is cosmetic, but all these nested subselects could be tidied up with a few inner joins

    Thus we would replace

    -----------

    and T3689065.serial not in (

    ...

  • RE: Does anyone else...

    I do use sql quite frequently for generating code. But I also use excel, where I put into the first column my template sql with tokens for the variables...

  • RE: Sorting Months By Number (SQL Spackle)

    Yep. For single rows, that will work just fine. Try your code with a GROUP BY and a SUM on the Sale column and see what happens. 😉

    ...below...

  • RE: Sorting Months By Number (SQL Spackle)

    -- another method, this time with datediff. (don't think it was covered before....apologies if it was.)

    SELECT Created_Date, DATENAME(mm,Created_Date), Sale

    FROM

    (

    SELECT Created_Date = '2012-12-01', Sale = 10000

    UNION

    SELECT Created_Date = '2012-02-01', Sale...

  • RE: Sorting Months By Number (SQL Spackle)

    Jeff,

    Before my post, I did in fact (quickly) read through all the comments...and the month function was mentioned a number of times already. I didn't see any added value...

  • RE: Sorting Months By Number (SQL Spackle)

    Chris,

    Are we reading the same article, or have you got a premium subscription? 😉

    But how do you display just the month name? Most people end up making a scalar function...

  • RE: Sorting Months By Number (SQL Spackle)

    Hi Jeff,

    As regards why the article got marked down, I'd suggest that it's because you didn't mention the obvious solution.

    You want to sort by the month number; In...

  • RE: Utilizing Fake Partitioning with a View

    This better explains the question than I could

    https://www.simple-talk.com/sql/sql-tools/sql-server-partitioning-without-enterprise-edition/[/url]

  • RE: Utilizing Fake Partitioning with a View

    (I'm talking here about a partitioned view rather than a partition scheme, which came more recently.)

    I'm very rusty on this, as it's a number of years since I've used this,...

  • RE: Utilizing Fake Partitioning with a View

    I reckon that you should put contiguous check constraints on the date field in each table, as if you were doing a real partitioned table. Can't do any harm,...

Viewing 15 posts - 61 through 75 (of 388 total)