Forum Replies Created

Viewing 15 posts - 9,571 through 9,585 (of 15,381 total)

  • RE: Import data from one table to another excluding any duplicates help

    ScottPletcher (1/21/2013)


    INSERT INTO dbo.T1 ( ... )

    SELECT t2.col1, t2.col2, ...

    FROM dbo.T2 t2

    LEFT OUTER JOIN dbo.T1 t1 ON

    t1.Name = t2.Name

    WHERE

    t1.Name IS NULL --only...

  • RE: Trying to understand ISDATE & CAST behavior

    case isdate(col2)

    when 1 then cast(col2 as datetime)

    else col2

    end as col2test

    There is the culprit.

  • RE: Add a column Count from another table

    Doesn't sound too tough. Please take a look at the first link in my signature for best practices when posting questions. Once we have the necessary information you will find...

  • RE: Problem with CAST to VARCHAR with SUBSTRING Function

    16 posts into what should have been a 1-2 post answer if ddl and sample data were provided...

    Here is my last shot in the dark.

    SELECT

    CASE LEFT(cast(Customer.STARTDATE as varchar(20)), 2)

    WHEN...

  • RE: Compare Two sets of delimited string items

    kenneth.bucci (1/21/2013)


    This is how we fixed it:

    (@Issue is not null and exists

    (select 1 from IssueCodes where charindex(IssueCode, @Issue) <> 0 AND charindex(IssueCode, SPL.IssCode) <> 0)))

    Works like a charm!

    Glad you...

  • RE: Problem with CAST to VARCHAR with SUBSTRING Function

    Welsh Corgi (1/21/2013)


    Thanks. Not sure why I'm getting an error on the substring function.

    Msg 8116, Level 16, State 1, Line 1

    Argument data type numeric is invalid for argument 1 of...

  • RE: update trigger

    Also your script does not take into account if the current and updating values are the same. If you prevent updating the column like you have in your trigger it...

  • RE: EOMONTH - 1

    Had not heard about this function until now. Like others I assumed they got it right. The question actually pretty much answers itself. The first 3 sets of choices are...

  • RE: comma separated

    Load it into a table which I would assume you are doing anyway. Then you just query sys.columns to get your list.

    SELECT Stuff((SELECT ', ' + name

    FROM ...

  • RE: comma separated

    Can you be a bit more specific about what you are trying to do? Is the first row in your spreadsheet the column names? If you can explain in more...

  • RE: Declare error message before CATCH?

    I would say it is mostly preference but I would agree with you. Why have all your variable declarations at the top? This isn't Pascal or Delphi. It makes sense...

  • RE: Compare Two sets of delimited string items

    kenneth.bucci (1/18/2013)


    Thank you both for your replies.

    Unfortunately I have to be careful what gets posted publicly as I work for a hospital. I am not sure I could get you...

  • RE: Compare Two sets of delimited string items

    kenneth.bucci (1/18/2013)


    Yes that is what I am saying @Issues is a SQL Paramerter with multiple delimited values separated with a comma. SPL.IssCode contains a different set of multiple delimited values...

  • RE: Compare Two sets of delimited string items

    kenneth.bucci (1/18/2013)


    Thank you for your reply.

    I am still not sure how to compare the two sets of delimited string items. Each item in one list must be in the other...

  • RE: why do these queries perform differently

    sqldba_newbie (1/18/2013)


    Luis Cazares (1/18/2013)


    2 word: Implicit conversion

    SQL Server needs to do implicit conversions that may affect the query performance.

    implicit conversion on what?

    The N forces conversion to Unicode.

Viewing 15 posts - 9,571 through 9,585 (of 15,381 total)