Forum Replies Created

Viewing 15 posts - 12,121 through 12,135 (of 13,465 total)

  • RE: Executing a system stored procedure and putting results into a table

    yeah that binary AND-ING of a value isn't obvious;

    basically, a binary array of zeros and ones, representing like 2^16 or something is used in status to keep track of on...

  • RE: Executing a system stored procedure and putting results into a table

    I have this laying around from a post i replied to previously: it does all the databases in one shot on a server, instead of calling sp_dboption repeatedly:

    select name as...

  • RE: Cross database dependencies on surrogate key

    I agree, it's a poor idea. It sounds more like the DBA gets confused with seeing thousands of tables, and to make it more "bitesize" he wants to move...

  • RE: Begin tran /commit tran question.

    the Command SET XACT_ABORT ON makes error handling superfoulous.

    This command rolls back the transaction, AND DISCONTINUES FURTHER PROCESSING, if any error is encountered....

    so if any error is encountere,d it would...

  • RE: Help with formating

    I do something kind of similar using the SPACE function to reserve a certain amount of space in a string; I used a default of 20 in this example, but...

  • RE: Download content ie page like txt file

    much easier to do that from an application.

    from sql server 2000, it's difficult to do in TSQL because you must use an object with sp_oacreate to get the text of...

  • RE: Time gets removed from date

    thekingironfist (2/11/2008)


    Hi folks, every time a date is entered into SQL Server 2000 as a 12:00:00 AM time, it becomes automatically truncated to only the date.

    Example:

    I type:

    2/11/2008 12:00:00...

  • RE: Shrinking TEXT fields

    the freespace will just get larger as you cleanup your data, until you shrink the database...when you shrink the database, only then will the actual amount used get smaller. until...

  • RE: IN Operator Using Table Function Not Working

    Tim ffitch (2/11/2008)


    Hi.

    We have a Select statement in a stored procedure that uses the IN Operator.

    When we use the following style it works:

    WHERE IN ('Value1', 'Value2', 'Value3')

    However we have a...

  • RE: sp_executesql hangs for a particular stored procedure

    there's so many variables, it's hard to give a good answer without reviewing the code;

    In general, here's something to look at:

    A lot of times, dynamic sql is used in order...

  • RE: Strange Script error

    if the database is version 80, the script is not valid for the part i highlighted below...that part is 2005 /90 database only:

    CREATE TABLE [dbo].[Primes](

    [Prime] [int] NOT NULL,

    CONSTRAINT [PK_Prime] PRIMARY...

  • RE: time field

    you need to post more specific details. the code i posted will do what you asked; so you are most likely not converting the final answer.

    here's a more detailed example:

    declare...

  • RE: time field

    Mike Levan (2/5/2008)


    when am doing this

    sum(convert(decimal(8,1),t.duration)/360000) as Duration

    am getting

    51.00000000

    12.40000000

    30.80000000

    15.00000000

    48.10000000

    1.60000000

    but i need only 1 decimal point

    you divided the converted value by 360000.

    you want the final result to be a decimal.

    try

    ...

  • RE: How to return one of several values

    COALESCE would help you in this case...it's really just a CASE WHEN construct:

    SELECT COALESCE(HOMEPHONE,CELLPHONE,EMERGENCYPHONE,'911')

    FROM SOMETABLE.

    it returns the first non-null item...so if homephone is null, it returns the cellphone, but...

  • RE: time field

    you need to cast or convert the value that's in the field as a decimal.

    declaration is size,number of decimals:

    so SELECT CONVERT(DECIMAL(8,1),YOURCOLUMN FROM YOURTABLE wouold do what you ask.

    example:

    SELECT CONVERT(DECIMAL(8,1),23.00001)

    ,CONVERT(DECIMAL(8,1),12.9)

    , CONVERT(DECIMAL(8,1),16)

    ,CONVERT(DECIMAL(8,1),14.567)

    Results:

    (No...

Viewing 15 posts - 12,121 through 12,135 (of 13,465 total)