Forum Replies Created

Viewing 15 posts - 5,566 through 5,580 (of 8,731 total)

  • RE: String splitter function for mutli-char delimeters

    You're right, it wasn't about performance. It's because the splitter works on a single char basis. Modifying Alan's example could give us undesired results.

    SELECT *

    FROM dbo.PatternSplitCM('blrah1 \r\ bl\ah2 \r\ blah3','%[\r\]%')

    WHERE...

    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: Parsing out a Data String with Text Delimeters

    Here are some examples on how to do it with the DelimitedSplit8k. The function code and explanation can be found in the following article: http://www.sqlservercentral.com/articles/Tally+Table/72993/

    SELECT LEFT(Item, CHARINDEX('.', 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: Query to list win/loss streaks

    Now, the question would be, do you understand it?

    Remember that you'll be the one supporting it. Feel free to ask any questions that you have.

    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: Advance script help. Second Saturday following month?

    Thank you for the feedback. 😉

    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: Finding 5 most recent records for each customer with abnormal order amounts

    Do you need more help with this?

    If so, could you post sample data and expected results?

    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: Finding 5 most recent records for each customer with abnormal order amounts

    I don't have sample data to test, but this might help you.

    WITH AvailableDates AS(

    SELECT customer_id,

    order_date,

    ...

    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 to list win/loss streaks

    Do you need something like this?

    DECLARE @Team nvarchar(255) = 'TeamA';

    WITH Winners AS(

    SELECT *,

    CASE WHEN Home_Score...

    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: Align values from separate columns into same rows

    It seems that you have a poor design and that's making everyone confused. You should review what's going on here.

    That said, this might help you:

    CREATE TABLE SampleData(

    ...

    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 splitter function for mutli-char delimeters

    Note that those functions aren't intended for multi-character delimiters.

    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: Flat file source with empty last column

    Can you post an example of what you mean by empty last Column?

    Is it something like this?

    Column1,Column2,Column3

    1,Something,

    2,Sometext,

    Or like this?

    Column1,Column2,Column3

    1,Something

    2,Sometext

    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: Remove Characters before Character Index

    I forgot to include the safety net. 😉

    SELECT string, RIGHT( string, CHARINDEX( '/', REVERSE('/' + string)) - 1)

    FROM (VALUES('/Product_Images/small/1/10032.png'), ('JustImage.png'))x(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: Remove Characters before Character Index

    This might help.

    SELECT string, RIGHT( string, CHARINDEX( '/', REVERSE(string)) - 1)

    FROM (VALUES('/Product_Images/small/1/10032.png'))x(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 bulk insert (or another way) to SQL table from datatabel from inside store prcedure

    There's a BULK INSERT command in SQL Server. You can read about it in here: http://msdn.microsoft.com/en-us/library/ms188365.aspx

    To add functionality using format files, you can read the following article:

    http://www.sqlservercentral.com/articles/BCP+(Bulk+Copy+Program)/105867/

    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: SQL View giving different results

    Are you sure that you're using the same view and not different views with the same name and different schema? Is it possible that the information changed between each query?...

    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: Serial Date conversion

    cbrammer1219 (11/4/2014)


    I am subtracting Pending time 735510.30987 from Delivered time 735510.40448 and get call duration 0.09474, but I want to convert this to standard time.

    And what do those values mean?...

    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 - 5,566 through 5,580 (of 8,731 total)