Forum Replies Created

Viewing 15 posts - 5,821 through 5,835 (of 8,731 total)

  • RE: Want to get Correct Id

    You should read the discussion on this article. Of course, you must change the conditions a little bit for "C".

    http://www.sqlservercentral.com/articles/T-SQL/88244/

    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 to call a split parameter function

    Let me see if I understand correctly. You're receiving a comma-delimited parameter and if you have any value different than 0, you'll return a simple result set with no relation...

    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: Identify columns which will create a unique record in a table

    Alexander Suprun (9/15/2014)


    ALTER TABLE <YourTableName> ADD ID int NOT NULL IDENTITY (1, 1)

    ALTER TABLE <YourTableName> ADD CONSTRAINT PK_<YourTableName> PRIMARY KEY (ID)

    Alex,

    That seems like an easy patch instead of doing 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: Identify columns which will create a unique record in a table

    Could you use the Data Profiling Task in SSIS?

    http://msdn.microsoft.com/en-us/library/bb895263(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: Month and Year Difference in oracle.

    The following code returns a value of 10. Is that what you're after?

    SELECT months_between(TRUNC(TO_DATE( '20131101', 'YYYYMMDD'), 'MM'), TRUNC(SYSDATE, 'MM'))

    FROM Dual;

    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: Month and Year Difference in oracle.

    Why is it giving a wrong answer? In other words, what would be the correct answer and what are you getting right now?

    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: Hot to Get Number of days for given date range.?

    And here you have a different version that will use only the rows needed. Ideally, you shouldn't have to create the PersonList set and you'll have a table with them...

    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: Hot to Get Number of days for given date range.?

    This might not be the best solution for performance because it will run on all rows. The tricky part is to get the complete list with values in zero 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: Are the posted questions getting worse?

    Is this thread full of spam? Or is it a real problem with valid suggestions?

    http://www.sqlservercentral.com/Forums/Topic1612977-131-1.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: Check the Variable is Empty or Null

    I guess I confused what you were trying to say with changing the table you select the information.

    As for the second part, we seem to be on the same page....

    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: Check the Variable is Empty or Null

    SimonHolzman (9/12/2014)


    This is used because <Table 2> has a field that was originally intended to store pointers to different types of data depending on other information and so it 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: SQL Query Taking Too Long

    This won't help with performance, but it will save you coding time.

    You can change this:

    DECLARE @FROMDATE DATETIME = GETDATE()

    SET @FROMDATE = DATEADD(HOUR, DATEPART(HOUR, @FROMDATE) * -...

    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 Flag in SQL sever

    I would suggest the NOT NULL constraint as Eugene mentioned, but I would also add a DEFAULT to 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: Is it possible to simulate the cross apply function?

    Christopher Kutsch (9/12/2014)


    tempdb is always going to run under the native compatibility mode. Add a Use tempdb statement before you call the CROSS APPLY and change the context back when...

    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: Check the Variable is Empty or Null

    gward 98556 (9/12/2014)


    Thanks Eugene, I just tried your test method and confirmed that this method is SARGable:

    WHERE MyNullableCol IS NOT NULL AND MyNullableCol != ''

    so there are clearly situations where...

    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 - 5,821 through 5,835 (of 8,731 total)