Hi Daniel,
That may be a wrong question to ask, but are you sure you need a cursor? Can you use table variable instead? Are you doing some processing with this cursor?
Also wondering why you're accessing the server by IP address.
>Hi All,
>
>I am trying to execute a stored procedure from SQL Server 2000 accessing data from SQL Server 2005 and getting the below listed error message when creating a cursor. I just upgraded one of the servers to SQL Server 2005.
>
>
>
>declare EmailCursor2 Cursor for
>select a.iEmailQueueID, a.iIpoId,
>LTrim(RTrim(a.cEmailTo)) as cEmailTo, a.iEmailTemplateID,
>c.cName as cEnteredBy,
> b.cCustno, b.cCompany,
>ISNULL(b.cContractNumber,'') as cContractNumber,
>ISNULL(b.cSalesOrderNumber,'') as cSalesOrderNumber,
> LEFT(ISNULL(b.dLiveDate,''),12) as dLiveDate
>from [172.16.1.10,1433].webforms.dbo.ipo_emailQueue a
> join [172.16.1.10,1433].webforms.dbo.ipo b on a.iIpoId = b.iIpoId
> join [172.16.1.10,1433].webforms.dbo.lookup_userCreate c on a.cEnteredBy = c.cUserName
>where a.lStatus = 0
>
>
>Server: Msg 8180, Level 16, State 1, Line 11
>Statement(s) could not be prepared.
>Server: Msg 102, Level 15, State 1, Line 11
>Incorrect syntax near 'c'.
>Server: Msg 1018, Level 15, State 1, Line 11
>Incorrect syntax near 'FASTFIRSTROW'. If this is intended as a part of a table hint, A WITH keyword and parenthesis are now required. See SQL Server Books Online for proper syntax.
>Remote tables are not updatable. Updatable keyset-driven cursors on remote tables require a transaction with the REPEATABLE_READ or SERIALIZABLE isolation level spanning the cursor.
>
>
>Thank you,
>Daniel
If it's not broken, fix it until it is.
My Blog