Forum Replies Created

Viewing 15 posts - 1,096 through 1,110 (of 2,894 total)

  • RE: rolling 12 months

    SQL_NuB (10/4/2012)


    i'm not able to post data. the query is present.

    if its easy to accomplish, how can I accomplish it?

    DDL of tables used (at least relevant part of it)?

    What...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Multipe letters into one

    ChrisM@Work (10/4/2012)


    No undocumented vapourtables, no sort:

    SELECT n = a.n+b.n

    FROM (VALUES(0),(10),(20),(30),(40),(50),(60),(70),(80),(90))b(n)

    CROSS JOIN (VALUES(1),(2),(3),(4),(5),(6),(7),(8),(9),(10))a(n)

    đŸ˜‰

    No sort? I would suggest to add ORDER BY, otherwise order is not guaranteed, so you may populate 100...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Two identical systems; one performs well, one performs poorly

    Statistics?

    Is large chunks of data in your PROD version were recently inserted/changed/removed?

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Execute SQL script in DB 'A' and stored result in DB 'B' Table

    Some thing like:

    IF DB_NAME() != 'LogCentralDB'

    BEGIN

    INSERT INTO LogCentralDB.dbo.Counter_Matrix

    SELECT * FROM dbo.Counter_Matrix

    WHERE ...

    END

    Please note: LogCentralDB database name...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: rolling 12 months

    You can easily, but you need to read this first:

    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: How to use GETDATE() function in sql server to select a column value from table whose date is only 1 year back from today.

    maida_rh (10/4/2012)


    How to use GETDATE() function in sql server to select a column value from table whose date is only 1 year back from today.

    E.g :

    Select LTRating ,RHDate from Accounts...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Multipe letters into one

    Hi there!

    There is another method without using ROW_NUMBER...OVER and undocumented table from master database (which can be changed or even dropped by MS without any notice http://blogs.msdn.com/b/suhde/archive/2009/04/05/invalid-object-name-master-dbo-spt-values-microsoft-sql-server-error-208.aspx;-)):

    SELECT IDENTITY(INT,1,1) AS...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: TSQL Case Statement help

    CELKO (10/2/2012)


    ...

    NO! We hate UDFs; they are not declarative, do not optimize and stink of 1950's FORTRAN. SQL is declarative and uses tables! This is a huge change...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Dynamic Filter and Order By

    PiMané (10/3/2012)


    Sean Lange (10/3/2012)


    NO LIKE is not SARGable so you will get scans. It has to examine every row to determine if it is a match or not.

    So a LIKE...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: UNIQUEIDENTIFIER vs BIGINT

    This discussion is bringing us back to the similar, quite heated one, we had not long ago.

    Does a "Customer" have a "Natural Key"?

    Customer Code? May be, but to...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Regular expression in T-sql

    Jeff Moden (10/3/2012)


    bteraberry (10/3/2012)


    People can write bad code in any language.

    They certainly can. Why, I know this one guy that still uses a 1950's push stack and punch card...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Running out of Identity values

    ScottPletcher (10/3/2012)

    ...

    Why would the relative position of the column make the slightest bit of difference at all?

    It may effect page splits and re-writes.

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Get multiple rows of data based on one condition and grouping

    ...

    Given that a customer's name can change, perhaps it is an attribute of the purchase.

    ...

    Given that nothing in the Universe is constant and everything can change, I would...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Running out of Identity values

    ScottPletcher (10/2/2012)


    sql-lover (10/2/2012)


    bteraberry (10/2/2012)


    ScottPletcher (10/2/2012)


    Maybe I'm missing something.

    Why not just ALTER the column to be a bigint instead of an int?

    He said these are very big tables. Altering the...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: UNIQUEIDENTIFIER vs BIGINT

    ScottPletcher (10/2/2012)


    Eugene Elutin (10/2/2012)


    [

    ...

    Is this statement true? If so is it better to use Guid or BIGINT?

    It depends, but usually BIGINT is better.

    Another question, related to keys... If a table...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

Viewing 15 posts - 1,096 through 1,110 (of 2,894 total)