Forum Replies Created

Viewing 15 posts - 58,681 through 58,695 (of 58,878 total)

  • RE: ORDER BY varchar data type

    Sorry mkeast,

    Didn't work the way you expected... here's the output.

    col       

    ----------

    1

    2

    3

    10

    11

    2A

    2B

    3A

    3B

    3C

    I think the original poster wants...

    col       

    ----------

    1

    2

    2A

    2B

    3

    3A

    3B

    3C

    10

    11

  • RE: How to enforce a one-row table

    Great idea but I think they really want a custom error message and a check constraint won't do it.  Ran into the same problem with permissions... no custom error message.

    Switching...

  • RE: How to enforce a one-row table

    Like I said, I agree especially in light of that fact that many companies just don't have a documentation system in place.  Documentation always seems to take it in the...

  • RE: How to enforce a one-row table

    I'd think that the "permission denied" message would drive the point home to a developer but, I agree, it might save a couple of trouble calls to the DBA's.

  • RE: Decorum in the Forums

    I kind of like Andy's idea... all of the ideas are great ones but it's not really broken.  Maybe leave it like it is?

  • RE: How to enforce a one-row table

    Put the customer error message in the App?

  • RE: Last Date Of Month script

    Guess I'll add my two (or is it 3?) cents...

    ------ Finds the LAST day of CURRENT month with no time element
    SELECT DATEADD(mm,DATEDIFF(mm,0,GetDate())+1,0)-1 AS LastDayCurrentMonth
    ------ Finds the LAST day of CURRENT month...
  • RE: How to enforce a one-row table

    All of that seems like a fair amout of work to keep a table with only 1 row...  why not just log in as the "sa" and revoke insert, update, and...

  • RE: Get Previous Date

    Ok, Ken, here ya go...

    DATEADD(d,DATEDIFF(d,1,getdate()),0)

    DATEDIFF(d,1,getdate()) takes the difference between the current date and 01/02/1900 and converts it to a whole number of...

  • RE: Get Previous Date

    I'll second that... Frank's method also allows for indexes to be used on the date columns where a conversion sometimes does not.

  • RE: Date Ranges

    Brian wrote: > Feel pretty stupid answering my own question, but I think this does the trick if anyone else is interested. DepDate >= '8/1/04' AND ArrDate =< '8/10/04'

    I wouldn't...

  • RE: Table locking on large inserts/updates is KILLING me!

    If your going to update the table every day, then I'd use non-clustered indexes only.

    Another thing to try is to rebuild your data in a staging table that looks exactly...

  • RE: nchar vis nvarchar

    Frank wrote: >Could it be you're mixing some kind of presentational stuff in here, Jeff?

    Only for demonstration purposes... the pipes were so you could see the spaces. 

    I'm one of...

  • RE: How do I get log file space allocation and space used?

    Getting the usage is the hardpart... the names used below are the "logical" names for each file...

    SELECT FILEPROPERTY('northwind', 'spaceused')*1024*8
    SELECT FILEPROPERTY('northwind_log', 'spaceused')*1024*8

    To get the allocated file size for each file, use...

  • RE: nchar vis nvarchar

    Not a challenge here... I'd really like to know...

    Using the following code example, I get what most people would consider to be an "undesirable result"...

     CREATE TABLE #MyTest (TestChar CHAR(10))
     INSERT...

Viewing 15 posts - 58,681 through 58,695 (of 58,878 total)