Forum Replies Created

Viewing 15 posts - 16 through 30 (of 46 total)

  • RE: Performance issue on While Loop

    Your probably going to have to give some sample data for people to understand what you are looking for but I typed this up real quick. It may give you...

  • RE: Stored procedure using dynamic query

    Al of the parameters are optional. You could call the proc like this for the parameters you do have.

    exec test_it @param1=10, @param5 = 'a', @param8 = 'b'

    or you could call...

  • RE: Stored procedure using dynamic query

    Give this a shot. I'm not sure what your datatypes are but notice param1 is an int and notice that you have to cast it to a varchar to concatenate...

  • RE: Checking if An object Exists

    That is kinda backwards. I always use

    IF COALESCE(objectproperty(object_id('TEST_TABLE'),'IsTable'),0) = 1

    begin

    drop table TEST_TABLE

    end

    Much faster and simpler than hitting sysobjects

  • RE: horizontal partitioning of table

    Books Online. If you don't have it installed, you should be able to get it off of the cd you installed SQL Server from. It's actually probably online as well,...

  • RE: horizontal partitioning of table

    You can use a Partitioned View. You would create two tables each with a check constraint on the year column. Then you create a view unioning the two tables together...

  • RE: Evaluating a string arithmatic expression

    --Here is the function I was thinking of writing. It seems to work pretty well. It could definitely be cleaned up since I wrote it pretty quickly.

    if object_id('test') is not...

  • RE: Evaluating a string arithmatic expression

    The easiest thing to do would be to create a three column table valued function that splits the time and converts to seconds. Then you could always add all three...

  • RE: Check Columns Exist Before Select

    you could try this

    set nocount on

    if not exists (select column_name from information_schema.columns where column_name='RG_ENTRYDELETED' and table_name='REGISTRATION')

    alter table REGISTRATION add RG_ENTRYDELETED bit;

    if not exists (select column_name from information_schema.columns where column_name='RG_ENTRYDELETEDBY'...

  • RE: select...insert

    If the variables are declared and properly populated, it will work.

  • RE: select...insert

    If you want to insert five rows for every @ActionDesc, @ActionDate, and @ActionReport then in would be as simple as

    insert into Actions (ActionTypeID,ActionDesc,ActionDate,ActionReport)

    select at.ActionTypeID,

    ...

  • RE: find a function call

    You could us profiler or you could use dbcc inputbuffer.

  • RE: Can I modify a column value in a trigger?

    Nope... I meant to say instead of.

    There are regular triggers and there are instead of triggers. Look them up in BOL.

  • RE: update o_file

    Try this

    update f

    set f.groupid = 213

    from o_file as f

    where f.columnx = 215

    and exists

    (select * from stutable1 a

    where f.fileid = a.o_objid)

  • RE: Can I modify a column value in a trigger?

    Have you looked at instead of triggers?

    Also, if you put a default on the column, you could use a regular trigger and update the value to the correct value

Viewing 15 posts - 16 through 30 (of 46 total)