Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


sql server stored procedure logic problem


sql server stored procedure logic problem

Author
Message
asranantha
asranantha
SSC Veteran
SSC Veteran (216 reputation)SSC Veteran (216 reputation)SSC Veteran (216 reputation)SSC Veteran (216 reputation)SSC Veteran (216 reputation)SSC Veteran (216 reputation)SSC Veteran (216 reputation)SSC Veteran (216 reputation)

Group: General Forum Members
Points: 216 Visits: 4717
HI friends i have small doubt in sql server.plese tell me how to solve this issuse


i have 2 tables based on that i want load first table records into second table useing stored procedure. structure is same in both table
columns like id ,name,sal in both table same columns.



first table contains 1000 records .
when ever we insert this records into second table that time 501 record is failed.
when ever we load records what ever failed record that records must be showing errore message and remaing reords must be to load .
that means when ever we applaying try catach method in stored procedure to handle errore .first in try methode to appply logic
and catch metode is devlop errore message(501 records) once its catach errore.that errore is showing that records and remaing records(502 to 1000 records) to loaded in to
second table


plese tell me how to implement logic code in try catch block.
Stuart Davies
Stuart Davies
SSCarpal Tunnel
SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)

Group: General Forum Members
Points: 4485 Visits: 4549
What is the error you are getting?

Have you checked the file you are trying to load to make sure that there is nothing in there that causes the error - like a comma in a text field within a CSV file ?

How are you loading the data ?
do you have any scripts that are being used (see the first link in my signature below for supplying the information).
Is it possible to see the data - I appreciate that it might be company / individual sensitive so this won't be possible?

Might help if you read the second link in my signature - it's long but following the ideas there you might answer your own question when you try to rationalise the problem

-------------------------------
Posting Data Etiquette - Jeff Moden
Smart way to ask a question

There are naive questions, tedious questions, ill-phrased questions, questions put after inadequate self-criticism. But every question is a cry to understand (the world). There is no such thing as a dumb question. ― Carl Sagan
I would never join a club that would allow me as a member - Groucho Marx
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search