|
|
-
ErikEckhardt Commented 2 Days ago through Just Learned
If you *want* to test for integers, try `IsNumeric(@stringvalue + '.0E0')`...
|
-
ErikEckhardt Commented 4 Days ago through Blogs
Here's my best solution.
;WITH Scrubbed AS (
(
SELECT 'Col' Which, Col, Convert(varchar(max), '') Canonized, 0 NextPos FROM @t
UNION ALL SELECT 'Val', @s, '', 0
)
UNION ALL SELECT
Which,
Col,
...
|
-
ErikEckhardt Commented 5 Days ago through Blogs
@Madhivanan, My example was not quite good enough to show you the problem.
Please try the following to see the incorrect value being included via the use of sum():
select '2.2020 30 4.0200' union all
select '2.2020 30 4.07000' union all
...
|
-
ErikEckhardt Commented 6 Days ago through Blogs
Jeff, all of us cringe at seeing *first normal form* violated. I shouldn't have corrected the flaw I saw without also mentioning the bigger flaw you so rightly decry....
|
|
|
-
ErikEckhardt Commented 6 Days ago through Blogs
Using sum is not safe. Add this to see what I mean:
union select '2.201 30 4.0100'
Instead, start with repeatedly trimming trailing zeroes until none are left - `replace(@string + ' ', '0 ', ' ')`
Then trim trailing decimal points - `repla...
|
|
|
-
ErikEckhardt knew 20 Days ago through Just Learned
I learned about this from Pinal Dave's blog(You can see the original article in references.)
In SQL Server, while creating a table, we can give maximum length of 128 characters. However, while creating temp tables, maximum length can be of 116 chara...
|
-
ErikEckhardt Liked 20 Days ago through Just Learned
I learned about this from Pinal Dave's blog(You can see the original article in references.)
In SQL Server, while creating a table, we can give maximum length of 128 characters. However, while creating temp tables, maximum length can be of 116 chara...
|
-
ErikEckhardt knew 1 Months ago through Just Learned
I stumbled across a scenario where I had to find all the triggers associated with few tables. Found the below queries and felt that they are worth sharing. I am listing the helpful sql queries!
To get a list of all the triggers in the database
...
|