Forum Replies Created

Viewing 15 posts - 8,431 through 8,445 (of 8,731 total)

  • RE: How to insert empty row

    Why don't you send all your values as varchar using cast/convert?

    Excel will convert everything that looks like a number to a "number type" and leave text as general.

    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: Union Query with 'duplicates'

    Did not. I found out the query has an important difference (WHERE clause) that I'm not sure how would it affect the performance (I'm sure it depends on the data).

    I...

    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: Union Query with 'duplicates'

    Eugene Elutin (9/11/2012)


    bleroy (9/11/2012)


    Thanks amillion guys - went for the code from Luis Cazares ... works like a charm as far as I can tell 🙂

    B

    It does, after he fixed...

    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: Union Query with 'duplicates'

    You're right Eugene, I missed that part and only deleted the last group by.

    I could have avoided that with something to test with.

    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: Union Query with 'duplicates'

    What about?

    SELECT f1, COUNT( Q6_BRANCH) AS CountOfQ6_BRANCH

    FROM (

    SELECT format(WEEK_DATE, "YYYYMM") as f1,

    TBL_AML_ERRORS.Q6_BRANCH

    FROM TBL_AML_ERRORS

    ...

    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: 2 different columns from 2 different tables into 1

    Does this work for you?

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

    http://msdn.microsoft.com/en-us/library/ms187831(v=SQL.105).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: Remotely Connect and Query a db.

    Is your instance on Computer A your default instance or is it a named instance?

    Do you have a DNS that will solve Computer A name for your Server B?

    Do 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: Importing only rows with column data in specific columns.

    I'm not sure about performance from Lynn's solution against UNPIVOT.

    But there's another solution in here that has been proved to be better than UNPIVOT by Dwain in this article.

    http://www.sqlservercentral.com/articles/CROSS+APPLY+VALUES+UNPIVOT/91234/

    Could that...

    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: Fun with Outer Joins

    CELKO (9/9/2012)


    The correct terms are "preserved table " and "unpreserved table" ...

    Can you explain us these terms? I can't find any reference on the web.

    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: weird update statement

    Could you correct it by yourself using a CASE statement?

    Think on why would it give an "Invalid length parameter passed to the RIGHT function."

    Try an post back the code to...

    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: weird update statement

    Maybe this modification to Sean's code will work better:

    select *,

    LEFT(full_name, charindex('_', full_name)) + RIGHT(full_name, charindex('_', reverse(full_name),2) - 1)

    from test_name

    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: Help with SQL Query

    Welcome to SQLServerCentral!

    In order to help you, you need to help us. You should post your DDL and sample data in a consumable format (a way on which we can...

    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: variable not working in where clause

    My guess is that you're not assigning the correct values to your variables. You're overriding your values every time.

    Try this:

    if @FOCYN = 1

    BEGIN

    set @foc1 = '40015'

    ...

    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: Tricky REPLACE problem

    Well, I could really use an annual pass to Disney World 😀

    I'm really glad I could help 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: Tricky REPLACE problem

    New week, new ideas and a new solution (it might not be the best, but it's new).

    I haven't compared it with Dwain's solution.

    It's prepared to change one or two characters...

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