Internal SQL Server error.
From: Hari (anonymous_at_discussions.microsoft.com)
Date: 11/05/04
- Previous message: jj: "Creating a Basic SQL Model (tutorial)"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 4 Nov 2004 18:35:21 -0800
am executing a sql stored procedure in which i have
written a cursor to loop and insert from a table into
another table.
when i execute it it says 'Internal SQL server error.'.
pls see the code below that i am exexuting. I am also
using linked servers.
it gives the error at line 'inserting'
I could't even find any KB article number to request
hotfix from microsoft, for this.
thank a lot.
Hari.
--****************code as below*******
Declare @ClntNO varchar(20)
DECLARE clntGrpCursor cursor for
select client_no from
LinkedServer.clientDB.cUserId.tb_vf_individual_client
where client_no not
in (select client_no from
LinkedServer.clientDB.cUserId.tb_risk_client_grp ) and
closing_date is null
union select client_no from
LinkedServer.clientDB.cUserId.tb_vf_corporate_client where
client_no not
in (select client_no from
LinkedServer.clientDB.cUserId.tb_risk_client_grp ) and
closing_date is null order by client_no
OPEN clntGrpCursor
Fetch next from clntGrpCursor into @ClntNO
while @@fetch_status = 0
Begin
insert into
LinkedServer.clientDB.cUserId.tb_risk_client_grp
(client_no, client_grp,
pdt_grp_no,intra_lots,inter_lots,inter_ratio, intra_ratio,
new_order_margin, order_size,
inter_max_position_ratio, intra_max_position_ratio,
excess, minimum_bal, Inter_Spread_Multi)
SELECT distinct @ClntNO,client_grp,
pdt_grp_no, intra_max_lots, inter_max_lots,
inter_grp_limit_ratio, intra_grp_limit_ratio,
new_order_margin, order_size,
inter_max_position_ratio, intra_max_position_ratio,0
excess,null min_bal,Inter_spread_Multi
FROM
LinkedServer.clientDB.cUserId.tb_risk_product_master where
client_grp='RET'
Fetch next from clntGrpCursor into @ClntNO
End
close clntGrpCursor
deallocate clntGrpCursor
- Previous message: jj: "Creating a Basic SQL Model (tutorial)"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|