select * from sysobjects where name like '%sysconst%'

  • Why doesn't the below query show sysconstraints as an output?

    select * from sysobjects where name like '%sysconst%'

  • It's a system object. Check the Master database.

    use master

    select so.name,sc.text

    from syscomments sc

    join sysobjects so on so.id = sc.id

    where text like '%syscon%'

    and name like 'syscon%'

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • Hello

    The sysobjects is only available for backward compatibility in SQL Server 2005/2008.

    You should use the sys.objects (on master database) or the sys.all_objects views.

    Greets

    Flo

  • Flo,

    I'm afraid I'm unable to duplicate your results. I'm comparing an insert into/SELECT ... union all against a insert into VALUES for 1000 rows. The UNION ALL technique is running consistently faster on my machine, which I would expect because it's a single INSERT, as Bruce already stated.

    Whenever possible you want to handle entire sets of data, instead of individual rows. When you look at the execution plan of the SELECT/UNION ALL approach, it amounts to single insert fed by the scan of an internal table of constants.

    Bob

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • Maybe wrong thread 😉

  • 1) use master

    select * from sysobjects so where name like 'sysconst%'

    go

    2) use master

    select * from sys.all_objects where name like 'sysconst%'

    go

    these two worked. thanks!!!

  • You're welcome, VM.

    Flo, yes it's the wrong thread. I'm trying to figure out how I posted it here AND why I can't delete it now.

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply