in the trigger for update and insert i have the following cursor
declare crs cursor static local for
SELECT [id] FROM inserted
open crs
fetch next from crs into @.v1
print @.@.fetch_status
while @.@.fetch_status = 0
begin
print @.v1
fetch next from crs into @.v1
end
close crs
deallocate crs
the problem is that the @.@.fetch_status is now always -1 and I'm pretty sure that it worked some time ago and i can't figure what is changed.
any ideas ?
thnx.Why would you want to do this? What's the real trigger look like?
Can you post that code?
A cursor in a trigger would more than likely perform poorly...|||I use cursor in trigger cause i can have inserts/updates from multiple sources and i don't want to break the logic.
code in attach|||fixed.
cursor threshold was 0; changed to -1
Showing posts with label static. Show all posts
Showing posts with label static. Show all posts
Tuesday, March 27, 2012
@@fetch_status in trigger
Tuesday, March 20, 2012
::Conection
Hi All,
I Have a SQL Server run in a computer that run Windows 2003 and have one
static ip.
This computer also have a NAT with basic firewall to distribute internet.
In my home I have one computer withWindows XP that I want acess SQL.
When I disable basic firewall, I can conect, but if firewall is on I can't.
My question: what port I need open to connect in my sql?
I know that I need use SQL account.
ThanksDefault installations of SQL Server monitor TCP port 1433, but the port
doesn't need to be 1433. A named instance of SQL Server 2000 will listen a
dynamic port by default. This port should be changed to a fixed port prior
to configuring the firewall. You can refer to this article for more
information:
287932 INF: TCP Ports Needed for Communication to SQL Server Through a
Firewall
http://support.microsoft.com/?id=287932
HTH!
Sincerely,
William Wang
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
This posting is provided "AS IS" with no warranties, and confers no rights.
I Have a SQL Server run in a computer that run Windows 2003 and have one
static ip.
This computer also have a NAT with basic firewall to distribute internet.
In my home I have one computer withWindows XP that I want acess SQL.
When I disable basic firewall, I can conect, but if firewall is on I can't.
My question: what port I need open to connect in my sql?
I know that I need use SQL account.
ThanksDefault installations of SQL Server monitor TCP port 1433, but the port
doesn't need to be 1433. A named instance of SQL Server 2000 will listen a
dynamic port by default. This port should be changed to a fixed port prior
to configuring the firewall. You can refer to this article for more
information:
287932 INF: TCP Ports Needed for Communication to SQL Server Through a
Firewall
http://support.microsoft.com/?id=287932
HTH!
Sincerely,
William Wang
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
This posting is provided "AS IS" with no warranties, and confers no rights.
Subscribe to:
Posts (Atom)