GithubHelp home page GithubHelp logo

Comments (4)

ansgarbecker avatar ansgarbecker commented on May 12, 2024

Could you please provide the very last 3 or 5 SQL queries from the log panel at the bottom when the crash dialog happens? Screenshot would be nice.

from heidisql.

Alexsey avatar Alexsey commented on May 12, 2024

haidi_bug_1

from heidisql.

Alexsey avatar Alexsey commented on May 12, 2024

Now, looking in to query log, I understand that this is what I should be posted in the first place :)

from heidisql.

ilpssun avatar ilpssun commented on May 12, 2024

I think the correct way to handle this would be to just display a notice that heidi is not yet capable of editing MSSQL triggers. That would be fine by me. It is, however, annoying that Heidi crashes when I accidentally click on the wrong icon in the list of tables/views/triggers.

The optimal solution, of course, would be to support MSSQL triggers.

If you would like to list all triggers, use a statement like this:

select
    -- s.name as table_schema,
    -- USER_NAME(sysobjects.uid) as trigger_owner,
    OBJECT_NAME(parent_obj) as table_name,
    case
        when OBJECTPROPERTY( id, 'ExecIsUpdateTrigger') = 1 then 'Update'
        when OBJECTPROPERTY( id, 'ExecIsDeleteTrigger') = 1 then 'Delete'
        when OBJECTPROPERTY( id, 'ExecIsInsertTrigger') = 1 then 'Insert'
    end as trigger_type,
    s.name as schema_name,
    sysobjects.name as trigger_name

    /*
    OBJECTPROPERTY( id, 'ExecIsAfterTrigger') as isafter,
    OBJECTPROPERTY( id, 'ExecIsInsteadOfTrigger') as isinsteadof,
    OBJECTPROPERTY(id, 'ExecIsTriggerDisabled') as [disabled]
    */
from sysobjects

inner join sysusers
    on sysobjects.uid = sysusers.uid

inner join sys.tables t
    on sysobjects.parent_obj = t.object_id

inner join sys.schemas s
    on t.schema_id = s.schema_id

where sysobjects.type = 'TR'
order by table_name

With that info, you can use schema and trigger name in the following query to get the trigger definition:

SELECT OBJECT_DEFINITION (OBJECT_ID(N'schema.trigger_name')) AS [Trigger Definition];

from heidisql.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.