Viewing 15 posts - 1,366 through 1,380 (of 2,648 total)
A new line can be made of carriage-return or linefeed characters or both. So really you should be replacing both.
Try this:
REPLACE(REPLACE(REPLACE(ColumnName, CHAR(13)+CHAR(10), ' '), CHAR(10), ' '),...
October 9, 2019 at 7:57 pm
WHERE AKey IN ('AAA', 'BBB', 'CCC', 'DDD', 'EEE', 'GGG', 'JJJ') AND LEN(AKey) = 9All the values in the IN have a length of 3. But you are...
October 9, 2019 at 7:48 pm
;WITH cte AS
(
SELECT x.customerid,
x.stage,
...
October 8, 2019 at 4:43 pm
is this compatible with SQL2000?
No, as SQL 2000 did not have CROSS APPLY or selecting from VALUES or the datetime2 data type or ROW_NUMBER() or IIF or TOP.
October 8, 2019 at 12:42 pm
But it's easy enough to clean up. Just REPLACE(REPLACE(@sql, '1=1 AND ', ''), 'WHERE 1=1', ''). So if there are additional conditions, you remove the 1 = 1...
October 7, 2019 at 2:49 pm
You can run perfmon and get it to log chosen stats to a flat file or even a SQL Server database. But unless you have something in place and...
October 7, 2019 at 1:02 pm
Declare @startdatetime datetime = '2019-09-01T07:00:00'
Declare @enddatetime datetime = '2019-10-01T07:00:00'
;with cte as
(
Select d.UserId,
...
October 5, 2019 at 6:54 pm
Declare @startdatetime datetime = '2019-09-01T07:00:00'
Declare @enddatetime datetime = '2019-10-01T07:00:00'
;with cte as
(
Select d.UserId,
d.StatusValue,
...
October 5, 2019 at 6:49 pm
select d1.UserId,
d1.StatusValue,
d1.UpdateDate,
d2.StatusValue PrevValue,
...
October 5, 2019 at 3:26 pm
Hi all,
Assuming that I have the phrase "All I want (for Christmas) is better (TSQL) coding skills (this year)."
And I want to remove the parenthesis and everything in between...
October 4, 2019 at 11:53 am
Without wanting to give away the answer, the script creates an empty table variable that it populates to generate a select. So I would look at rewriting the entire script...
October 3, 2019 at 3:13 pm
Hey Jeff. Great idea! I'm going to add this to my notes.
When you have a new historical period, you create a new table and modify the view definition?
At...
October 3, 2019 at 12:50 pm
why the recommendation to do Jonathon's method? This seems just intuitively a little ... weirder or unnatural. What is the nutshell thinking behind this?
If you drop an object then...
October 2, 2019 at 6:20 pm
Test if the object exists first, if it doesn't CREATE the object with minimal functionality, then ALTER the object to have the full code you required.
use ...
October 2, 2019 at 4:29 pm
If you load them into a staging table with the date stored as varchar, you can go through the date column looking at the maximum value of substring(date,1,2) and substring(date,4,2). Hopefully,...
October 2, 2019 at 2:13 pm
Viewing 15 posts - 1,366 through 1,380 (of 2,648 total)