Forum Replies Created

Viewing 15 posts - 1,186 through 1,200 (of 8,731 total)

  • RE: Dynamic Pivot using XML as column list

    r.gall - Tuesday, June 20, 2017 8:32 AM

    I am trying to pull out a list of products from a product table, in...

    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: HOW to concatenate two fields using trigger,

    m.awadallah92 - Tuesday, June 20, 2017 1:35 AM

    Thank you so much for your reply, I would appreciate if you try...

    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 unicode escape sequence to nvarchar

    That's great Eirikur.
    I wasn't in the mood of creating a new string to hex function (not much use on my side), so I used what was available.

    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 get these queries into a view?

    Here's a reduced version of your query. It should be equivalent, but test it as I might have made a mistake due to the lack of sample data.
    [code...

    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 unicode escape sequence to nvarchar

    I don't like the use of a scalar function, but this might help.

    DECLARE @m NVARCHAR(max)= N'\u0633\u0644\u0627\u0645';

    WITH
    E(n) AS(
      SELECT n FROM (VALUES(0),(0),(0),(0),(0),(0),(0),(0),(0),(0))E(n)

    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 does this code convert records to a single row?

    r.gall - Monday, June 19, 2017 9:42 AM

    Hi

    I stumbled across some SQL code which seems to transpose record data into a single...

    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: Unable to get proper counts using sql query

    No need to add subqueries when you have the information available by reading the table once.

    SELECT
      A.Custom2 as State,
      BCNT = COUNT(CASE WHEN A.Defecttype...

    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: Tsql Query help

    sqlenthu 89358 - Monday, June 19, 2017 7:50 AM

    Hi guys,
    I am working on a process where the query to be written seems...

    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: HOW to concatenate two fields using trigger,

    m.awadallah92 - Monday, June 19, 2017 2:49 AM

    Adding  extra `)` at the end of the line before the FROM section hadn't resolve...

    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: Converting varchar to datetime T-SQL.

    sks_989 - Friday, June 16, 2017 1:45 PM

    there will be leading 0 like this way 0930 or 0700

    Then it's easy. Here's an...

    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 to return fraction from decimal and rounds to the nearest 16th

    Sean Lange - Friday, June 16, 2017 1:03 PM

    Holy cow Luis. I was not at all understanding what they were looking for....

    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: Converting varchar to datetime T-SQL.

    sks_989 - Friday, June 16, 2017 1:33 PM

    Hello,

    I have 2 column first column in this Format YYYYMMDD and second column as HHMM...

    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 to return fraction from decimal and rounds to the nearest 16th

    As you're only approaching to the nearest 16th, I'm using a bit of hard-coding. I've also changed the function into an In-Line Table-Valued Function. These functions are extremely fast 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: All A LEFT OUTER JOIN ON B but (with a filter on B)

    I'd commonly use the option described by Jacob. However, if the conditions are too complex, I use a CTE or subquery.

    --Option 1
    SELECT m.StockCode,

    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?

    jasona.work - Thursday, June 15, 2017 1:29 PM

    I wonder how does using tabs...

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