Viewing 15 posts - 106 through 120 (of 288 total)
Use the CAST fuction. If your datetime column is in a format different from the server default you can also use CONVERT and specify the format/style of the date string.
CREATE...
July 28, 2010 at 3:45 pm
Two things.
1. d65cafc-1435-45d3-acce-dc464f02c4b1 is not a proper UNIQUEIDENTIFIER. The first grouping only has 7 characters when there should be 8.
2. Don't rely on implict conversions. CAST the GUID string to...
July 28, 2010 at 2:27 pm
You might try wrapping the date strings in single quotes before you pass the query.
PS: Be aware this could be dangerous.(see SQL Injection)
July 26, 2010 at 11:45 am
You might want to comapre the settings for TEMPDB. ALthough, I'm not sure what would cause that particular issue.
July 19, 2010 at 3:55 pm
Here is one way: -- Setup Data
SET DATEFORMAT DMY
DECLARE @Foo TABLE (Val1 VARCHAR(50), Val2 VARCHAR(50), DateVal DATETIME)
INSERT @Foo
SELECT '26,4069', 'Caudal', '20-05-2010 1:02:12'
UNION ALL SELECT '26,5306', 'Caudal', '20-05-2010 1:07:13'
UNION ALL SELECT...
July 19, 2010 at 3:15 pm
This doesn't answer your question, but I would highly suggest that you do NOT use database mail for such a task. The application should handle such things.
But, if you want...
July 1, 2010 at 12:24 pm
HowardW (6/30/2010)
June 30, 2010 at 11:25 am
Is the table a heap or did you just omit the clustered index?
June 28, 2010 at 3:02 pm
To add to what BT said, SQL is Cost Based. So, how the optimizer does it business is based on the perceived cost (this cost could be out of whack...
June 28, 2010 at 12:57 pm
Like is a bit funky when it comes to trailing spaces. You need to switch things around for a proper comparison:SELECT testdata
FROM @tbl
WHERE 'a' LIKE testdata
June 10, 2010 at 11:39 am
June 10, 2010 at 11:08 am
The Dixie Flatline (6/10/2010)
June 10, 2010 at 11:04 am
Lowell already pointed out where the rounding point happens. But, just as an FYI, BOL says (where ss means Seconds):
ss is two digits, ranging from 00 to 59, that represent...
June 8, 2010 at 2:32 pm
Business rules. Business Rules.. Business Rules.. 😀
Ideally if you can get them in words, not just entites and relationships. That way that business folks can review them for accuracy.
For example,...
June 4, 2010 at 12:38 pm
Viewing 15 posts - 106 through 120 (of 288 total)