Viewing 14 posts - 1 through 14 (of 14 total)
Hi, I have included FIRE_TRIGGERS in fast load mode and my package is failing with error "An error was raised during trigger execution. The batch has been aborted and the...
September 15, 2021 at 7:57 am
Remove duplicates using CTE as below and then you can insert records as per your existing process.
--Removing duplicates
;WITH Duplicates AS (
SELECT
OrderId,OrderDate,OrederArea,OrderCode,
ROW_NUMBER() OVER (
PARTITION BY
OrderId,OrderDate,OrederArea,OrderCode
ORDER BY
CreateDate desc
) row_num
FROM
temp.Order
)
delete from Duplicates WHERE...
November 21, 2019 at 9:42 pm
I dont think there are duplicates in your result set. However, You can use the below:
Select A.* Into #temp From (
<<Your code>>
) As A Where A.DetailId Not In(Select DetailId From...
November 21, 2019 at 4:09 am
StrutturaOrganizzativa.descrizione is string type and Negozi.fk_responsabile is integer type. When you join on two columns both should be of same datatype. Use this:
Select
Negozi.descrizione,
StrutturaOrganizzativa.descrizione
from Negozi
inner join StrutturaOrganizzativa
on StrutturaOrganizzativa.pk_id = Negozi.pk_id
November 11, 2019 at 9:55 pm
You can achieve this by using the following SQL:
Select unit.rptMth as [Date],
COALESCE(NULLIF(unit.Buiding,''),x.Buiding) as Building,
COALESCE(NULLIF(unit.Unit,''),x.Unit) as Unit,
NULLIF(unit.uStatus,'') as RentStatus,
COALESCE(nullif(unit.uStatus, ''), x.uStatus) DesiredStatus
From #tmpFUnit unit
Outer Apply (Select Top 1 Buiding, Unit, uStatus
From...
November 11, 2019 at 9:40 pm
Just remove status from select clause and see.
November 11, 2019 at 9:26 pm
You can use the below T-SQL:
DECLARE @email_addr NVARCHAR(450), @min_id int, @max_id int, @query NVARCHAR(1000)
SELECT @min_id=MIN(id), @max_id=MAX(id) FROM #YourTable
WHILE @min_id<=@max_id
BEGIN
SELECT @email_addr=email_addr FROM #YourTable
set @query='sp_send_dbmail @profile_name=''ProfileName'',
@recipients='''+@email_addr+''',
@subject=''subject line'',
@body=''Body message.'''
EXEC @query
SELECT @min_id=MIN(id) FROM #YourTable...
October 22, 2019 at 2:08 am
Set a default value to the parameter and validate against that default to identify blanks.
October 22, 2019 at 1:55 am
You can achieve this using the below query:
SELECT ID, Question, [A], , [C], [OPTION]
FROM
(
SELECT A.ID,Answer,Question
FROM Answer A
inner join Question Q on A.ID = Q.QuestionID
) As PivotTable
PIVOT
(
MAX(Answer)
FOR Answer IN ([A], ,...
October 20, 2019 at 10:08 pm
You can do this using Joins as below:
--Inner join for exact match between INFO and MATION
Select i.Name, i.Age, m.Description IDNumber
From INFO i
Inner join MATION m on i.IDNumber = m.ID
--Left Outer...
October 18, 2019 at 4:52 am
You can use this one
substring(col_processing, PatIndex('%[0-9]%', col_processing), len(col_processing))+1
October 18, 2019 at 4:40 am
This can be done using
SELECT TOP (@rows) y.Family, y.Room, y.subfamily
FROM @Table AS y
ORDER BY NEWID();
OR
SELECT y.Family, y.Room, y.subfamily
FROM @Table AS y TABLESAMPLE(3 ROWS)
But, the TABLESAMPLE clause cannot be applied to...
September 18, 2019 at 12:08 am
Dynamic file name in SSIS can be done using expression builder. This article is nice and clear.
September 17, 2019 at 5:16 am
Viewing 14 posts - 1 through 14 (of 14 total)