Click here to Skip to main content
15,887,485 members
Home / Discussions / Database
   

Database

 
AnswerRe: SCOPE_IDENTITY() Pin
WoutL25-Oct-07 1:45
WoutL25-Oct-07 1:45 
AnswerRe: SCOPE_IDENTITY() Pin
John-ph25-Oct-07 2:14
John-ph25-Oct-07 2:14 
Questionhelp!! phaleeezz!! error message: Plan dates are invalid (SQL 2000) Pin
anthoy24-Oct-07 23:33
anthoy24-Oct-07 23:33 
AnswerRe: help!! phaleeezz!! error message: Plan dates are invalid (SQL 2000) Pin
andyharman25-Oct-07 1:10
professionalandyharman25-Oct-07 1:10 
AnswerRe: help!! phaleeezz!! error message: Plan dates are invalid (SQL 2000) Pin
Illegal Operation25-Oct-07 1:12
Illegal Operation25-Oct-07 1:12 
AnswerRe: help!! phaleeezz!! error message: Plan dates are invalid (SQL 2000) Pin
GuyThiebaut25-Oct-07 3:43
professionalGuyThiebaut25-Oct-07 3:43 
GeneralRe: help!! phaleeezz!! error message: Plan dates are invalid (SQL 2000) Pin
anthoy25-Oct-07 14:46
anthoy25-Oct-07 14:46 
QuestionERROR_MESSAGE() & SQL2005 Pin
Graham_424-Oct-07 22:21
Graham_424-Oct-07 22:21 
I have a stored procedure that rebuilds the indexes on a clients database.
Useing a Try Catch block I write any errors to a cursor which report any errors
when the procedure has finished running.
<br />
WHILE @@fetch_status = 0<br />
    BEGIN<br />
	SET @SQL = 'ALTER TABLE '+@TableName+' ADD CONSTRAINT '+@ObjectName+' '+@Fields<br />
	BEGIN TRY<br />
	  EXEC (@SQL)<br />
	END TRY<br />
	BEGIN CATCH<br />
	  INSERT INTO ##NonCreate VALUES(' constraint ' + @ObjectName + ' on table ' + @TableName, ERROR_MESSAGE())<br />
	END CATCH<br />
  END<br />
  FETCH NEXT FROM cUniqueConstraintList INTO @TableName, @ObjectName, @Fields<br />
			<br />


The stored proceudre works fine and output any errors to the log.
However the message reported by ERROR_MESSAGE() is a bit less than
informative. "Could not create constraint. See previous errors."
Msg 2714, Level 16, State 4, Line 1
There is already an object named 'my_constraint_name' in the database.
Msg 1750, Level 16, State 0, Line 1
Could not create constraint. See previous errors.


My error log is given the Msg 1750 error, I would prefer it gave me the 2714 message, as this is more informative as to why the error has occured.

Does any one know of any way of returning the first message, or point
me in the right direction?
AnswerRe: ERROR_MESSAGE() & SQL2005 Pin
Sandeep Kumar24-Oct-07 22:54
Sandeep Kumar24-Oct-07 22:54 
GeneralRe: ERROR_MESSAGE() & SQL2005 Pin
Graham_424-Oct-07 23:02
Graham_424-Oct-07 23:02 
QuestionCount problem Pin
Nishad8524-Oct-07 18:31
Nishad8524-Oct-07 18:31 
AnswerRe: Count problem Pin
_Damian S_24-Oct-07 20:24
professional_Damian S_24-Oct-07 20:24 
Questionhow to know other users are connecting to my sql database Pin
skyleo_200824-Oct-07 17:06
skyleo_200824-Oct-07 17:06 
AnswerRe: how to know other users are connecting to my sql database Pin
N a v a n e e t h24-Oct-07 20:36
N a v a n e e t h24-Oct-07 20:36 
GeneralRe: how to know other users are connecting to my sql database Pin
skyleo_200824-Oct-07 22:04
skyleo_200824-Oct-07 22:04 
GeneralRe: how to know other users are connecting to my sql database Pin
N a v a n e e t h24-Oct-07 22:54
N a v a n e e t h24-Oct-07 22:54 
AnswerRe: how to know other users are connecting to my sql database Pin
John-ph25-Oct-07 3:08
John-ph25-Oct-07 3:08 
GeneralRe: how to know other users are connecting to my sql database Pin
skyleo_200825-Oct-07 15:01
skyleo_200825-Oct-07 15:01 
QuestionHow to create SQL function Pin
Yulianto.24-Oct-07 16:25
Yulianto.24-Oct-07 16:25 
AnswerRe: How to create SQL function Pin
Tirthadip24-Oct-07 21:04
Tirthadip24-Oct-07 21:04 
QuestionNewbie: round control buttons Pin
lee_hatcher24-Oct-07 14:48
lee_hatcher24-Oct-07 14:48 
AnswerRe: Newbie: round control buttons Pin
Paddy Boyd25-Oct-07 4:06
Paddy Boyd25-Oct-07 4:06 
GeneralRe: Newbie: round control buttons Pin
lee_hatcher25-Oct-07 5:06
lee_hatcher25-Oct-07 5:06 
GeneralRe: Newbie: round control buttons Pin
Paddy Boyd25-Oct-07 5:30
Paddy Boyd25-Oct-07 5:30 
GeneralRe: Newbie: round control buttons Pin
lee_hatcher25-Oct-07 5:39
lee_hatcher25-Oct-07 5:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.