Viewing 15 posts - 346 through 360 (of 2,171 total)
And with some error checking
alter function dbo.ConvertIp2Num(@ip varchar(15))
returns bigint
as
begin
returncase
when @ip like '%[^0-9.]%' then NULL
when @ip like '%.%.%.%.%' then null
when @ip like '%..%' then null
when @ip...
July 25, 2009 at 3:12 am
No need to cast either
alter function dbo.ConvertIp2Num(@ip varchar(15))
returns bigint
as
begin
return16777216.0 * parsename(@ip, 4)
+ 65536 * parsename(@ip, 3)
+ 256 * parsename(@ip, 2)
+ 1 * parsename(@ip, 1)
end
July 25, 2009 at 2:49 am
I am confused since table variables doesn't have statistics.
July 23, 2009 at 4:43 pm
DECLARE@Sample TABLE
(
Company VARCHAR (100) NOT NULL,
[Hours] INT NOT NULL
)
INSERT@Sample
SELECT'Some Company 1', 10056 UNION ALL
SELECT'Some Company 2', 1354 UNION ALL
SELECT'Some Company 2', 8979 UNION ALL
SELECT'Some...
July 18, 2009 at 2:40 am
Sure. I forgot to see which version it was.
😀
July 17, 2009 at 3:29 pm
The only difference is the version row.
See http://msdn.microsoft.com/en-us/library/ms191479.aspx
Change the version row to 9.0 and you can use if with both versions.
July 17, 2009 at 3:02 pm
Are you using Enterprise Edition?
If so, read about CDC (Change Data Capture).
July 17, 2009 at 1:33 pm
Also asked and answered here
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=129492
OP got an answer with 50% better performance; 20 minutes instead of 30.
July 16, 2009 at 3:06 pm
JohnG (7/16/2009)
Impossible to do with IDENTITY.
Not with the OUTPUT operator.
July 16, 2009 at 8:52 am
Yes, I am quite sure.
For a few years ago, I was called in to solve a replication error. There were 3 records out of 2 billion that was not...
July 15, 2009 at 1:52 am
It will an issue for your indexing strategies.
A GUID is 16 bytes wide, an INT is 4 bytes, which essentially means your indexes will be 4 times as big than...
July 14, 2009 at 4:26 pm
A worktable is an internal table created by SQL Server as a helper table to solve certain things.
These things can be aggregations, joins and so on.
July 14, 2009 at 3:16 pm
And to simplify the date math even more
SELECTDATEADD(MONTH, DATEDIFF(MONTH, 0, GETDATE()), -1)
July 14, 2009 at 2:20 pm
Viewing 15 posts - 346 through 360 (of 2,171 total)