10
votes

Procédure de stockage Sélectionnez une variable

Comment puis-je compter le résultat d'une table et passer à une variable de procédure stockée?

DECLARE @totalrecs varchar
select count(id) from table1


0 commentaires

3 Réponses :


1
votes
select @totalrecs= count(id) from table1

0 commentaires

17
votes

J'aime ce xxx


0 commentaires

2
votes
DECLARE @totalCount Int
Select @totalCount = count(*) 
From table1

Exec sp_DoSomething @Var = @totalCount

0 commentaires