Viewing 15 posts - 541 through 555 (of 2,007 total)
CELKO (8/15/2012)
WITH Corrected_Tests (device_id, test_value, device_test_seq)
AS
(SELECT...
August 15, 2012 at 9:26 am
Abu Dina (8/15/2012)
Cadavre, the ^ at the end is there to exclude the - from being removed.Adi, I'm happy with your solution!
Thanks to you both.
Test mine 😉
Your code: -
IF EXISTS...
August 15, 2012 at 9:24 am
Total guess, no testing has gone into this: -
CREATE FUNCTION [dbo].[fn_QBRemoveNonAlphaChars] (@String VARCHAR(1000))
RETURNS VARCHAR(1000)
AS
BEGIN
WHILE PATINDEX('%[^a-z ''-]%', @String) > 0
SET @String = STUFF(@String, PATINDEX('%[^a-z ''-]%', @String), 1, '')
RETURN @String
END
You had the...
August 15, 2012 at 9:01 am
scott_lotus (8/15/2012)
Edit to say, not sure is UNION is a good idea, find it very slow on + billions records.
The UNIONs that some have posted are part of creating sample...
August 15, 2012 at 8:50 am
Luis Cazares (8/15/2012)
DECLARE @Tabletable(
idint,
device int,
value int)
INSERT @Table
SELECT 9, 456, 70 UNION ALL
SELECT 8, 456, 60 UNION ALL
SELECT 7, 123, 70 UNION ALL
SELECT 6, 123, 60 UNION ALL
SELECT 5, 456, 50...
August 15, 2012 at 8:44 am
scott_lotus (8/15/2012)
August 15, 2012 at 8:35 am
Luis Cazares (8/14/2012)
Wouldn't this be defined by the regional settings? If the settings affect the format for money, this can result problematic.
I don't believe so. Normally I'd just test it,...
August 15, 2012 at 5:00 am
N11689 (8/14/2012)
We need to execute a VB.NET (2010) executable from SQL (2005).Is this possible, and what is the best way to do this?
I guess this might work: -
EXEC master..xp_CMDShell 'c:yourFile.exe'
August 14, 2012 at 9:30 am
Out of curiosity, does this correct your issue?
DECLARE @str NVARCHAR(MAX);
SELECT @str = STUFF((SELECT CHAR(13) + CHAR(10) + csvFile
...
August 14, 2012 at 1:54 am
cms9651 (8/14/2012)
Hi there, I need your help.
I have this number in my database output result of query:
1013473
I need this output: 1.013.473
Can you help me?
Thanks...
August 14, 2012 at 1:33 am
Eugene Elutin (8/10/2012)
And, sorry, for typing in capital, I didn't intend to shout, I just wanted to make the sentence appear bold, as it's quite important tip.
Apology accepted, I...
August 10, 2012 at 11:53 am
Eugene Elutin (8/10/2012)
4. Do not create new SqlString, just cast the result of regex.replace
That's redundant.
using System;
using System.Data.SqlTypes;
using System.Text.RegularExpressions;
namespace TrimTrailingLeading
{
public class UserDefinedFunctions
{
...
August 10, 2012 at 5:01 am
Eugene Elutin (8/10/2012)
(SqlString) s.Value.TrimStart('0').TrimEnd('0');
instead of
new SqlString(s.Value.TrimStart('0').TrimEnd('0'));
what about Regex?
Don't forget to create static Regex object instead of instance in the function.
To remove leading...
August 10, 2012 at 4:52 am
CLR Version 1:
using System;
using System.Data.SqlTypes;
namespace TrimTrailingLeading
{
public class UserDefinedFunctions
{
[Microsoft.SqlServer.Server.SqlFunction]
...
August 10, 2012 at 4:42 am
dwain.c (8/10/2012)
For overall terseness, I kinda like...
August 10, 2012 at 3:54 am
Viewing 15 posts - 541 through 555 (of 2,007 total)