Forum Replies Created

Viewing 15 posts - 1,081 through 1,095 (of 8,731 total)

  • RE: time - missing colon :

    Phil Parkin - Monday, July 24, 2017 10:31 AM

    mxy - Monday, July 24, 2017 10:11 AM

    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: Change Null value to 0 in Dynamic pivoted query

    It's possible to do it with PIVOT, but you need 2 different variables for your columns. Instead, I recommend you to use cross tabs which can give better performance. 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: time - missing colon :

    mxy - Monday, July 24, 2017 9:40 AM

    i have received a legacy data files from vendor time values are sent without...

    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: Dynamic SQL Query Not Fetching Records based on where Not In condition

    This code is wildly open to SQL injection. If you don't know what I'm talking about, please google it.
    Scratch that.
    This code has no reason to be dynamic. It...

    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: ORDER BY with CASE in SELCT DISTINCT

    If I understand your problem correctly, you just need to remove the quotes.


    Orderby=( case @id when 1 then varieteit else stockeerder end )

    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 Statement Help

    A different option:

    SELECT
      I.ADDRESS_1
    ,CASE WHEN I.ADDRESS_1 LIKE 'PO BOX [0-9]%' AND STUFF(I.ADDRESS_1, 1, 7, '') NOT LIKE '%[^0-9]%' THEN 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: two decimal points issue

    This would work, you just need to change the variable to use the column that you need.
    SUBSTRING( @[User::Code] , 1, FINDSTRING( @[User::Code]+"..", "." , 2) -...

    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: Function vs Procedure

    Jeff Moden - Friday, July 21, 2017 1:59 PM

    Luis Cazares - Friday, July 21, 2017 10:09 AM

    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: Extract String

    komal145 - Friday, July 21, 2017 12:21 PM

    Thanks it works.

    Do you understand why and how it works?

    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: Are the posted questions getting worse?

    ChrisM@Work - Friday, July 21, 2017 7:56 AM

    Brandie Tarvin - Friday, July 21, 2017 7:22 AM

    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: Extract String

    robin.pryor - Friday, July 21, 2017 11:42 AM

    SELECT reverse(left(reverse('\\CORP-BI-DEV-01\Temp\TIVExplorer\vzwprices-2017-06-21.json'), charindex('\', reverse('\\CORP-BI-DEV-01\Temp\TIVExplorer\vzwprices-2017-06-21.json')) -1))

    There's no need to use 2 reverse functions. This is important...

    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: Extract String

    komal145 - Friday, July 21, 2017 11:36 AM

    from the given string need to extract the filename:

    \\CORP-BI-DEV-01\Temp\TIVExplorer\vzwprices-2017-06-21.json

    How can i get tihis?

    With extension or...

    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: Function vs Procedure

    This is one of the questions I ask while interviewing people for a SQL Developer position.
    The importance of understanding the difference between a function and a stored procedure is...

    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: Reseed one table column

    Here's one option before going to bigint.

    DBCC CHECKIDENT ( 'YourTable', RESEED, -2147483648)

    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: Are the posted questions getting worse?

    Ed Wagner - Thursday, July 20, 2017 12:24 PM

    Jeff Moden - Thursday, July 20, 2017 12:09 PM

    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 - 1,081 through 1,095 (of 8,731 total)