Forum Replies Created

Viewing 15 posts - 7,816 through 7,830 (of 8,731 total)

  • RE: Grouping by columns to create single record

    Actually, if you read the discussion of the article, you can see performance comparisions for several methods. Your code should be faster than mine (which was recommended by the article)...

    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: Catch text before symbol

    I don't understand your last comment.

    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: Grouping by columns to create single record

    You could find this article useful

    http://www.sqlservercentral.com/articles/T-SQL/88244/

    SELECT AttribID

    FROM MyTable

    WHERE FormatID IN (12,15)

    GROUP BY AttribID

    HAVING COUNT(DISTINCT FormatID ) = 2

    EXCEPT

    SELECT AttribID

    ...

    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 Help TSQL Code.

    Hi George,

    You should really be trying to figure out this yourself by using BooksOnLine (BOL or SQL Server help) but I'll try to explain.

    REVERSE will do exactly what it says,...

    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 give users access only to certain columns of certain tables in a database?

    timwell (7/31/2013)


    Also in the links to the Spanish documentation given above, I was able to replace "es-es" with "en-us" to get the article in US English....

    I hadn't noticed that 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: How to give users access only to certain columns of certain tables in a database?

    I suppose that you mean using a graphic interface.

    You can right click on the views folder and choose the option New View..., that will give you a designer.

    For the permissions,...

    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: Annual Count

    Hi, you're asking for something that might be very simple but we need somee DDL and if possible some sample data to work with. Read the article linked on my...

    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: Effective T-SQL for Median

    Last week I came up with this option. I haven't made performace tests. Maybe you could help me with that.

    DECLARE @test-2TABLE(

    myintint)

    INSERT INTO @test-2 VALUES(1),(2),(3),(4),(5),(6),(7),(8),(9);

    WITH CTE AS(

    SELECT myint,

    NTILE( 2) OVER( ORDER...

    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 Help TSQL Code.

    Then it's a lot easier.

    WITH CTE AS(

    SELECT 'Jim k Smith' [FullName] UNION ALL

    SELECT 'Robert K Lin' UNION ALL

    SELECT 'Chris Tim'

    )

    SELECT LEFT( FullName, CHARINDEX( ' ', FullName)),

    RIGHT( FullName, CHARINDEX( ' ',...

    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: Problem with CTE and filter in Query

    We need more information to see what's happening. Please read the article linked in my signature to find out what we need.

    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 give users access only to certain columns of certain tables in a database?

    You need to create a view (reference) and then grant permissions only on that view (reference)

    EDIT: Corrected language for the links.

    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 Help TSQL Code.

    You need to realize that you might have names that can change the logic. The most common example would be spanish names (which can appear even in an English speaking...

    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: Global Variable

    There's no need to have a variable for that, simply use a date calculation. 😉

    SELECT DATEADD(MONTH, DATEDIFF(MONTH, 0, GETDATE()) - 1, 0)

    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: Catch text before symbol

    You mean this?

    LEFT(Value,charindex('.',Value)-1)

    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: Convert Varchar to Date??

    There are some IFCode tags available to the left of your screen when you're replying. For SQL you need to use [ code="sql"][ /code] (without space).

    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,816 through 7,830 (of 8,731 total)