Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

TSQL and percentile (not percentilerank :) Expand / Collapse
Author
Message
Posted Thursday, January 3, 2013 7:18 PM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Yesterday @ 6:12 PM
Points: 3,609, Visits: 5,220
Greg Snidow (1/3/2013)
cs_source (1/3/2013) If you like i can post the SAS code? :)


Not the code for percentile, but if you can figure out a way to use OPENROWSET with the SAS OLE providers I would sure appreciate it. I am able to use VBA in Excel to read SAS files, and to use the import wizard in SQL Server to import .sas7bdat files, but for the life of me I can't get OPENROWSET to work with the same SAS providers that Excel has no problem with.


Given the power of SAS, if you can ever make it work it sounds like the makings of a great article!



My mantra: No loops! No CURSORs! No RBAR! Hoo-uh!

My thought question: Have you ever been told that your query runs too fast?

My advice:
INDEXing a poor-performing query is like putting sugar on cat food. Yeah, it probably tastes better but are you sure you want to eat it?
The path of least resistance can be a slippery slope. Take care that fixing your fixes of fixes doesn't snowball and end up costing you more than fixing the root cause would have in the first place.


Need to UNPIVOT? Why not CROSS APPLY VALUES instead?
Since random numbers are too important to be left to chance, let's generate some!
Learn to understand recursive CTEs by example.
Splitting strings based on patterns can be fast!
Post #1402636
Posted Friday, January 4, 2013 3:59 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Tuesday, July 8, 2014 8:36 AM
Points: 1,565, Visits: 2,378
dwain.c (1/3/2013) Given the power of SAS, if you can ever make it work it sounds like the makings of a great article!


Indeed, I believe it would be. I find it quite annoying to have to use the import wizard. Per the SAS documentation, not all of the 4 providers support SQL operations, so there is that issue. However, I tend to think that the way an ADO recordset handles the data access would be similar in nature to the way OPENROWSET would handle it. Of course, that is just my totally uninformed speculation. I'll keep plugging away at it, and if I do come up with a solution I'll certainly share the wealth. One problem is that you only get the providers by having SAS installed on your machine. Now, SAS does provide just the providers for free, but I have been unable to get them to work on my personal machine, where I don't have SAS installed.


Greg
_________________________________________________________________________________________________
The glass is at one half capacity: nothing more, nothing less.
Post #1402782
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse