Viewing 15 posts - 856 through 870 (of 8,731 total)
I have to build something that will find ASCII character and replace them with blank...
November 6, 2017 at 11:35 am
Not a big fan of this procedure. But if you're going to use it, try keeping it safe and robust.
CREATE PROCEDURE sp_Truncate_Anything
(
@DBName nvarchar(130)...
November 3, 2017 at 2:03 pm
November 3, 2017 at 10:40 am
Just adding more details as you got answers. You can't create a function that will work for everything, unless you do additional work that is not really recommended. You should...
November 2, 2017 at 7:22 am
November 1, 2017 at 1:49 pm
Luis & Lynn,
I cannot thank the both of you enough!!!
I came here for help and...
November 1, 2017 at 12:22 pm
November 1, 2017 at 11:49 am
That syntax is only allowed starting on SQL Server 2012. You seem to be working on 2008, so that would be a problem.
Try using ROW_NUMBER() instead of COUNT(). In...
November 1, 2017 at 6:59 am
This gives the result you expect with the parameters shown. However, I suggest that you do a more extensive testing as I might have missed something.
CREATE...
October 31, 2017 at 8:26 am
Why not use NULLIF with a COUNT?
DECLARE @ClosedStuff TABLE (InspectionClosed DATE NULL);
INSERT INTO @ClosedStuff
VALUES (NULL),(NULL),('19000101'),(GETDATE())
SELECT COUNT(NULLIF( InspectionClosed, '19000101')) FROM @ClosedStuff
October 31, 2017 at 8:24 am
October 30, 2017 at 9:35 am
October 30, 2017 at 8:50 am
Have you compared the performance of the given solution with simply appending the searched character at the end of the string?
Select name, Substring(name,0, Charindex('.',name +'.')) as...
October 30, 2017 at 8:35 am
Since there's no way to give a proper answer without further information, I'll just leave this article here that explains this kind of problem.
https://www.red-gate.com/simple-talk/sql/t-sql-programming/the-sql-of-gaps-and-islands-in-sequences/
October 27, 2017 at 1:45 pm
Viewing 15 posts - 856 through 870 (of 8,731 total)