Forum Replies Created

Viewing 15 posts - 5,761 through 5,775 (of 8,731 total)

  • RE: subquery???

    Basically the same thing as Alan. I just wanted to note that it's considered best practice to post DDL and sample data in a consumable format, as well as expected...

  • RE: SELECT lento en una tabla de 9000 filas

    My translation:

    Hi, I have the following inconvenient with a table with 9000 rows, which in theory is not a big table. When a SELECT is run on this table is...

  • RE: SQL formatting issue

    I didn't realized that you had the date twice with different format and one had time. Here's a different option:

    "aSNAP_Data_" + REPLACE( SUBSTRING( ((DT_WSTR, 29) GETDATE()), 1, 10), "-", "")...

  • RE: Query previous week with no set date?

    Luis Cazares (9/29/2014)


    To get the code block, you use the IFCode tags [ code="sql"][/code] (without the space)

    Actually, this:

    DATEADD(WK, DATEDIFF(WK, 0, TestDate - 1) - 1, 7)...

  • RE: SQL formatting issue

    Something like this?

    "aSNAP_Data_20140929_P-" + (DT_STR, 4, 1252) YEAR( GETDATE()) + "-" + RIGHT( "0" + (DT_STR, 2, 1252) MONTH( GETDATE()), 2) + "-" + RIGHT( "0" + (DT_STR, 2,...

  • RE: Query previous week with no set date?

    You could try the formula yourself. I wouldn't use a date that far away.

    SELECT comment,

    TestDate,

    dateadd(dd,((datediff(dd,'17530101',TestDate)/7)*7)-7,'17530101'),

    dateadd(dd,((datediff(dd,'17530101',TestDate)/7)*7),'17530101'),

    ...

  • RE: NORMALIZE RECORDS WHERE 1 COLUMN IS A STRING OF DATA

    You should try the DelimitedSplit8K. You can find information on how it works and how to use it (along with the code) in here: http://www.sqlservercentral.com/articles/Tally+Table/72993/

  • RE: Help with SQL query

    Maybe something like this will work, but your description makes it confusing.

    UPDATE a SET

    Units = x.Units,

    TotalTrigUnits = x.TotalTrigUnits

    --SELECT *

    FROM #Tracking a

    CROSS APPLY(...

  • RE: Sorting an Execution Plan

    I'm not sure if using SET SHOWPLAN_ALL is a valid option for your case. Maybe you could query the XML from the plan.

    But, I wouldn't use this approach as the...

  • RE: Why do they not listen?

    Revoke create and alter permissions and create policies to apply changes to the database. People will start to do things right when they're enforced.

  • RE: I'm new to SQL development..

    You could also try this basic tips: 45 Database Performance Tips for Developers.

    The book recommended by Koen is more complete, but this one can give you some basic performance principles...

  • RE: Need help in query - urgent plz

    If it's urgent, I assume that you have tried something. Please show us what you've tried and we'll help you from that. It's considered polite to post the sample data...

  • RE: Apex SQL License key

    It's possible but it might not be legal.

    Extract from ApexSQL EULA:

    C.Excepting authorized users of You, the Licensee, as provided by this Agreement, You may not distribute, publish, or otherwise...

  • RE: Is there any alternate way for pivot

    Yes, there is. you can read about that on the articles in Sean's signature.

    However, I agree with what Sean has told you multiple times. You need to fix your non-SARGable...

  • RE: sys.sql_modules truncating definition

    SSMS won't return more than 8000 chars. You could use substring to review the complete code.

Viewing 15 posts - 5,761 through 5,775 (of 8,731 total)