Skip to content

Instantly share code, notes, and snippets.

@omerkoseoglu
Created December 29, 2021 17:34
Show Gist options
  • Save omerkoseoglu/1b5946c3f1efbb10b19fa4033a7fd172 to your computer and use it in GitHub Desktop.
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?
--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