Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


TSQL and percentile (not percentilerank :)


TSQL and percentile (not percentilerank :)

Author
Message
dwain.c
dwain.c
SSCarpal Tunnel
SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)

Group: General Forum Members
Points: 4279 Visits: 6431
Greg Snidow (1/3/2013)
cs_source (1/3/2013) If you like i can post the SAS code? Smile


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!
My temporal SQL musings: Calendar Tables, an Easter SQL, Time Slots and Self-maintaining, Contiguous Effective Dates in Temporal Tables
Greg Snidow
Greg Snidow
SSCommitted
SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)

Group: General Forum Members
Points: 1611 Visits: 2478
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.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search