Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

sql server stored procedure logic problem Expand / Collapse
Author
Message
Posted Thursday, March 7, 2013 2:02 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Friday, September 12, 2014 2:11 AM
Points: 211, Visits: 4,540
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.
Post #1427835
Posted Thursday, March 7, 2013 3:11 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Thursday, September 18, 2014 3:20 AM
Points: 3,060, Visits: 3,283
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
Post #1427865
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse