Forum Replies Created

Viewing 15 posts - 7,726 through 7,740 (of 8,731 total)

  • RE: Why do databases in Simple Recovery Mode need transaction log?

    It's the way SQL Server (and other RDBMS) are designed. Every operation is written to logged before it's actually done. This way you can manage transactions that will be atomic.

    Someone...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Need to alter my code to show limited Info

    I agree with Sean, even if I don't know Erland, his reputation and answers in a short time in this site say a lot about him and his expertise and...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: case statements and UDF's

    I have 2 ideas, one would be to change your scalar function into an inline table function that will perform much better.

    CREATE FUNCTION [dbo].[AGE_GROUP](@string VARCHAR(20))

    RETURNS TABLE

    BEGIN

    RETURN SELECT CASE

    WHEN @string...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: How to generate data in lakhs format in SQL Server 2008

    I agree with Koen when he says that formatting should be done in the visualization layer.

    But if the column type is money, then you can use CONVERT and a...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Duplicate column names not allowed in result sets obtained through OPENQUERY and OPENROWSET

    Could you alias the column in your query to differentiate both decode columns?

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Working with Strings

    Something like this might help you. Unless it becomes more complicated

    SELECT Text_Code,

    LTRIM(PARSENAME( REPLACE( Text_Code, '~', '.'), 1)),

    ISNULL(RTRIM(PARSENAME( REPLACE( Text_Code, '~', '.'), 2)), '')

    FROM #A_Test

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: case when looping through column values and applying conditions depending on value

    And why don't you create it? It's a very powerful tool.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Need to alter my code to show limited Info

    The first error message is giving you the solution to the problem.

    Incorrect syntax near the keyword 'with'. If this statement is a common table expression or an xmlnamespaces clause, the...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Need to alter my code to show limited Info

    Without any more details on how the top 4 languages are defined or any sample data and expected results, this might give you a hint.

    WITH Distinct_Data AS(

    SELECT DISTINCT PD.ProviderId,

    PD.FullName,

    PL.LanguageDesc,

    PR.RegionKey,

    MD.OperationalMarket

    FROM [dbo].[ProviderDim]...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Is there any way to turn of parsing?

    Dennis Post (9/4/2013)


    BTW, how can I alias the URLs?

    If you do it manually, you can use the following syntax (without the space).

    [ url=http://technet.microsoft.com/en-us/library/ms190356.aspx]SET Statements (Transact-SQL)[/url]

    Otherwise, you can write the alias,...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Msg 245, Level 16, State 1, Line 244 Conversion failed when converting the varchar value '2013-02-25' to data type int.

    John Mitchell-245523 (9/4/2013)


    An integer can't be between two dates.

    John

    Yes, it can be between 2 dates (sort of). The problem here is with data type precedence.

    SQL Server can't compare between different...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: case when looping through column values and applying conditions depending on value

    OK, let's stop RBAR and get a set based solution that I'm pretty sure that will perform faster (you should test and not get my word for granted). I'm splitting...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: How to update string based on Dates.

    It's good to know that you got what you needed. Be sure to understand what it does and be able to explain it to someone else (even if it's a...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Help using LIKE and IN(select product from referenceTable) and wildcards

    Take a look at this.

    A simple JOIN or EXISTS can do the trick.

    /* Return ALL records from @productList that are LIKE products in @softwareReferenceList */

    select p.*

    from @productList p

    JOIN @softwareReferenceList...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Query Help

    As Ed said, this might be more complicated than this. However, this might give you an idea on what you need.

    WITH CTE( String) AS(

    SELECT '7MTWRF'

    ),

    Tally AS(

    SELECT TOP 100 ROW_NUMBER() OVER(...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2

Viewing 15 posts - 7,726 through 7,740 (of 8,731 total)