Red Gate forums :: View topic - Raising errors in pre-scripts to abort the generation proces
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Data Generator 1
SQL Data Generator 1 forum

Raising errors in pre-scripts to abort the generation proces

Search in SQL Data Generator 1 forum
Post new topic   Reply to topic
Jump to:  
Author Message
screek



Joined: 01 Oct 2008
Posts: 3

PostPosted: Wed Oct 01, 2008 3:07 pm    Post subject: Raising errors in pre-scripts to abort the generation proces Reply with quote

Hi,

Is it possible to raise errors in the pre-scripts that will abort the generation process?

I've tried using RAISERROR but the text is just printed in the generation report.

Thanks,

Steve
Back to top
View user's profile Send private message
benhall



Joined: 14 Dec 2007
Posts: 98

PostPosted: Thu Oct 02, 2008 11:14 am    Post subject: Reply with quote

Hi Steve,

It all depends on the severify level of your error. If you raise your between between 11 and 16 then we will stop generation. Any errors below are just information, as such we output the error but continue.

You can find out more information on MSDN - http://msdn.microsoft.com/en-us/library/aa937483(SQL.80).aspx


For example, this will stop generation:
RAISERROR('Stop Generation',12,1)

Where as, this will just output a message:
RAISERROR('This is just some information',1,1)

I hope this helps.

Thanks

Ben
Back to top
View user's profile Send private message
screek



Joined: 01 Oct 2008
Posts: 3

PostPosted: Thu Oct 02, 2008 11:27 am    Post subject: Reply with quote

Great, that works exactly as I wanted it to.

Thanks for your help.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group