Skip to content

Count query

sri

Asked Jan 28, 2013, 12:17 AM EST1 answer
Share
LinkedInX
how to store the count query result in a variable?

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • Ankur
    0
    Hi Sri,

    assuming your query is about SQL query(if not please let me know):

    declare @Count int = 0
    set @Count = (Select COUNT(ColumnName) from TableName)
    print @Count

    Hope that helps.
    Thanks..
    0