Viewing 15 posts - 466 through 480 (of 692 total)
More questions like this, please! They really show off that the author....
print convert(varchar(3), 0x697320) +
convert(varchar(5), 0x747279696E) +
convert(varchar(1), 0x67) +
convert(varchar(7), 0x20746F206D616B) +
convert(varchar(4), 0x65206869) +
convert(varchar(3), 0x6D7365) +
convert(varchar(8), 0x6C66207365656D20) +
convert(varchar(1), 0x6C) +
convert(varchar(3),...
--
Adam Machanic
whoisactive
December 17, 2004 at 1:37 pm
Good job. Very helpful article!
--
Adam Machanic
whoisactive
December 17, 2004 at 12:28 pm
Here's another way, slightly more intuitive IMO (as it does not rely on conversion to FLOAT/knowledge of SQL Server's internal date format):
select dateadd(ss, -1, dateadd(dd, 1, datediff(dd, 0, getdate())))
--
Adam Machanic
whoisactive
December 14, 2004 at 9:05 am
Why would you use 23:59:59 rather than 00:00:00 ? The latter, IMO, is more intuitive...
--
Adam Machanic
whoisactive
December 14, 2004 at 7:09 am
I thought about this some more and realized that the solution I posted won't work if the search string starts, e.g. at character 7999 and ends at 8001... I believe...
--
Adam Machanic
whoisactive
November 22, 2004 at 8:37 pm
CHARINDEX will not search beyond 8000 characters in SQL Server 2000... So that function doesn't quite work as expected:
create table testsearch(textcol text)
go
declare @bigstring varchar(8000)
set @bigstring = replicate('0', 8000)
declare...
--
Adam Machanic
whoisactive
November 20, 2004 at 5:42 pm
An easy way to do this with a varchar(8000) is to do something like:
declare @instring varchar(8000)
set @instring = 'abcabcabc'
declare @teststring varchar(100)
set @teststring = 'abc'
SELECT (LEN(@instring) - LEN(REPLACE(@instring, @teststring, ''))) /...
--
Adam Machanic
whoisactive
November 19, 2004 at 1:17 pm
Including validation in the script earned extra points? That should deduct points, IMO. Data validation belongs in constraints, not in data access code. Yes, this was just...
--
Adam Machanic
whoisactive
November 19, 2004 at 1:09 pm
That's correct. Keep in mind that indexed views were really designed to assist with performance of aggregate-heavy queries (lots of SUM, AVG, etc). A lot of developers attempt...
--
Adam Machanic
whoisactive
November 15, 2004 at 3:09 pm
You can't do that in SQL Server 2000. In SQL Server 2005 you will be able to, using the APPLY operator.
--
Adam Machanic
whoisactive
November 15, 2004 at 10:54 am
If you already have a table-valued function, why bother with a view?
A table-valued function is essentially a parameterized view... (or non-parameterized, if you don't bother using parameters!)
--
Adam Machanic
whoisactive
November 15, 2004 at 9:23 am
This will return both rows 2 and 3... Both are technically overlapping, so IMO that's correct behavior. If you want only one or the other it might be possible...
--
Adam Machanic
whoisactive
November 13, 2004 at 11:31 pm
BULK INSERT YourTable FROM 'YourFile' WITH (FIRSTROW=2, FIELDTERMINATOR='|')
--
Adam Machanic
whoisactive
November 13, 2004 at 11:25 pm
"I have read that, under the covers, SS implements a view the same way it implements a stored proc, i.e., it creates a query plan, keeps it handy for execution,...
--
Adam Machanic
whoisactive
November 12, 2004 at 1:39 pm
Joe,
You already have a Nested Sets model -- kind of. You should be able to write a cursor against your ordered select, and use that to insert row-by-row...
--
Adam Machanic
whoisactive
November 12, 2004 at 7:47 am
Viewing 15 posts - 466 through 480 (of 692 total)