Viewing 15 posts - 46 through 60 (of 668 total)
That's how I would do it. Use a tally table or table function to generate the values needed, then left join the tally table to your dataset , then us...
January 12, 2021 at 4:13 pm
What is the PK of the Insurance Table? Include that in your cursor, then update the MsgSent to 1 after the send email proc call
January 11, 2021 at 5:13 pm
I created DDL based on your sample. You hardcoded the orderid in your union all statement. Can you provide usable DDL and data to help show what you are looking...
January 11, 2021 at 3:27 pm
Looks like Min/Max works for your scenario
IF OBJECT_ID('tempdb..#Codes') IS NOT NULL
DROP TABLE #Codes
Create table #Codes (
Code_Type varchar(20),
Start_Id int,
End_Id int)
insert into #Codes values
('all_codes_set',1,5 ),
('all_codes_set',7,14 ),
('all_codes_set',17,49 ),
('all_codes_set',61,100),
('voided',6,6),
('cancelled',50,60),
('unused',15,16)
Select Code_type, min(Start_Id)...
January 11, 2021 at 1:51 pm
You have to do some outer applies.
declare @x xml
SELECT @x = CAST(MY_XML AS xml)
FROM OPENROWSET(BULK 'C:\Users\MyUser\Documents\Lukasz\Apps\Ramo\SIN\SecutrityUsers.xml', SINGLE_BLOB) AS T(MY_XML)
...
January 8, 2021 at 1:32 pm
removed - duplicate from above
January 5, 2021 at 8:35 pm
always start in lower environments (Dev, Test, Stage, Prod) or something similar. The Environments should be relatively the same. There may be different code in different environments depending on where...
December 18, 2020 at 4:37 pm
You can do merge to #L in the proc and output the insert/deleted values to a temp table, then use the temp table to merge values to #P table
December 18, 2020 at 4:34 pm
Select t.column1, (SELECT STUFF(
...
December 18, 2020 at 4:29 pm
how do you know the order of the values to concatenate? You can use Stuff to accomplish this, but you'll need a way to know which ones to include. (i.e....
December 18, 2020 at 2:38 pm
Something like this?
select CustomerID, Create_Date,
(select count(1)
from #Customers c1
where c1.Create_date between DateAdd(hour, -1, c.Create_date) and c.Create_date) as NumberOfSignups
--,Count(1)
from #Customers c
where c.Create_date between DateAdd(hour, -1, c.Create_date) and c.Create_date
order by...
December 17, 2020 at 8:59 pm
SELECT s.[BusinessEntityID] ,
s.[Name] ,
at.[Name] AS [AddressType],
A.AddressID,
a.[AddressLine1] ,
a.[AddressLine2] ,
a.[City] ,
sp.[Name] AS [StateProvinceName] ,
a.[PostalCode] ,
cr.[Name] AS [CountryRegionName]
FROM [Sales].[Store] S Join [Person].[BusinessEntityAddress] BEA ON bea.[BusinessEntityID] = s.[BusinessEntityID]
Join [Person].[Address] a ON...
December 15, 2020 at 8:25 pm
Check the data source task. Right Click --> Open Advanced Editor. On Input/Output tab open External Columns and Output Columns. Find your column and see what the...
December 4, 2020 at 8:19 pm
I'm not sure that will work. The CloseDatabase command takes source_database_name and target_database_name as parameters, so it creates a read-only copy on the same server.
November 30, 2020 at 9:50 pm
Viewing 15 posts - 46 through 60 (of 668 total)