Forum Replies Created

Viewing 15 posts - 1,096 through 1,110 (of 1,993 total)

  • RE: Making New Infrastructure Investments

    im curious,

    a lot of the resistance to cloud usage comes from a financial standpoint or a good old fashioned control of hardware need... but has anyone looked at this...

    MVDBA

  • RE: Dynamic SQl error - I might be doing something wrong.

    michael vessey (5/24/2012)


    sqlbee19 (5/23/2012)


    michael vessey (5/23/2012)


    the multiple rows returned in your select statement are corrupting the @cmd value - in theory the value returned should be correct (although if you...

    MVDBA

  • RE: Dynamic SQl error - I might be doing something wrong.

    sqlbee19 (5/23/2012)


    michael vessey (5/23/2012)


    the multiple rows returned in your select statement are corrupting the @cmd value - in theory the value returned should be correct (although if you use any...

    MVDBA

  • RE: sys.dm_db_index_physical_stats hangs in one of my databases

    GilaMonster (5/23/2012)


    Check your IO throughput. Sounds like the drive is not responding as it should.

    Index physical stats doesn't run showcontig, more the other way around. Showcontig is deprecated and just...

    MVDBA

  • RE: General Qestions

    Koen Verbeeck (5/24/2012)


    Schadenfreude-Mei (5/24/2012)


    Robert Davis (5/23/2012)


    I laughed very hard at the replies here, but if we're posting serious answers now, I think the OP should start with this post by...

    MVDBA

  • RE: Where are the good Senior Level DBA's?

    Lynn Pettis (5/23/2012)


    michael vessey (5/23/2012)


    The person who wrote the original code or the tester that allowed it to make it into production?

    ahem.... the tester didn't put the defect...

    MVDBA

  • RE: Set based iteration

    ...anything that necessarily iterates over 1 row at a time and cannot be made to iterate of more than 1 row at a time (you can read that as processes...

    MVDBA

  • RE: Set based iteration

    oh and a recursive CTE may be an iterative operation, but when cross joined for an insert the "Insert" is not iterative..... it's still a set based operation in the...

    MVDBA

  • RE: Set based iteration

    Jeff Moden (5/23/2012)


    michael vessey (5/23/2012)


    try this

    with x (id) as

    (select 1 as id

    union all

    select ID+1 from X as id

    where id<10000

    )

    insert into fooTable

    select d.name from sysdatabases d cross join...

    MVDBA

  • RE: Where are the good Senior Level DBA's?

    The person who wrote the original code or the tester that allowed it to make it into production?

    ahem.... the tester didn't put the defect there (the developer did)...

    MVDBA

  • RE: Set based iteration

    see my example

    create table footable (name varchar(1000))

    go

    select 'aaaaa';

    with x (id) as

    (select 1 as id

    union all

    select ID+1 from X as id

    where id<10000

    )

    insert into fooTable

    select d.name from sysdatabases d cross...

    MVDBA

  • RE: Set based iteration

    any code before the "WITH x as" must be terminated with a ;

    MVDBA

  • RE: Dynamic SQl error - I might be doing something wrong.

    the multiple rows returned in your select statement are corrupting the @cmd value - in theory the value returned should be correct (although if you use any fields from sys.server_principals...

    MVDBA

  • RE: Dynamic SQl error - I might be doing something wrong.

    sqlbee19 (5/23/2012)


    Please run below code

    ----------------------------

    set nocount on

    declare @role varchar(255),@dbname varchar(255)

    declare @rowid int

    declare @user nvarchar(255)

    declare @cmd varchar(8000)

    set @dbname = 'Mydatabasedashboardaaaaaaaaa1111'

    set @role = 'db_owner'...

    MVDBA

  • RE: select distinct?

    you need to use a ranking function to find the first instance of a value

    see my example below

    select x.* from

    (

    select id,name,ROW_NUMBER() over (partition by id order by name asc)...

    MVDBA

Viewing 15 posts - 1,096 through 1,110 (of 1,993 total)