Forum Replies Created

Viewing 15 posts - 46 through 60 (of 335 total)

  • RE: query output to text files for each person

    Not quite a cursor and somewhat serial a solution (but still some of the glory of a set based solution):

    Run a query to create a separate OSQL (or BCP) command line...

  • RE: catching errors

    Do an outer join to find those not there,  for example

    select a.id

    from tbl1 a

         LEFT OUTER JOIN tbl2 b on a.id=b.id

    where b.id is null

    will return only ids from rows in tbl1 that...

  • RE: INSERT without using cursors

    "cross join" Doh!

    I confess the stupid modern join syntax is a second language to those like me that have been doing SQL since before the alphabet was invented.

  • RE: Find out deadlock time

    I don't know.  I've only ever used SQLprofiler traces to determine this, so short of using an ongoing trace. 

    But, in my experience it's never been a long time.

    Unless you...

  • RE: SQL Experts please help. Challenge ahead...

    Your description is still fuzzy, and you have no sample data, but here's what I do when faced with trickiness problems:

    #1 Encapsulate in a stored proc.  That is, don't plan...

  • RE: INSERT without using cursors

    Use a join to get a cartesian of all

    insert into ...

    select b.itemid, a.custid

    from customers a

           join items b on 1=1

    Add a filter for one cust or add the other...

  • RE: Listing tables referenced by a stored procedure

    Yeah, there's this little message that occurs when compiling out of (dependent) sequence procs in SQL2k.  It says right there that sysdepends ain't gonna be updated because one of the objects...

  • RE: How do i insert Comma separated values in different rows.

    That's effectively how it would work best.  What I'd do different is encapsulate the string parsing in a reusable function though--  e.g. StringField( string, delimiter, positionnumber) to extract the substrings.

    (There...

  • RE: white space, Carriage Return, tab

    see the T-SQL REPLACE function in the help file

     

  • RE: Exclude Date and Time Ranges

    make a udf that returns a 1 or 0 (Y or N)

    give it parameters:

       check_date

       include_or_exclude I/E

       from_year_no  0,####

       to_year_no  0,####

       from_month_no  0,1-12

       to_month_no    0,1-12

       from_dom_no  0,1-31

       to_dom_no    0,1-31

      ...

  • RE: Replacing a string with another sting in a udf

    I say pay the price for the design that doesn't anticipate changes like this.

    But why do complex search and replace when you can do it only once?

    Why not do the...

  • RE: 911: developers insist PK/FK constraints impede performance

    Maybe it's because I've been a consultant for so many years, I've gotten the opportunity to see so many different permutations of designs and problems...

    One case where DRI bogged massively...

  • RE: 911: developers insist PK/FK constraints impede performance

    Hey, I agree with the developers that it degrades performance.  I hate DRI.  I have seen it bog things down unbelievably.

    However, in my applications all data modifications happen in stored...

  • RE: Restoring from different backups

    But, both Database and Log backups have to be from the same server/database.

  • RE: Restoring from different backups

    yes.

    It's only in your RESTORE statement that you say that you're done (finished with th restore) or there's more (log backups) still to come (in your restoration process).

    See RESTORE, and...

Viewing 15 posts - 46 through 60 (of 335 total)