Viewing 15 posts - 226 through 240 (of 300 total)
Could theoretically also be caused by a bug in SSMS. Are you using the latest version, i.e. 18.9.2?
August 12, 2021 at 8:55 pm
If I misunderstood and you want the alarm noticiation flag to control the selection criteria, then it's best to use two separate queries instead of trying to cram everything into...
August 12, 2021 at 7:36 pm
Uneducated guess:
DECLARE @AlarmNotification BIT
SELECT
mpe.MeasuringPointEntryID,
@AlarmNotification = CASE WHEN mpe.DateTimeEnd IS NOT NULL THEN 1 ELSE 0 END
FROM [location] l
JOIN...
August 12, 2021 at 7:23 pm
or maybe
declare @first DATE = '20200101';
insert into dbo.report (First_Of_Month, Customers_Count)
select top(20)
dateadd(d,1-day(saledate),saledate) as First_Of_Month,
count(distinct customerid) as Customers_Count
from Sales
where...
August 11, 2021 at 6:18 pm
Correct, if the length is not explicitly declared, a VARCHAR type variable is defined as being one byte long. 🙂
varchar [ ( n | max ) ] Variable-size string data.
When n isn't specified in a data...
August 11, 2021 at 5:28 pm
I'm not at all sure I have understood your question correctly, but this query does produce the desired outcome:
WITH
MultiCodes AS (
SELECT PartID, CodeTypeId, zValue
FROM #tradecode
GROUP BY...
August 7, 2021 at 10:06 pm
If you simply want to get rid of the decimal point, you can use the REPLACE funtion to replace it with a zero-length string, i.e.
SELECT REPLACE(yourColumn, '.' ,'') AS yourColumn
I'm...
August 6, 2021 at 1:25 pm
Building on what Ant-Green wrote, you can use this:
select *
from sys.dm_exec_sessions s
inner join msdb.dbo.sysjobs j
on convert(char(34),convert(binary(16),j.job_id),1) = substring(s.program_name, charindex('(Job 0x',s.program_name,1)+5,34)
where s.program_name like 'SQLAgent%Jobstep%'
and j.name='TEST' --...
August 6, 2021 at 11:34 am
You query produced the correct results. You need to use your reporting tool to handle the display that you want. SQL will not produce what you are looking for as...
August 6, 2021 at 8:02 am
Test data:
create table #CaseNames (
"Case ID" varchar(10) not null,
"Case Name" varchar(50) null,
constraint CaseName_PK primary key (
"Case ID")
)
create table #CaseFlows (
"Case Flow ID" varchar(10) not null,
"Case ID" varchar(10)...
August 5, 2021 at 8:33 am
This is probably just contributing to the guessing game, but I'll ask anyway...
Based on the difference in the number of records (your statement that the file has 2881 rows and...
May 19, 2021 at 8:09 am
One of my top use cases for APPLY is with a TOP(1), which is hard to achieve any other way, like for example selecting the latest price, i.e. something like...
May 5, 2021 at 11:42 am
You really should take a timeout, step back and seriously consider changing the structure of that table.
If you change the app_time and end_time into columns of type time(0), this would...
March 5, 2021 at 12:14 pm
There are a few additional variations that will achieve the same. The resulting query plan will probably look slightly different too.
update pwc
set pwc.companyId = p.CompanyId
...
March 5, 2021 at 9:51 am
The EOMONTH() function returns the last day of the month of a specified date, with an optional offset. The EOMONTH() function accepts two arguments: start_date is a date expression that evaluates to a date. The EOMONTH() function returns the last day of...
March 4, 2021 at 3:26 pm
Viewing 15 posts - 226 through 240 (of 300 total)