Forum Replies Created

Viewing 15 posts - 2,281 through 2,295 (of 7,187 total)

  • RE: Help with the query

    Gosh, the goalposts have moved for a second time. It's not the LEFT JOIN - just put a DISTINCT after the SELECT. That will give the results you...

  • RE: Column missing in subscriber database - SQL 2014

    Benki Chendu (9/27/2016)


    We have peer to peer replication configured in SQL 2014.

    1. Could the new column be introduced in the publisher newly which isnt getting pushed to the subscriber. Creation/modification...

  • RE: Help with the query

    SELECT

    s.Name

    ,s.City

    ,s.State

    ,r1.ReferenceName1

    ,r1.Address1

    ,r1.Address2

    ,r2.ReferenceName2

    ,r2.City AS R2_City

    ,r2.State AS R2_State

    FROM #SourceData s

    LEFT JOIN #ReferenceTable1 r1 ON LEFT(s.Name,CHARINDEX(' ',s.Name)) = LEFT(r1.ReferenceName1,CHARINDEX(' ',r1.ReferenceName1))

    LEFT JOIN #ReferenceTable2 r2 ON LEFT(s.Name,CHARINDEX(' ',s.Name)) = LEFT(r2.ReferenceName2,CHARINDEX(' ',r2.ReferenceName2))

    John

  • RE: how to convert navarchar to datetime

    komal145 (9/21/2016)


    ?? the table that has sendate is created by someone else , my table has datetime.

    If you're converting to datetime in order to store in your table, you don't...

  • RE: Read data row wise with multiple transaction

    Lat

    Why are you doing this row-by-row? Why not update everything in one go?

    John

  • RE: Backup Restoring - Insufficient free space

    I've always thought that it would be good if you could shrink the file sizes as part of the restore. Unfortunately, you can't, and so you need the same...

  • RE: Non-clustered index question

    Apologies - I misread. I answered as if the clustered index were on all columns instead of just on ID.

    John

  • RE: Non-clustered index question

    Mike Scalise (9/20/2016)


    Hi John,

    Thanks for the reply. I have a few comments:

    Mike

    No, because if you only have a non-clustered index, your table is a heap.

    I know technically a table without...

  • RE: SQL Express 2008 R2 to SQL 2008 Enterprise

    Although if you're going down from 2008 R2 to 2008, that probably won't work. Don't know for sure, though - I've never tried it.

    John

  • RE: Operating system returned error 23

    In which case, it's likely you'll need to accept some data loss to get this fixed. But we can't be sure of that until you do what it suggests...

  • RE: Non-clustered index question

    Mike

    No, because if you only have a non-clustered index, your table is a heap. Also, in the non-clustered index, the key is only ID instead of all of the...

  • RE: Operating system returned error 23

    Sanjay

    Have you done what it suggests in the error message? Looks as if the problem is so serious that you can't back up the database. Copies of the...

  • RE: need to extract text from given string

    Use PATINDEX to find where the text finishes and the date starts you can use '20[0-9][0-9]' or something like that as your pattern match. Once you've got that, it's...

  • RE: CASE Statements.....

    Your CASE expression returns NEW or OLD, and you're casting it to bit, which isn't valid. Change your CASE expression so that it returns 1 or 0, or cast...

  • RE: Need Help with the query

    Looks fairly simple - you're just joining all three tables together, and using a MAX or MIN to get the top sale per invoice. Is there any particular part...

Viewing 15 posts - 2,281 through 2,295 (of 7,187 total)