Forum Replies Created

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

  • RE: SQL Join

    If you always have a space in the middle of your postcode, and you want to match everything to the left of the space, change your join predicate to this:

    LEFT(N.[Office...

  • RE: Transaction Log Question

    Mike

    Three reasons, really:

    (1) To minimise physical fragmentation. If your file grows in small chunks, you're likely to have bits of it scattered all over the disk.

    (2) To avoid having...

  • RE: Help with the query

    Your business rules don't make any sense to me. Why, when you have different values in ReferenceTable2 for City and for State, do the two rows in your expected...

  • RE: Generate Create Script for a table - include indexes, keys, statistics

    Find a SQL Server instance that isn't doing anything - a test instance on your desktop/laptop for example. In SSMS, go to Tools -> Options -> SQL Server Object...

  • 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...

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