Forum Replies Created

Viewing 15 posts - 241 through 255 (of 321 total)

  • RE: Shifting values to the left

    Sean Lange (4/10/2012)


    And yet another way to skin this cat...

    create table #Address

    (

    id int,

    addr1 varchar(25),

    addr2 varchar(25),

    addr3 varchar(25)

    )

    insert #Address

    select 1, '123', NULL, 'Main St.'

    union all select 2, NULL, NULL, NULL

    union all select...

    Mike Scalise, PMP
    https://www.michaelscalise.com

  • RE: Shifting values to the left

    opc.three (4/10/2012)


    SQLKnowItAll (4/10/2012)


    The other option is to do this in separate queries starting with checking col 3 and moving data left. Then column 2.

    That's the ticket, but only one...

    Mike Scalise, PMP
    https://www.michaelscalise.com

  • RE: Shifting values to the left

    This will probably end up being a regular operation.

    Mike Scalise, PMP
    https://www.michaelscalise.com

  • RE: Shifting values to the left

    Yes, that's my ultimate goal. I'm just trying to think of ways I can accomplish that. For example, I could probably use a combination of ISNULL() with concatenation with a...

    Mike Scalise, PMP
    https://www.michaelscalise.com

  • RE: Shifting values to the left

    It's not that I mind using three case statements. It's that I don't think they'll be that simple. How about with concatenation?

    Mike Scalise, PMP
    https://www.michaelscalise.com

  • RE: Generic Database Naming Convention

    Thanks, guys.

    @GSquared -- yes, that's exactly what I was talking about, and I think the DB name "Common" is a good way to represent all of that information.

    @steve-2 -- you...

    Mike Scalise, PMP
    https://www.michaelscalise.com

  • RE: Validate Network Account

    Nevermind, I think I was thinking of IS_MEMBER.

    Thanks anyway,

    Mike

    Mike Scalise, PMP
    https://www.michaelscalise.com

  • RE: NTILE help

    Thanks guys, very helpful! I have one more question. Is there any way make it so that if there's a remainder, it's at the beginning instead of at the end?

    For...

    Mike Scalise, PMP
    https://www.michaelscalise.com

  • RE: Run batch file from SQL

    Jeff Moden (12/6/2011)


    Do you have any users on your server, other than "SA", that absolutely require "SA" privs for anything else other than xp_CmdShell usage?

    No, I do not.

    -Mike

    Mike Scalise, PMP
    https://www.michaelscalise.com

  • RE: Run batch file from SQL

    Under which user context would the CLR function be run?

    Mike Scalise, PMP
    https://www.michaelscalise.com

  • RE: alter table alter column question regarding how many columns can be altered in 1

    As far as I know, you only have two options:

    1) Create a new table with the correct column collations, load the data from the original table into it, and replace...

    Mike Scalise, PMP
    https://www.michaelscalise.com

  • RE: calculating a median for groups

    wizard_froto (11/14/2011)


    An example would be:

    mytable

    State City Sales Qty

    CA ...

    Mike Scalise, PMP
    https://www.michaelscalise.com

  • RE: calculating a median for groups

    Can you provide an example?

    Mike Scalise, PMP
    https://www.michaelscalise.com

  • RE: calculating a median for groups

    This will get you there:

    SELECT [State],

    City,

    AVG(NUMBER) AS Median

    FROM (SELECT [State],

    ...

    Mike Scalise, PMP
    https://www.michaelscalise.com

  • RE: Calling 1 query from another

    cljolly (11/14/2011)


    For example, I have several table drops to make and the top of my program is getting cluttered which is where I put all of my table drop code....

    Mike Scalise, PMP
    https://www.michaelscalise.com

Viewing 15 posts - 241 through 255 (of 321 total)