Skip to content
Advertisement

I’m getting the OleDb exception ‘Unspecified error the scale is Invalid’ when trying to use a stored procedure

I made a stored procedure in SQLExpress to insert information in both the Header and Details table. I’ve ran the stored procedure in SQL Server Management Studio to make sure it works fine.

But when I try to use the stored procedure using TableAdapters in visual studio it gives me the error: System.Data.OleDb.OleDbException: ‘Unspecified error The scale is invalid.’

Here is the code fore calling the stored procedure:

Here is the code for the stored procedure:

AS BEGIN — SET NOCOUNT ON added to prevent extra result sets from — interfering with SELECT statements. SET NOCOUNT ON;

Advertisement

Answer

Changing the Parameter ProviderType in the Data Set from DBTimeStamp to DBDate seems to have removed the problem.

I think that the DBTimeStamp can’t be passed into the datetime variable in SQL.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement