Viewing 15 posts - 3,871 through 3,885 (of 3,956 total)
Jeff,
You win hands down for elegance and simplicity and even though I knew how unlikely it was, I was still hoping to beat you out on performance. So I...
March 26, 2012 at 11:51 pm
You can try something like this and but it will also match ABC in 0ABC (if this is what you want):
DECLARE @clients TABLE (clientno VARCHAR(20))
INSERT INTO @clients
SELECT '55566' As clientno
UNION...
March 26, 2012 at 9:26 pm
Grecci,
I'm glad my post helped to jump start the discussion.
I suspected it might have issues with more XML but I was lazy to build it myself. Mark's is spot...
March 26, 2012 at 8:21 pm
You can use Mr. Celko's view but if you must have a scalar function, you can do it with the following (I'll let you figure out how to add the...
March 26, 2012 at 8:16 pm
Jeff,
The following thought occurred to me last night but I didn't get a chance to test it until this morning.
Isn't the modulo function designed to always return a positive integer?
Hence,...
March 26, 2012 at 7:39 pm
GPO said:
It would be great to have a method of generating random data that approximated a distribution, whether it be Gaussian or exponential decay, or an F distribution or whatever.
The...
March 26, 2012 at 6:43 pm
Not sure if this example is any more efficient than the one provided by bitbucket but it is an alternate:
DECLARE @times TABLE ([hh:mm]VARCHAR(12))
INSERT INTO @times
SELECT '115:32'
UNION...
March 26, 2012 at 4:31 am
It would probably help if your XML was properly formatted (corrected below).
Does this give you what you're looking for?
DECLARE @data XML
SET @data = CAST(
'<Automobile>
<Car name="Corvette">
<Properties color="Red"...
March 26, 2012 at 4:07 am
Outstanding article Jeff! Just what the doctor ordered for something I'm working on at this instant.
I can't wait for the purists to berate you for using "pseudo" random numbers...
March 26, 2012 at 12:20 am
I believe this thread is on the same subject:
http://www.sqlservercentral.com/Forums/Topic1260577-338-1.aspx#bm1260601
March 22, 2012 at 6:45 pm
Try it as a correlated subquery and lose the GROUP BY, thusly:
DECLARE @HOF TABLE (
FamilyID INT, HoFName CHAR(4), Age INT, Gender CHAR(1), DoorNo CHAR(3), TotalDependents INT)
DECLARE @Dep TABLE (
FamilyID...
March 22, 2012 at 3:30 am
Jeff,
This is interesting. I've read about but never used the variant type but I can (now that you mention it) appreciate how it could be useful in an audit...
March 21, 2012 at 7:21 pm
8-bit Ninja: Good on you for taking Lynn's advice and working the problem.
Just my opinion here but I think this looks a bit more elegant updating through a CTE. ...
March 21, 2012 at 6:58 pm
To Tom-John and Janus Lin, sorry for the late reply on this but I believe I can address your "Top-N Fudge Rounding" approach with the sample code below. In...
March 21, 2012 at 9:07 am
Mr. edobrzel ,
When i run with your MNO I get this result set which adds to 100:
key1key2WeightAllocAmt
MNO116.0015.00
MNO216.0017.00
MNO316.0017.00
MNO416.0017.00
MNO516.0017.00
MNO616.0017.00
March 21, 2012 at 6:41 am
Viewing 15 posts - 3,871 through 3,885 (of 3,956 total)