ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   I want to have my spreadsheet connect to SQL Server with variables...? (https://www.excelbanter.com/excel-programming/418996-i-want-have-my-spreadsheet-connect-sql-server-variables.html)

Kelvin[_2_]

I want to have my spreadsheet connect to SQL Server with variables...?
 
I have this Stored Procdure but don't know how to incorporate variables into
it.
I've added the declare statements and what I think the variables should be
and where I think they should go.
I have an example of the code for Excel, if I can just get these variables
to work....

Any help would be appreciated

Kelvin
++++++++++++++++++++++++++++++++++++++++++++++
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO

-- CREATE PROCEDURE [dbo].[CIT_SV_TechLaborByRo]
ALTER PROCEDURE [dbo].[CIT_SV_TechLaborByRo]

AS
BEGIN

DECLARE @RoNumber (this would be equal to the [SlsId])
DECLARE @TechID (this would equal [EmpIdLbr])

SELECT SVSLSITM.HrsActual
FROM SVSLSITM

WHERE [SVSLSITM].[SlsId]= @RoNumber
AND [SVSLSITM].[EmpIdLbr]= @TechID;

END
++++++++++++++++++++++++++++++++++++++++++++++



Heera

I want to have my spreadsheet connect to SQL Server withvariables...?
 

No one will be able to understand the code.

Paste the actual code.


All times are GMT +1. The time now is 11:24 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com