Forum Replies Created

Viewing 15 posts - 8,191 through 8,205 (of 8,731 total)

  • RE: How should I use Identity within my stored procedures?

    That doesn't make sense either.

    Your not using columns from your table to filter, you're getting the last row returned by SQL Server (which might not always be the one you...

    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 should I use Identity within my stored procedures?

    I'm not sure that this is great for performance, but you could do something like this.

    I might be wrong, so you should test with your data.

    USE [TEST_DATABASE]

    GO

    SET ANSI_NULLS ON

    GO

    SET QUOTED_IDENTIFIER...

    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: String to Rows question (quasi xml??)

    I'm not sure if you have tried something like this or you might be looking for something else.

    CREATE TABLE #Test( string varchar(1000))

    INSERT INTO #Test VALUES('<ITEM>ABC</ITEM><ITEM>DEF</ITEM><ITEM>GHI</ITEM>')

    SELECT item

    FROM #Test t

    CROSS APPLY dbo.DelimitedSplit8K(...

    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: Can I pivot?

    You're not really pivoting, you just need to add conditions to a SUM.

    You're grouping by stockcode and location and suming orders and quantities.

    Just think about it and try something.

    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: Update null to unknown in a table for all the columns

    weberharter (11/26/2012)


    There is no simple query for doing this update for all colums of all tables. If you only have to do it once you could use dynamic SQL.

    You get...

    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: append sp

    I'm not sure what you mean. That's not an sp and I'm unaware of the term append sp.

    Could you clarify what you 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: LIKE with and without wildcards in WHERE clause

    What you mention about choosing the best execution plan, is covered on Gail's article.

    And no, it won't give you better performance as it will use a "safe plan".

    You might not...

    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: Regarding sql functions

    Format function is not available in SQL Server 2005.

    It was introduced in 2012, check the BOL (Books On Line, alias help or documentation)

    http://msdn.microsoft.com/en-us/library/hh213505.aspx

    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: LIKE with and without wildcards in WHERE clause

    The easiest way is to do it like this

    WHERE Oink.[System] like @System + '%'

    ANDOink.Stratigrafie like @Stratigrafie + '%'

    ANDOink.Ulozeni like @Ulozeni + '%'

    AND Oink.DrEvid like @DrEvid + '%'

    Or you can add...

    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: LIKE with and without wildcards in WHERE clause

    I have two options for you.

    The first is to change the empty string for a '%', that way you get rid of the ORs. You need to do that before...

    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 delete only one of a set of duplicates

    I'm sorry, but I got lost in the explanation. Could you read the article linked in my signature and come back to post DDL, sample data and expected results? (it's...

    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: Split a String

    bitbucket-25253 (11/21/2012)


    Agreed the 8K splitter refrenced by Luis Cazares is great, however for something as simple as your needs, you might want to try the following along with the 8K...

    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: Split a String

    Are you sure? This might give you a better idea.;-)

    SELECT string,

    MAX( CASE WHEN itemNumber = 1 THEN item END) AS firstpart,

    MAX( CASE WHEN itemNumber = 2 THEN item...

    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: Split a String

    You should take a look at the 8K Splitter[/url], it can work for you and has a great performance.

    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: Add an option to display the answer and explanation for the QoTD?

    How about adding an extra answer in every question, something like: "I don't know"?

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