Viewing 15 posts - 301 through 315 (of 423 total)
That's good to know. But my point was concerning the ISDATE function. As these examples point out, no matter how sound the logic may be for a CAST (or CONVERT)...
January 24, 2013 at 4:54 pm
ISDATE isn't quite in sync with all of the date datatypes. I just think it's prudent to prevent an unexpected failure of a procedure to check an alleged "date" by...
January 24, 2013 at 4:10 pm
To prevent unexpected errors, you should validate your dates. And the ISDATE function is not a reliable method for such validation.
DECLARE
@InputDate DATETIME
,@CurrDate DATETIME
SET @InputDate = '1/1/2013'
SET @CurrDate =...
January 24, 2013 at 12:41 pm
There's really no limit to what you can do with grouping and case statements. The OVER() clause really makes thing easy. You can even combine all the aggregates in the...
January 24, 2013 at 11:51 am
You can avoid group by altogether by using the OVER() method when using aggregates (I think this is for SQL2008 and higher).
IF OBJECT_ID('tempdb..#TempTable') IS NOT NULL
DROP TABLE #TempTable
CREATE TABLE #TempTable...
January 24, 2013 at 9:41 am
Wow...I'm impressed! I don't think the OP realized the impact of his request! The more I think about this the more uses I can see for such a function. For...
January 23, 2013 at 8:57 am
ChrisM@Work (1/22/2013)
dwain.c (1/22/2013)
Uh, just asking here but wouldn't it make sense to vary the strings and the replacements?Or did I miss something?
Not often you miss something Dwain! You're right of...
January 22, 2013 at 9:39 am
Here's my variation to do a dynamic replace of elements from one delimited string by another. It's really just a variation of DelimitedSplit8K. Just out of curiosity I ran it...
January 22, 2013 at 1:16 am
aochss (1/16/2013)
January 16, 2013 at 11:42 am
For future reference, you may want to parse the entire XML string into its own table in one pass and then construct your query around that to join with the...
January 15, 2013 at 10:28 am
Here's another alternative you could try:
IF OBJECT_ID('tempdb..#TempTable') IS NOT NULL
DROP TABLE #TempTable
CREATE TABLE #TempTable (
[ID] [int] IDENTITY(1,1) NOT NULL,
[FirstName] [nvarchar](50) NULL,
...
January 15, 2013 at 10:08 am
Bhuvnesh (1/14/2013)
January 14, 2013 at 10:05 am
ScottPletcher (1/10/2013)
dwain.c (1/9/2013)
Steven - Those FUNCTIONs look like nice work. I've saved them off for future analysis. 🙂
You might want to review the new functions in SQL 2012 dealing...
January 10, 2013 at 2:48 pm
AS you've found out, the use of ISDATE is unreliable when doing implicit conversions.
Try these:
SELECT ISDATE('2013-01-08 15:44:12.2081606 +05:30') AS test
SELECT ISDATE('2013-01-08 15:44:12.2081606') AS test
SELECT ISDATE('2013-01-08 15:44:12.208') AS test
The different results...
January 9, 2013 at 12:58 pm
To get the correct week number based on ISO standard you can use this function:
--Credit to Ramakrishna Elashwarapu
CREATE FUNCTION dbo.tvfGetWeekNumberFromDate_ISO
(
@dDate DATETIME
...
January 7, 2013 at 10:47 am
Viewing 15 posts - 301 through 315 (of 423 total)