Viewing 15 posts - 2,281 through 2,295 (of 7,187 total)
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
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...
September 20, 2016 at 7:09 am
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...
September 19, 2016 at 9:44 am
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...
September 16, 2016 at 9:52 am
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...
September 15, 2016 at 8:40 am
Viewing 15 posts - 2,281 through 2,295 (of 7,187 total)