Created
December 29, 2021 17:34
-
-
Save omerkoseoglu/1b5946c3f1efbb10b19fa4033a7fd172 to your computer and use it in GitHub Desktop.
İşlem bir satırda mı yoksa tüm satırlarda mı çalışsın?
This file contains hidden or 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
--CREATE TABLE Customers ( | |
-- Id INT IDENTITY(1,1) PRIMARY KEY, | |
-- CustomerName VARCHAR(50) NOT NULL | |
--) | |
--GO | |
--INSERT INTO Customers(CustomerName) | |
--VALUES ('Apple'), ('Microsoft'), ('Oracle'), ('IBM'), ('Dell') | |
/* | |
DataGrid'de bir satır seçiliyken; seçili satırda çalıştırdığımız bir store procedure olsun. | |
Çağrılacak SP tüm satırlarda mı yoksa seçili satırda mı çalışacak durumu gerekirse SP'nin | |
parametrelerini hazırlayan formda bir checkbox ile bu durumu yönebiliriz. | |
*/ | |
DECLARE @ShowAll BIT = 1 | |
DECLARE @CustomerId INT = 2 | |
SELECT C.Id, C.CustomerName | |
FROM Customers C | |
WHERE (C.Id = @CustomerId OR 1 = @ShowAll) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment