Forum Replies Created

Viewing 15 posts - 11,221 through 11,235 (of 26,486 total)

  • RE: Need Help with CURDATE Query

    dustinprevatt (6/20/2012)


    Here is the query I am working with.

    select *

    from table where cast (postdate AS int(128)) between ({fn Curdate()}) and ({fn Curdate()}) + ({fn minute(1439)})

    I originally had this

    select *

    from table...

  • RE: mssqlsystemresource.mdf 69 GB in all threee instances

    I thought I'd look at the resource database on one of our development servers, it is only 60.5 MB (63,438,848 bytes) in size.

    For it to be 69GB seems really...

  • RE: Foreign key conflict unable to delete data from stored procedure

    We need to see how the data is related between the two tables to be able to help you.

  • RE: Trim

    If you have Jeff's split function, this works:

    DECLARE @TestStr VARCHAR(128);

    SET @TestStr = '/DBNAME/TEST DATA/PRODUCTION_CONTROL ';

    SELECT * FROM dbo.DelimitedSplit8K(@TestStr,'/') WHERE ItemNumber = 3;

    Jeff's function if you don't:

    USE [Sandbox]

    GO

    /****** Object: UserDefinedFunction...

  • RE: The Cult of Mediocrity

    TravisDBA (6/19/2012)


    Here is a real good example of the difference between taking a calculated risk in life and just being plain stupid. 😀

    http://www.sun-sentinel.com/news/broward/fl-cellphone-robber-folo-20120619,0,654321.story

    If you used the url /url ifcode short...

  • RE: Database Mirroring - witness

    krypto69 (6/19/2012)


    Did you force a failover or did you break the mirror then do a restore database with recovery on the mirror database to bring it live?

    Lets say the power...

  • RE: Need an alternative

    CELKO (6/17/2012)


    SQL programmers do not use local temp tables. This is how COBOL mimic scratch tapes. We use derived tables AND CTEs so the optimizer can work.

    Floating point math...

  • RE: Database Mirroring - witness

    The witness, by the way, has nothing to do with transferring transactions. It sole purpose in life is to automate the failover from the principal to mirror database.

  • RE: Database Mirroring - witness

    krypto69 (6/19/2012)


    That sounds like a misconfigured environment. Mirroring won't require setting up from scratch unless people break the mirroring instead of failing over.

    Maybe then I'm doing something incorrectly..

    I have...

  • RE: Need help

    Well, with no details from which to work, here is a shot in the dark.

    WITH basedata AS (

    SELECT

    ROW_NUMBER() OVER (PARTITION BY ProductID ORDER BY ReceiptDate DESC)...

  • RE: Database Mirroring - witness

    krypto69 (6/19/2012)


    If I read this correctly, asyncronous mirroring is only possible with Enterprise Edition. Using Standard Edition you must use syncronous mirroring (with or without a witness).

    Okay..

    I'm stuck with using...

  • RE: tsql query - Count the number of spaces in a string

    Or this.

    DECLARE @TestStr VARCHAR(20),

    @CharToFind CHAR(1);

    SET @TestStr = 'This is a string';

    SET @CharToFind = ' ';

    WITH

    e1(n) AS (SELECT 1...

  • RE: Aggregate Query question

    This is something that may be better handled in an application of perhaps a CLR aggregate function of some sort.

    Reminds me of something used for packaging parts, looking for the...

  • RE: Aggregate Query question

    If I may, what is the business case for this? I don't understand why you would be looking for a set of unrelated items whose sum(quantity) = aconstantvalue.

  • RE: gaps after restarting SQL server 2012

    hi2u (6/19/2012)


    Hello,

    Create a table with an Identity column, insert data / restart the server / insert more data / restart the server/ insert some more data.

    My data looks like...

Viewing 15 posts - 11,221 through 11,235 (of 26,486 total)