Forum Replies Created

Viewing 15 posts - 196 through 210 (of 346 total)

  • RE: Dertermine the Monday of the Third Week

    something like

    declare @d datetime

    select @d = '20030101'

    while @d < '20040101'

    begin

    select dateadd(ww,2,dateadd(dd,(9-datepart(dw,@d))%7, @d))

    select @d = dateadd(mm,1,@d)

    end

    Cursors never.

    DTS - only when needed and never to control.


    Cursors never.
    DTS - only when needed and never to control.

  • RE: Making "dbo" owner of stored procs

    something like

    declare @n varchar(128)

    while exists (select * from INFORMATION_SCHEMA.ROUTINES where ROUTINE_SCHEMA <> 'dbo')

    begin

    select @n = ROUTINE_SCHEMA + '.' + ROUTINE_NAME from (select top 1 ROUTINE_SCHEMA, ROUTINE_NAME from INFORMATION_SCHEMA.ROUTINES where ROUTINE_SCHEMA...


    Cursors never.
    DTS - only when needed and never to control.

  • RE: for xml to file from trigger

    You can use osql or bcp and master..xp_cmdshell.

    see

    http://www.nigelrivett.com

    Creating a text file from a stored procedure

    But I wouldn't advise ifle access in a trigger.

    Cursors never.

    DTS - only when needed and never...


    Cursors never.
    DTS - only when needed and never to control.

  • RE: BCP "Jagged Right" File

    If the field isn't padded then it isn't a fixed width file.

    Do you mean that you have a \n at the end of every row?

    Then bcp into a single column...


    Cursors never.
    DTS - only when needed and never to control.

  • RE: Clarification needed on Filegroups

    I don't think what you are aiming for can be done via filegroups.

    If your applications have unrelated database objects thyen put them in separate databases then they can be backed...


    Cursors never.
    DTS - only when needed and never to control.

  • RE: Inserts inside Store Procedures

    Should be a slight performance gain.

    But a huge gain in flexibility, security, maintenance, debugging, ...

    (if all access is via SPs).


    Cursors never.
    DTS - only when needed and never to control.

  • RE: Recurring dates

    Look at the job scheduler.

    It does very similar things and you can get some ideas from the structure of the tables.


    Cursors never.
    DTS - only when needed and never to control.

  • RE: Brain not working!

    try EXECUTE (@AlertStmt)

    Glad to see someone else does that too :).


    Cursors never.
    DTS - only when needed and never to control.

  • RE: Strange Behavior

    try putting

    set nocount on

    at the top of the SP.


    Cursors never.
    DTS - only when needed and never to control.

  • RE: Putting dynamic SQL string together

    something like

    declare @sql varchar(1000)

    select @sql = 'insert DBTemp (TableName, trxYearMonthStart, nmbrtrx)'

    select @sql = @sql + ' ''' + @ProcessTable + ''''

    select @sql = @sql + ', ''' + CONVERT(varchar(6), '...


    Cursors never.
    DTS - only when needed and never to control.

  • RE: BEWARE RENAMING OBJECTS

    Always create/chage objects from scripts stored in sourcesafe. In this way you will get a change history.

    Your problem will never arise because you will have run a script that deletes...


    Cursors never.
    DTS - only when needed and never to control.

  • RE: Interesting issue with transactiosn

    Try looking at the query plan.

    You may have to update statistics or rebuild indexes (defrag).


    Cursors never.
    DTS - only when needed and never to control.

  • RE: You just might be a DBA if.....

    Your conversations start.

    'No I can't. Now what did you want.'


    Cursors never.
    DTS - only when needed and never to control.

  • RE: Clustered index with very little disc space

    Tell the CFO that if he wants to add a table which makes the database 6 times the size then someone will have to pay for it.

    What are the people...


    Cursors never.
    DTS - only when needed and never to control.

  • RE: Join, Group by: can't have it right

    I woud guess that is why there are the two 'is null' checks - to preserve the outer join.

    Could get rid of them and include the where clause in the...


    Cursors never.
    DTS - only when needed and never to control.

Viewing 15 posts - 196 through 210 (of 346 total)