Call a SQL Server Stored Procedure using Excel Parameters

Call a SQL Server Stored Procedure using Excel Parameters

Anthony Smoak

1 год назад

14,522 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

mohammad asif
mohammad asif - 28.10.2023 21:02

Hey Anthony nice video. What do I need to do if instead of details I want to do pivot table representation? meaning I want to do all this, but then data needs to be transformed to a pivot table without user interaction.

Ответить
Emmanuel Aggrey
Emmanuel Aggrey - 02.07.2023 19:59

thanks for the video, please can share this file with us so we can edit it according to our need or share the code you pasted. I will be much greafull thank you sir

Ответить
Oussama Kherroub
Oussama Kherroub - 12.06.2023 13:18

Thank you for this video it works perfectly, but i have the error 438 when we run this macro in an other PC

Ответить
Herbert Woelffer
Herbert Woelffer - 27.04.2023 02:22

Followed everything. Runs great on mine but some other users get runtime error 1004 on the refresh line of the macro. Thoughts?

Ответить
DevendraTeluguchannel
DevendraTeluguchannel - 20.03.2023 06:48

how to create stored procedure please give me a video step by step .....

Ответить
Константин Коваленко
Константин Коваленко - 02.03.2023 19:03

Just in case someone need the code

create procedure sp_SampleOrderReport
@OrderState as varchar(100),
@OrderStartDate as Date,
@OrderEndDate as Date
as
declare @SQLString nvarchar(1000)
--statement for the procedure
SET @SQLString =
N'select
o.OrderID,
o.OrderDate,
ci.CityName as City,
ci.StateProvinceName,
cu.CustomerName as Picker,
o.Description,
o.Quantity,
o.UnitPrice
from Sales.Customers cu
inner join Application.Cities ci
on cu.DeliveryCityID = ci.CityID
inner join Sales.Orders o
on o.CustomerID = o.CustomerID
where
ci.StateProvinceName = @OrderState
and OrderDate between @OrderStartDate and @OrderEndDate
order by OrderDate'

/*exec dbo.sp_executesql @SQLString
N'@OrderState as Nvarchar(100),
@OrderStartDate as Date,
@OrderEndDate as Date',
@OrderState,
@OrderStartDate,
@OrderEndDate
go*/

exec dbo.sp_SampleOrderReport 'Georgia', '01.01.2013', '10.01.2013'

Ответить
Abdullah Quhtani
Abdullah Quhtani - 14.01.2023 11:47

Thank you very much. 👍🏼

Ответить