Forum Replies Created

Viewing 15 posts - 196 through 210 (of 345 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.

  • 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...

  • 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...

  • 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...

  • 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...

  • 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).

  • 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.

  • RE: Brain not working!

    try EXECUTE (@AlertStmt)

    Glad to see someone else does that too :).

  • RE: Strange Behavior

    try putting

    set nocount on

    at the top of the SP.

  • RE: Putting dynamic SQL string together

    something like

    declare @sql varchar(1000)

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

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

    select

  • 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...

  • RE: Interesting issue with transactiosn

    Try looking at the query plan.

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

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

    Your conversations start.

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

  • 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...

  • 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...

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