Last active
October 17, 2019 14:42
-
-
Save lvdamaceno/766e3097fe1262cd12ee73bc1064676b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @PARCEIRO INT | |
DECLARE @NRONOTA INT | |
DECLARE @PRODUTO INT | |
SET @PARCEIRO = 248755 | |
SET @NRONOTA = 25276 | |
SET @PRODUTO = 125286 | |
SELECT AD_EMPRESASAIDA | |
FROM TGFITE | |
WHERE NUNOTA IN (SELECT NUNOTA | |
FROM TGFCAB | |
WHERE CODPARC=@PARCEIRO | |
AND NUMNOTA=@NRONOTA | |
AND CODTIPOPER IN (1101,1112,1160,1161)) | |
AND CODPROD = @PRODUTO | |
--UPDATE TGFITE | |
-- SET AD_EMPRESASAIDA = 2 | |
-- WHERE NUNOTA IN (SELECT NUNOTA | |
-- FROM TGFCAB | |
-- WHERE CODPARC=@PARCEIRO | |
-- AND NUMNOTA=@NRONOTA | |
-- AND CODTIPOPER IN (1101,1112,1160,1161)) | |
-- AND CODPROD = @PRODUTO | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Transformar em um função