Forum Replies Created

Viewing 15 posts - 5,686 through 5,700 (of 7,597 total)

  • RE: Significant performance dropping when use CASE statement

    From a purely performance stand-point, we'd almost certainly want to process Countries prior to it being JOINed:

    SELECT A.City_Name, B.Country_Code, B.Country_Area

    FROM Cities A

    INNER JOIN (

    SELECT Country_Code,...

  • RE: linked server - GO or no GO ??

    The GO separates the code into "batches". SQL parses and prepares an execution plan separately for each batch.

    Thus, without the GO, when SQL parses the query below...

  • RE: Adding two month

    kd11 (10/16/2014)


    Thanks for your suggestion, it help. Using that statement you provided, if I want to subtract -7 day or 1 week in addition could I just add...

  • RE: Split string to show only customer

    I'd think you'd definitely want to use LTRIM() and RTRIM() to make sure you get rid of extraneous spaces. I added ISNULL(NULLIF(...)...) just in case there isn't a dash...

  • RE: Adding two month

    If you can live with only a three-char month, you can remove the STUFF() function. If you need to have the full month name, you'll need the STUFF() part...

  • RE: How random are constraint names?

    I admit, I name all constraints myself, including DEFAULTs, even though for DEFAULTs that may be deprecated.

    CREATE TABLE Theory (

    Id int identity(1,1) CONSTRAINT Theory__PK primary key,

    Data varchar(20),

    LogDate datetime CONSTRAINT Theory__DF_LogDate...

  • RE: extract number from string

    Do you have some type of id or other unique/key value on the row?

  • RE: With & Without Nested Loops (inner join) for Select statement which is the more performance?

    I agree with others, particularly on ISNULL(). In fact, there's a simple, very easy to remember rule:

    NEVER use ISNULL() in a WHERE or JOIN clause.

    If, as is typical, the...

  • RE: How to check latest SP is on server

    You could even DROP and (re)CREATE the procedure as long as you re-added the extended procedure with the version number after the CREATE.

  • RE: How to check latest SP is on server

    Staggerlee (10/14/2014)

    Is there a way via T-SQL to check or read information from a stored procedure? Ie, could I add a comment with a build number in it?

    I suggest...

  • RE: check varchar column for values that are only numeric - HOW

    I suggest a different method to avoid 2 or more decimal points:

    AND CASE

    ...

  • RE: extract number from string

    Jeff Moden (10/14/2014)


    It'll be interesting when an actual vendor name also contains dashes. 😛

    In that case, presumably we would search first for a digit only, "%0-9%", then do the search...

  • RE: extract number from string

    SELECT Fulltext, Contract2,

    Substring(Contract2, Contract3_Start, Contract3_Length) AS Contract3

    FROM (

    SELECT Fulltext From [Sonae].[dbo].[Images_Local]

    ) AS test_data

    cross apply (

    SELECT Substring(FullText, PATINDEX('%Contrato%',FullText), 50) as Contract2

    ) as...

  • RE: extract number from string

    SELECT Fulltext, Contract2,

    Substring(Contract2, Contract3_Start, Contract3_Length) AS Contract3

    FROM (

    SELECT 'Contrato Promocional 2010-241772 Descrico CDR TD' AS Fulltext UNION ALL

    ...

  • RE: Need Help with Stored Procedure

    CELKO (10/10/2014)


    Identity is as good, convenient, practical way of assigning something like a sequential Order#.

    No it is not; we have the ANSI/ISO Standard CREATE SEQUENCE now....

Viewing 15 posts - 5,686 through 5,700 (of 7,597 total)