Forum Replies Created

Viewing 15 posts - 8,251 through 8,265 (of 13,460 total)

  • RE: Audit of sa logon

    just tested this, and it works fine, assuming you have dbmail setup with a profile;

    --DROP TRIGGER [TR_Logon_Trigger_Track_sa] ON ALL SERVER

    GO

    CREATE TRIGGER TR_Logon_Trigger_Track_sa

    ON ALL SERVER FOR LOGON

    AS

    BEGIN

    --the auditing...

  • RE: Locking of Tables

    i would update it to an arbitrary number so that SQL's locking mechanism locks the row, then complete the work:

    BEGIN TRANSACTION

    DECLARE @iCnt As BigInt

    SELECT @iCnt = Counter

    FROM CR_CONTROL

    --arbitrary update to...

  • RE: Locking of Tables

    you could tackle it it two ways.

    since you KNOW you are going to update the table to teh next counter value (unless the transaction rolls back) update the table to...

  • RE: remove all description

    GilaMonster (1/3/2011)


    I'm exceedingly curious why he wants to remove them all. No good reason usually for that and unless i missed it no reason given in initial post.

    re-reading the post,...

  • RE: remove all description

    putting in all those descriptions was incredibly time intensive for someone to do...and you want to delete them because they bother you, not because of a business reason.

    You should check...

  • RE: sql quotes help

    instead of quotes, you could use the builtin QUOTENAME function to get brackets, which would still be syntactically correct:

    SELECT 'EXEC sp_helpdb ' + QUOTENAME(name) + ' FROM sys.tables

  • RE: stored procedure for paging table

    well, adding two optional parameters to your proc, i'd suggest something like this:

    ALTER PROCEDURE [dbo].[sp_listcategoryproducts]

    @dolar float,

    @katid int,

    @sayfano int,

    --used to set group size of paging

    @BatchSize int = 10,

    --used to decide which...

  • RE: stored procedure for paging table

    i was looking for real code specifics..CREATE TABLE Category....

    and then how you wanted to filter the products:

    SELECT * FROM PRODUCTS WHERE CATEGORYID = ....

    those details are what i'd need to...

  • RE: stored procedure for paging table

    here's an example using row_number of using that to page information;

    if you gave us more details, specifically the actual table schemas, and maybe a sample select statement, we could offer...

  • RE: Time Worked in 15 minute increments

    this seems to give me the results i was looking for, it's rather dawn out into CTE's to show all the logic and can be easily shortened up, but i'm...

  • RE: Trigger Delete

    this seems to wrok for me; if i put it on a table that has FK's pointing to it, the constraints for the FK are enforced before the trigger fires.

    CREATE...

  • RE: How can I set identity_insert on a tablename passed to an sproc

    since you said you are building a string, this is probably what you want for a demo:

    CREATE TABLE IDDemo

    ( pk_ID Integer IDENTITY(1,1)

    , Textdata Varchar(100) )

    DECLARE @sql varchar(max)

    declare @tablename varchar(30)

    SET @sql...

  • RE: How can I set identity_insert on a tablename passed to an sproc

    Don i think your EXC command needs to do everything all together; you can separate commands with a semi colon, which is rumored to be mandatory in a future version...

  • RE: Manipulate String

    JStevenson1 (12/22/2010)


    I have several value in a column called test.

    Select Statement: Select Test From Abc

    Output: JonDoe

    Desired Output: 'JonDoe'

    How do I achieve desired output?

    so the only difference is you want...

  • RE: Identify duplicate records where all fields, except one field, are the same.

    based on Sean's post, i think if you join the grouping back to the original table, you can at least see the dupes :

    SELECT #mx.bid_price_old, #mx.* FROM #mx

    LEFT OUTER JOIN...

Viewing 15 posts - 8,251 through 8,265 (of 13,460 total)