Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void InactiveCustomers(IEnumerable<Guid> customerIDs)
- {
- //...
- myAdoCommand.CommandText =
- "UPDATE Customer SET Active = 0 WHERE CustomerID in (@CustomerIDs)";
- myAdoCommand.Parameters["@CustomerIDs"].Value = customerIDs;
- //...
- }
- CREATE PROCEDURE SelectByIdList(@productIds xml) AS
- DECLARE @Products TABLE (ID int)
- INSERT INTO @Products (ID) SELECT ParamValues.ID.value('.','VARCHAR(20)')
- FROM @productIds.nodes('/Products/id') as ParamValues(ID)
- SELECT * FROM
- Products
- INNER JOIN
- @Products p
- ON Products.ProductID = p.ID
- Create procedure usp_DeactivateCustomers
- @inactive varchar(50) /*or whatever values are required to identify inactive customers*/
- AS
- UPDATE Customer SET c.Active = 0
- FROM Customer c JOIN tableB b ON c.CustomerID = b.CustomerID
- WHERE b.someField = @inactive
- public void InactiveCustomers(string inactive)
- {
- //...
- myAdoCommand.CommandText =
- "usp_DeactivateCustomers";
- myAdoCommand.Parameters["@inactive"].Value = inactive;
- //...
- }
Add Comment
Please, Sign In to add comment