Viewing 15 posts - 2,281 through 2,295 (of 7,191 total)
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...
September 27, 2016 at 9:19 am
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...
September 27, 2016 at 8:13 am
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...
September 27, 2016 at 7:58 am
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...
September 27, 2016 at 7:21 am
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...
September 27, 2016 at 7:08 am
Benki Chendu (9/27/2016)
1. Could the new column be introduced in the publisher newly which isnt getting pushed to the subscriber. Creation/modification...
September 27, 2016 at 4:31 am
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
September 27, 2016 at 4:17 am
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...
September 22, 2016 at 4:25 am
Lat
Why are you doing this row-by-row? Why not update everything in one go?
John
September 21, 2016 at 4:23 am
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...
September 21, 2016 at 2:06 am
Apologies - I misread. I answered as if the clustered index were on all columns instead of just on ID.
John
September 20, 2016 at 8:47 am
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...
September 20, 2016 at 8:28 am
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
September 20, 2016 at 7:55 am
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...
September 20, 2016 at 7:50 am
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...
September 20, 2016 at 7:26 am
Viewing 15 posts - 2,281 through 2,295 (of 7,191 total)