Viewing 15 posts - 51,151 through 51,165 (of 59,079 total)
Thanks, SQLBlue. :blush: Very happy it does what you want and I sure do appreciate the compliment... you made my weekend. 🙂
April 13, 2008 at 9:18 am
Sergiy (4/12/2008)
Actually you can.Just declare your variable as a parameter of SP.
Never too late to say thanks... you showed me that cool trick a couple of years ago. Thanks...
April 12, 2008 at 11:42 pm
Heh... yeah... and some generic data with a generic table structure along with your generic code and a generic sample of what the output should look like would be a...
April 12, 2008 at 11:38 pm
p.s.
Longer code is not always slower code. Longer code does the ol' "Divide and Conquer". The code I posted is what they call "Set Based" programming and that...
April 12, 2008 at 11:34 pm
As you're finding out, the hard part is to "smear" the existing data into the new rows for the missing years. This type of smearing is VERY procedural and...
April 12, 2008 at 11:15 pm
Matt is correct about the Tally table... but a Tally table isn't really worth a hoot when it comes to performance unless you also build the necessary Clustered Primary Key......
April 12, 2008 at 10:04 pm
JD (4/12/2008)
April 12, 2008 at 9:27 pm
Heh... I've made many such a mistake... thanks for the feedback.
April 12, 2008 at 9:12 pm
Sometimes, "old school" works better...
SET NOCOUNT ON
SET STATISTICS IO ON
SET STATISTICS TIME ON
SELECT IDENTITY(INT,1,1) AS RowNum,
ID,ST,Date
INTO #MyHead
...
April 12, 2008 at 4:33 pm
Like practicing the piano, either you invest the time to get really good... or you don't. There are no shortcuts. For example, I recently answered a post where...
April 12, 2008 at 2:03 pm
DateDiff and DateAdd have the tendency to round to whatever the "date part" is and, despite what many folks think, shouldn't be used to calculate what the difference between full...
April 12, 2008 at 12:58 pm
You made the mistake of using ISNUMERIC to check for digits. ISNUMERIC does not equal ISALLDIGITS... try this and see what I mean...
SELECT dbo.check_digit('072---326')
Rather than just have it return...
April 11, 2008 at 11:26 pm
You can shrink this down quite a bit...
[font="Courier New"] CREATE FUNCTION CreateABACheckDigit
--===== Created by Jeff Moden
(@RoutingNumber CHAR(8))
RETURNS INT
AS
BEGIN
RETURN (SELECT NULLIF(10-( SUBSTRING(@RoutingNumber,1,1)*3
+ SUBSTRING(@RoutingNumber,2,1)*7
+ SUBSTRING(@RoutingNumber,3,1)*1
+ SUBSTRING(@RoutingNumber,4,1)*3
+ SUBSTRING(@RoutingNumber,5,1)*7
+ SUBSTRING(@RoutingNumber,6,1)*1
+ SUBSTRING(@RoutingNumber,7,1)*3
+ SUBSTRING(@RoutingNumber,8,1)*7)%10
,10))
END
[/font]
April 11, 2008 at 11:04 pm
Viewing 15 posts - 51,151 through 51,165 (of 59,079 total)