Forum Replies Created

Viewing 15 posts - 286 through 300 (of 336 total)

  • RE: Functions vs. Store Procedures

    Um, OK, then how's this for an answer:

    one starts with an 'F'?

    or

    One is listed in sysobjects with type 'FN' and the other has a 'P'...

    Is this multiple choice?

     

  • RE: Finding datetime range intersections and durations

    Use a between in the JOIN and CASE for result columns

     

    SELECT CASE a.begin_date< b.begin_date THEN b.begin_date ELSE a.begin_date END AS common_from_date

              ,CASE a.end_date<b.end_date THEN a.end_date ELSE b.end_date END AS common_to_date

      ...

  • RE: Go versus ;

    GO and ; are specific language elements only understood by certain client programs.

    SQL QA and ISQL/OSQL (as client applications) are written to understand GO and can be configured to use...

  • RE: DB Maintenance Plans

    sp_% procs are available anywhere only if they exist in the master db.  That proc is in the MSDB database so you'll need to qualify it:

    exec msdb..sp_help_maintenance_plan

  • RE: Known bug or is there a reason?

    1) In Standard SQL, which you should be trying to write if you are a professional programmer, the ORDER BY clause is part of a cursor and can only...
  • RE: Known bug or is there a reason?

    Yes, but:

    declare @a varchar(1000)

    select @a = ISNULL( @a, '' ) + CONVERT(VARCHAR(10),id ) + ','

    FROM sysobjects

    ORDER BY id

    SELECT @a

     

    Works.  That is, with no calc in the order...

  • RE: Nested Selection with group

    OK I didn't read thru your syntax, but if you want records in table A that are not in table B then outer join is how I always do this...

    SELECT...

  • RE: query processor ran

    Have you tried letting the client put in the line breaks, as in:

    INSERT INTO T VALUES ( 'a', 'line 1

    line 2

    line 3

    line 4' )

     

  • RE: Compare two rows

    You need to get familiar with the system tables within SQL server. then you can easily create utility procs to do things like this for you:

     

    DECLARE @collist VARCHAR(3000)

    select @collist...

  • RE: Data trucated after Insert in a TExt type field

    I'm not real familiar with Access, but my old fallback is to turn on the SQLProfiler and see for certain exactly what is being sent by the client.  (in days...

  • RE: Data trucated after Insert in a TExt type field

    I think you're going to find that the data is truncated before the insert.  You didn't mention how the insert is taking place.  What is the syntax used? are you...

  • RE: Getting past 8000 char limitation in sp_executesql?

    As best I can tell, it allows >8k only when it is a constant:

    exec sp_executesql N' bla..

    bla...

    ...out to 20k' --<--end quote

    I have executed more than 8k with EXEC as...

  • RE: Hierarchial tree with child count, indentation and dynamic levels

    Surely there's a client side reporting tool that does this,

    but if not, why not use a stored proc to create the result set?

  • RE: Cursor Help Please - well...I think I need a cursor.

    you could always stage into a temp table:

    SELECT IDENTITY( INT, 1, 1) as seq

           ,* --column list

      INTO #stage

      FROM sourcetable

    INSERT INTO destinationtable( column list)

       SELECT ..., 'user'+CONVERT(VARCHAR(10), seq)

          FROM #stage

     

  • RE: select query for overlap date range!!!

    select distinct a.keycolumn

    from tablex a

           join tablex b ON a.startdate between b.startdate and b.enddate

                             OR a.enddate between b.startdate and b.enddate

     

Viewing 15 posts - 286 through 300 (of 336 total)