Forum Replies Created

Viewing 15 posts - 2,191 through 2,205 (of 8,731 total)

  • RE: Is Division by Zero NULL?

    Gregory Hart (9/6/2016)


    if divide by zero is allowed, it's possible to prove that 1=2

    The above claim would only work in a logical proof if you identified that NULL= NULL ....

    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: Is it possible to compare multiple fields to a value without OR statements?

    Don't take unnecessary shortcuts when writing queries. Keep them clear and simple.

    You seem to be trying to create a query that would allow to search on every column, instead of...

    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: question about SQL engine choice of indexes in execution plan

    I pointed to that article because if you share the details mentioned in there, it would give us an idea of what's happening. Without details, we're just guessing.

    On the index...

    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: Set based solution for Geographic problem

    Can you share your solution?

    I didn't use a cross join, I used a cross apply which is different.

    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: question about SQL engine choice of indexes in execution plan

    Index seeks are not always the best option, especially when they're accompanied by a key lookup. Sometimes, an index scan is better when a wide range of rows is selected.

    Please...

    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: Set based solution for Geographic problem

    Maybe this could help.

    CREATE TABLE Customers( id int, Point Geography);

    INSERT INTO Customers

    SELECT 1, geography::STGeomFromText('POINT(-122.34900 47.65100)', 4326);

    CREATE TABLE Stores( id int, Point Geography);

    INSERT INTO Stores

    SELECT 1, geography::STGeomFromText('POINT(-125.34900 47.65100)', 4326) UNION ALL

    SELECT...

    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: Is it a bad idea to declare a cursor within a TRY block?

    Lynn Pettis (9/1/2016)


    ScottPletcher (9/1/2016)


    Luis Cazares (9/1/2016)


    drew.allen (9/1/2016)


    First, the mantra is "It's a bad idea to declare a cursor. Period. End of sentence." 😀

    Drew

    Second, cursors can be local or global 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: Are the posted questions getting worse?

    Lynn Pettis (9/1/2016)


    djj (9/1/2016)


    Sean Lange (9/1/2016)


    Lynn Pettis (9/1/2016)


    And his forced vacation from SSC did nothing to motivate White Horse from his berating ways. Who let him back in?

    Odd...I can't...

    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: Update column based on filter

    Here's an option, you need to complete the last column.

    UPDATE A

    SET ACTION1= CASE WHEN A.ACTION1 IS NULL THEN B.ACTION ELSE A.ACTION1 END,

    ACTION2= CASE WHEN A.ACTION1 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: Add unique valules to a heap

    This smells like RBAR. That would certainly be slow.

    If you post DDL for your table and indexes, along with the UPDATE process we could give better advice on what 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: Checking a string for valid TSQL

    Maybe this can give you an idea.

    CREATE TABLE Test( id int);

    DECLARE @SQL NVARCHAR(1000) = 'DROP TABLE Test;';

    EXEC( 'SET NOEXEC ON; ' + @SQL);

    SELECT * FROM Test;

    DROP TABLE Test;

    EDIT: Changed PARSEONLY...

    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: Add unique valules to a heap

    Why do you want to create a column with unique values to create a unique index on it? What do you expect 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: Is it a bad idea to declare a cursor within a TRY block?

    drew.allen (9/1/2016)


    First, the mantra is "It's a bad idea to declare a cursor. Period. End of sentence." 😀

    Drew

    Second, cursors can be local or global and the default is defined by...

    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: Temporary tables and Table variables storage

    Iwas Bornready (9/1/2016)


    Derek Slinn (9/1/2016)


    I think the answer is wrong,

    Both are stored in tempdb database.

    technically table variables can just be in memory if there is only a small amount of...

    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: Update column based on filter

    You should pay attention to what Drew is saying. Right now, the business rules might say that you'll only have 3 actions on each item, but later, you'll be able...

    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 - 2,191 through 2,205 (of 8,731 total)