Forum Replies Created

Viewing 15 posts - 6,436 through 6,450 (of 8,731 total)

  • RE: Pulling incorrect records using date range in where clause

    The tests that I've made, show that the advantage is minimal and not worth it. However, the flexibility you gain when not using BETWEEN is a good reason to avoid...

    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: Difference in seconds to round to minute

    The problem is that you're dividing 2 integers. That way, the decimal part is truncated. You need to cast any of the 2 integers into a decimal. And you should...

    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: 1=1

    Gordon Barclay (5/20/2014)


    Fair point I guess. As the SQL i am using is not dynamic then it's a moot point at best, even when I have though It still...

    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: Re-order views' fields' name

    If you don't want to rewrite the SELECT to put the columns in order. You could profit of INFORMATION_SCHEMA views, Dynamic SQL and concatenation code.

    This is an example to achieve...

    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: t-sql left outer join

    I could try to explain it, but Paul White already did a great job with a series of two articles that explain how APPLY works and how it is a...

    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: Better way to do this

    A slight modification to Sean's code to avoid the REPLACEs.

    DECLARE @string AS varchar(40)

    SET @string = ' OKALOOSA AIRPORT ABC VALPRAISO FL ';

    with SortedValues...

    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: 1=1

    That's very useful when you're adding conditions to dynamic code. That way you can always add conditions with AND instead of validating if there's a previous condition generated to decide...

    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: Re-order views' fields' name

    Why would you do that?

    There's nothing to gain in that option. You'd need to generate the scripts for each and every view again to create them.

    What if 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: t-sql left outer join

    You don't even need the ROW_NUMBER if you don't care about the order. You could use the APPLY operator.

    SELECT a.custname, i.item, i.amount, s.specialitem, s.specialamount

    FROM customer a

    INNER JOIN inventory i on...

    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: concatenate specific values from a column

    It's still not pretty, it will read the table 4 times, but it should work better than the cursor. The recommendation is that you test both solutions to check which...

    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 come can write SELECT TOP 1%' without a FROM clause?

    I'm sorry if I didn't make myself clear. The reference was supposed to be for KoldCoffee, as I assumed that you knew this. 😉

    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 come can write SELECT TOP 1%' without a FROM clause?

    SQLRNNR (5/19/2014)


    There is no special name for it. It's just another way of writing a join condition.

    Actually, it could be considered as a non equi join. You can find...

    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: Error converting data type varchar to datetime.

    You could try removing the dashes from your dates. SQL Server will identify the dates without problem regardless of language or dateformat configuration.

    Another option is to use

    SET DATEFORMAT ymd

    before the...

    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: where clause

    I'm not sure if the problem is in the missing TOP (1) from your VB Code.

    Another problem that you might encounter is SQL Injection. What would happen if someone...

    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 script a whole Database without data in sql server 2012?

    Right click on the database -> Tasks -> Generate Scripts.

    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 - 6,436 through 6,450 (of 8,731 total)