Forum Replies Created

Viewing 15 posts - 4,876 through 4,890 (of 8,731 total)

  • RE: Altering Field Length in Table does not change Field Length in View

    Have you tried with sp_refreshview?

    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: Get Date Format from String

    It's easy to identify "DD-MM-YYYY" and "MM-DD-YYYY" from "YYYY-MM-DD" or "YYYY-DD-MM", as long as you always use dashes or slashes. The problem comes to differentiating months against days 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: Collation error Please help

    I'm not sure about this, but the cause might have been that a wrong collation was installed when installing SQL Server or creating the database. If you continue to 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: Nest If Statement in SQL Server

    I hope that you understand that these are 3 examples from which you need to choose one, according to your requirements. Feel free to ask any questions that you have.

    Note...

    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: Nest If Statement in SQL Server

    It seems that you really need a CASE expression. I'm not sure how would you need to use it, so I'm giving you 3 options.

    --Creating some sample data

    CREATE TABLE #Staging(

    ...

    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?

    Ed Wagner (5/27/2015)


    Alan.B (5/27/2015)


    Brandie Tarvin (5/27/2015)


    Just curious how many people on The Thread are World Cup fans. Cause... STUFF and MORE STUFF.

    And I was wondering how y'all felt about it.

    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: Nest If Statement in SQL Server

    Maybe you're looking for a CASE expression which is used inside a SELECT statement.

    Or maybe you need to define the actions used within the IF statements.

    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: Why such limitation ? "Subqueries are not allowed in this context. Only scalar expressions are allowed."

    I guess the limitation comes because the development team has no interest on creating additional functionality to PRINT. Why would they?

    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: Limitations of the PIVOT

    What are you trying to do exactly?

    If you're pivoting data, I suggest you to read the following article:http://www.sqlservercentral.com/articles/T-SQL/63681/

    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 Pivot

    There's a couple of choices to do this. I prefer to use cross tabs, while other prefer to use the pivot operator.

    Cross-tabs allow more flexibility and might outperform pivot 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: Are the posted questions getting worse?

    Sean Lange (5/27/2015)


    Brandie Tarvin (5/27/2015)


    Just curious how many people on The Thread are World Cup fans. Cause... STUFF and MORE STUFF.

    And I was wondering how y'all felt about it.

    I am...

    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 stored prcoedure help

    The #Output table is populated using the OUTPUT clause in the insert. I included it because is a good option if you're using identity columns from which you might not...

    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: missing one record when selecting by date range

    Eric M Russell (5/26/2015)


    A simple CAST operation from date/time to date won't necessarily prevent usage of an index on a date/time column. For example, given the following table and 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: Sql stored prcoedure help

    This might work for you. I'm not sure if we're missing something you left out, so you might need to tweak some things.

    BEGIN TRY

    BEGIN TRAN

    ...

    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: missing one record when selecting by date range

    The safe way would be to always manage dates as dates instead of strings.

    To safely convert a string into a date, you can use CONVERT (or TRY_CONVERT if available), as...

    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 - 4,876 through 4,890 (of 8,731 total)