Viewing 15 posts - 49,951 through 49,965 (of 59,102 total)
Heh... I've got 100 PM's that I really want to keep... and Steve hasn't developed a way for me to download them, yet and I've been too busy to think...
--Jeff Moden
Change is inevitable... Change for the better is not.
June 17, 2008 at 9:24 pm
Oh yeah... I forgot the "other part"... Dirtree...
Lots of people know that Dirtree can take 2 parameters... one for Directory and 1 for how many levels deep to go... Very...
--Jeff Moden
Change is inevitable... Change for the better is not.
June 17, 2008 at 9:02 pm
Found 'em...
SELECT *
FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=C:\Temp\OpenRowSetTest2.xls;HDR=yes',
'SELECT * FROM [Sheet1$a4:c]')
SELECT *
FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=C:\Temp\OpenRowSetTest2.xls;HDR=Yes',
'SELECT LastName,FirstName FROM [Sheet1$a4:c]')
... and I've attached the example spreadsheet I used in the...
--Jeff Moden
Change is inevitable... Change for the better is not.
June 17, 2008 at 8:56 pm
catriona_brown (6/12/2008)
I figured it out. An no still not an exam question.
C'mon... don't be shy... everyone else posted their solution... it's your turn... 🙂
--Jeff Moden
Change is inevitable... Change for the better is not.
June 17, 2008 at 8:46 pm
Get something that's capable of opening the file in the "binary" mode... I'm betting that the end of line character is neither a carriage return (0d in hex) nor a...
--Jeff Moden
Change is inevitable... Change for the better is not.
June 17, 2008 at 8:39 pm
So... are you required to use the ZipCode/State view? If not, call the tables directly, instead. Also, Views of Views generally suck the life out of code... avoid...
--Jeff Moden
Change is inevitable... Change for the better is not.
June 17, 2008 at 8:20 pm
jcrawf02 (6/17/2008)
--Jeff Moden
Change is inevitable... Change for the better is not.
June 17, 2008 at 8:14 pm
OpenRowSet does this very nicely... and with a little help from our friend "Dirtree", you can make it "auto-magic". Lemme see if I can find my sample script for...
--Jeff Moden
Change is inevitable... Change for the better is not.
June 17, 2008 at 8:07 pm
Matt Miller (6/17/2008)
If the two tables weren't created in exactly the same way, you could easily end up with column mismatches.
Good point... but look again...
insert into t
select *...
--Jeff Moden
Change is inevitable... Change for the better is not.
June 17, 2008 at 8:03 pm
Matt Miller (6/17/2008)
Take a look at this article - will help describe the technique....
Man... you're right... you have been recommending this and the Tally table articles a lot! I'm...
--Jeff Moden
Change is inevitable... Change for the better is not.
June 17, 2008 at 7:55 pm
Dupe post... please continue at the following so all the answers stay in the same place...
http://www.sqlservercentral.com/Forums/Topic518657-149-1.aspx
--Jeff Moden
Change is inevitable... Change for the better is not.
June 17, 2008 at 7:52 pm
real_cals (6/17/2008)
Paraphrasing Neal Stephenson - "A well built machine-gun will not help you change a flat tyre".
No... but I'll bet you can coax someone into doing for you with it....
--Jeff Moden
Change is inevitable... Change for the better is not.
June 17, 2008 at 7:47 pm
bitbucket (6/15/2008)
Knowing Jeff Moden's skill I strongly recommend you follow his suggestion on the use of a Tally Table.
Sorry... I almost missed this entirely... thanks for the great compliment! 🙂
--Jeff Moden
Change is inevitable... Change for the better is not.
June 17, 2008 at 7:43 pm
ahmeterispaha (6/17/2008)
I guess I'm looking for feedback on how people manage this kind of customization in a tightly controlled ERP environment.Thanks again.
Ahmet
As some others have already pointed out, including yourself,...
--Jeff Moden
Change is inevitable... Change for the better is not.
June 17, 2008 at 7:40 pm
ahmeterispaha (6/17/2008)
Can someone post a code sample that shows a query working with two databases simultaneously?
Sure...
SELECT t1.*, t2.*
FROM DatabaseOne.dbo.SomeTable1 t1
INNER JOIN DatabaseTwo.dbo.SomeTable2 t2
...
--Jeff Moden
Change is inevitable... Change for the better is not.
June 17, 2008 at 7:30 pm
Viewing 15 posts - 49,951 through 49,965 (of 59,102 total)