Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Equivalent of Transform(@R)
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2008
Miscellaneous
Thread ID:
01518159
Message ID:
01518204
Views:
44
Thanks Bill, I was trying to avoid loops; but the good news is that I just came back from a test that worked pretty well without the need to insert a pause after a digit, it turns out that they found out that the telephone lines that my program was using were connected to a different "controller" (whatever that is) than the system that uses it as a parameter, and one person remembered that with that configuration there were problems with DTMF codes produced by telephony cards, so they put all my lines into the same controller and voila, it seems that it fixed the issue, so I do not need to introduce pauses between digits (the commas, I had already maxed out the IDP, so the forced pauses were the only alternative)



>You could write a function, (UDF) in SQL Server. I called this MakeDialString
>
>use Test;
>GO
>IF OBJECT_ID (N'dbo.MakeDialString', N'FN') IS NOT NULL
> DROP FUNCTION dbo.MakeDialString;
>GO
>CREATE FUNCTION MakeDialString (@phone VARCHAR(40))
> RETURNS VARCHAR(40)
>with execute as caller
>as
>BEGIN
> DECLARE @intFlag INT
> DECLARE @phone2 VARCHAR(40)
>
> SET @intFlag = 1
> SET @phone2 = ''
>
> WHILE (@intFlag lessthan 11) BEGIN
> set @phone2 = @phone2 + substring(@phone,@intflag,1) + ','
> set @intFlag = @intFlag + 1
> END
> RETURN @phone2
>END
>GO
>
>Rplace lessthan with the less than symbol, it would not let me post with it, must be my settings
>Then use it in your select as
>
>use Test;
>GO
>select dbo.MakeDialString('5555551212') as dialphone
>go
>
>Replacing the number with your PhoneNumberField
>
>Bill
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Previous
Reply
Map
View

Click here to load this message in the networking platform