Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Express Edition and Compact Edition (2005)
 A record object

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-03-06 : 09:18:41
Doni writes "I am using SQL Server 2005 Express, VS 2005 VB.NET, on Windows XP.

Do I have too explicitly define very field in a record when I create a cursor?

Example:
declare rsMesurements scroll cursor for
select * from parametrics where startTime >= getdate()-1
for read only

This returns a thirty columns all of which are needed. This is a lot of variables to keep up with. Additionally, I need to scroll back and forth with makes this even more difficult to read.

Is there a way to declare a type the contains all the fields in the row of the cursor?

I want to fetch a record into a "record type". Then access each field as I need them."

mikewa
Microsoft SQL Server Product Team

84 Posts

Posted - 2006-03-22 : 15:02:01
From the perspective of SQL Server Cursors, I believe the answer is no, you don't have the explicitly define every field and yes, you should be able access your returned data by row or block of row. Check out the help on SQL Cursors at http://msdn2.microsoft.com/en-us/library/ms191179(SQL.90).aspx.

I also notice that you are using VB.NET 2005 and I'm wondering if you've looked into the variouls ways to access data thorugh ADO.NET. You can find out more about this at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconaccessingdatawithadonet.asp?frame=true if you're interested.

Regards,
Mike Wachal
SQL Express

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
Go to Top of Page
   

- Advertisement -