Forum Replies Created

Viewing 11 posts - 1 through 11 (of 11 total)

  • RE: DBCC on a detached MDF file

    Lynn Pettis (4/18/2013)


    mike.hamilton721 (4/18/2013)


    Tried one more thing.. Not sure if I'm closer or farther away:

    insert into #DBID (LogicalName,BindingID)

    EXEC ('DBCC fileheader('+@dbid+')')

    But that gives me "column name or number of supplied values...

  • RE: DBCC on a detached MDF file

    Tried one more thing.. Not sure if I'm closer or farther away:

    insert into #DBID (LogicalName,BindingID)

    EXEC ('DBCC fileheader('+@dbid+')')

    But that gives me "column name or number of supplied values does not match...

  • RE: DBCC on a detached MDF file

    Ed Wagner (4/18/2013)


    First create a temp table to receive the data from your DBCC command. I used #table_name below.

    Then fire something similar to the following to populate it.

    EXECUTE sp_msforeachdb...

  • RE: DBCC on a detached MDF file

    Lynn Pettis (4/17/2013)


    I can see the problem, you have an extra single before the cast and before the final + sign.

    Look at what I had posted earlier.

    EXEC ('DBCC fileheader(' +...

  • RE: DBCC on a detached MDF file

    Lynn Pettis (4/17/2013)


    mike.hamilton721 (4/17/2013)


    Thank you Lynn. I tried that new EXEC you listed (missing a ' ?), and I thought I added it in the right spot. But...

  • RE: DBCC on a detached MDF file

    Thank you Lynn. I tried that new EXEC you listed (missing a ' ?), and I thought I added it in the right spot. But I'm not sure...

  • RE: DBCC on a detached MDF file

    Alright. Played around (and Googled), and came up with this:

    DBCC traceon (3604);

    drop table #DBID

    Create table #DBID (

    Name nvarCHAR(256)NULL,

    LogicalName nvarCHAR(256)NULL,

    BindingID nvarCHAR(256)NULL)

    declare @db varchar(256),

    @dbid int,

    @hidb int

    select @hidb = MAX(dbid),

    @dbid = 5

    from...

  • RE: DBCC on a detached MDF file

    Hmm, does that work with sp_msforeachdb? It's not liking what I'm putting in... Thank you for all the help!!!

  • RE: DBCC on a detached MDF file

    Thanks! Is there a way to compile all of the msforeachdb dbCC fileheader results into 1 page with just those 2 columns (I can't figure out how to do...

  • RE: DBCC on a detached MDF file

    I need to pull the logicalname and bindingid fields from fieldheader on multiple DBs, and place them in a text file. It looks like Windows Powershell might be able...

  • RE: DBCC on a detached MDF file

    Thanks! Well I'm trying to combine all of my results from a exec sp_msforeachdb 'dbcc fileheader(?)' into 1 table so I can just select 2 of the columns instead...

Viewing 11 posts - 1 through 11 (of 11 total)