rowcount in a view

Results 1 to 2 of 2

Thread: rowcount in a view

  1. #1
    Join Date
    Dec 1969

    Default rowcount in a view

    I have several views and need a row count to show up at the bottom. I tried @@rowcount and get a syntax error. Does anyone know the correct syntax for this. I&#039;m running on SQL 6.5<BR><BR>Or any other way to get the row count of the view&#039;s result set, not the tables used in the view.<BR><BR>Here is one of the many view&#039;s I need to apply this to:<BR><BR>CREATE VIEW dbo.dw1viewWKLY <BR>AS<BR>SELECT <BR>tblOffices.ProviderID,<BR>tblOffices.OfficeMan ager,<BR>tblOffices.TaxID,<BR>tblOffices.Address1, <BR>tblOffices.Address2,<BR>tblOffices.City,<BR>tb lOffices.State,<BR>tblOffices.ZipCode,<BR>case <BR>when tblOffices.PrimaryAddress =1 then<BR> Convert(char(1),"Y")<BR>else Convert(char(1),"N")<BR>end <BR>as PrimaryAddress,<BR>case <BR>when tblOffices.MailingAddress =1 then<BR> Convert(char(1),"Y")<BR>else Convert(char(1),"N")<BR>end<BR>as MailingAddress,<BR>tblOffices.Phone,<BR>tlkpGroupS ite.sitename<BR>FROM (tblOffices LEFT JOIN tlkpGroupSite ON<BR>tblOffices.SiteID = tlkpGroupSite.SiteID) INNER JOIN indandservprov ON<BR>tblOffices.ProviderID = indandservprov.ProviderID<BR>Group by<BR>tblOffices.ProviderID,<BR>tblOffices.OfficeM anager,<BR>tblOffices.TaxID,<BR>tblOffices.Address 1,<BR>tblOffices.Address2,<BR>tblOffices.City,<BR> tblOffices.State,<BR>tblOffices.ZipCode,<BR>case <BR>when tblOffices.PrimaryAddress =1 then<BR> Convert(char(1),"Y")<BR>else Convert(char(1),"N")<BR>end,<BR>case <BR>when tblOffices.MailingAddress =1 then<BR> Convert(char(1),"Y")<BR>else Convert(char(1),"N")<BR>end,<BR>tblOffices.Phone,< BR>tlkpgroupsite.sitename

  2. #2
    Join Date
    Dec 1969

    Default RE: rowcount in a view

    Why not just do it on the asp page<BR><BR>MyArray = RS.GetRows<BR><BR>MyCount = UBound(MyArray,2) + 1

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts