Forum Replies Created

Viewing 7 posts - 361 through 368 (of 368 total)

  • RE: Dyanmi SQL

    Now I have more time to write some details and example. Here it is:

    -- Works from sql2000 up

    declare @sqlWithoutConcatenation nvarchar(4000)

    -- We used parameter @id two times, and @date one time....

    _____________________________________________________
    Microsoft Certified Master: SQL Server 2008
    XDetails Addin - for SQL Developers
    blog.sqlxdetails.com - Transaction log myths
  • RE: Dyanmi SQL

    Instead of exec(@tsql) please use sp_executesql with values passed as parameters - do not concatenate values!

    _____________________________________________________
    Microsoft Certified Master: SQL Server 2008
    XDetails Addin - for SQL Developers
    blog.sqlxdetails.com - Transaction log myths
  • RE: Update trigger is not working

    Operation = triggering operation (insert,update,delete)

    N = number of rows you inserted,updated or deleted in triggering table

    #Rows INSERTED = number of rows in INSERTED pseudo-table the trigger code will see

    #Rows DELETED...

    _____________________________________________________
    Microsoft Certified Master: SQL Server 2008
    XDetails Addin - for SQL Developers
    blog.sqlxdetails.com - Transaction log myths
  • RE: Update trigger is not working

    I would do something like this:

    declare @comment1 varchar(100), @comment2 varchar(100)

    if exists(select 1 from inserted)

    if exists(select 1 from deleted) select @comment1 = 'updated - new', @comment2 = 'updated -...

    _____________________________________________________
    Microsoft Certified Master: SQL Server 2008
    XDetails Addin - for SQL Developers
    blog.sqlxdetails.com - Transaction log myths
  • RE: Foreign Key Problem

    No. It's not a bug to create a table with FK, it is very good, and very recommended and anything else would be "bug".

    The sole purpose of constraints is to...

    _____________________________________________________
    Microsoft Certified Master: SQL Server 2008
    XDetails Addin - for SQL Developers
    blog.sqlxdetails.com - Transaction log myths
  • RE: Foreign Key Problem

    If you do not want error message for violating foreign key and do not want to use ON DELETE CASCADE, in Task 1 you should handle the case when there...

    _____________________________________________________
    Microsoft Certified Master: SQL Server 2008
    XDetails Addin - for SQL Developers
    blog.sqlxdetails.com - Transaction log myths
  • RE: Slight Problem :(

    Transaction log records all changes in db (insert,update,delete, create index, etc, but NOT select's for example) and you can roll it back or forward in time IF you are in...

    _____________________________________________________
    Microsoft Certified Master: SQL Server 2008
    XDetails Addin - for SQL Developers
    blog.sqlxdetails.com - Transaction log myths

Viewing 7 posts - 361 through 368 (of 368 total)