Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8424175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T03:55:03+00:00 2026-06-10T03:55:03+00:00

SQL server Manager 2008. Ive recently changed a stored procedure to look at a

  • 0

SQL server Manager 2008.

Ive recently changed a stored procedure to look at a different table.

Since then I keep receiving the same error:

“Msg 245, Level 16, State 1, Line 1
Conversion failed when converting the varchar value ‘BC8018’ to data type int.”

Now I split my query down to the root to find where this problem occurs and sure enough its happening on the JOIN to my new table.

Now I compared the only field Im using in the table and both Pareto and NewPareto are ints.

Heres the code:

SELECT i.Acct,
   i.Name, 
   i.Document, 
   i.Part, 
   i.Qty, 
   i.Unit, 
   dbo.PeriodInsert.NewPareto,
   i.pg,
   i.[DateTime],
   i.BinSeqNo

FROM   
OPENQUERY(SACBAUTO, 'SELECT dbo.iHeads.acct,
                            dbo.iHeads.name,
                            dbo.iLines.Document,
                            dbo.iLines.Part,
                            dbo.iLines.Pg,
                            dbo.iLines.Qty,
                            dbo.iLines.unit,
                            dbo.iHeads.[DateTime], 
                            dbo.iLines.BinSeqNo 
                     FROM Autopart.dbo.iheads INNER JOIN Autopart.dbo.iLines ON 
                     Autopart.dbo.Iheads.document = autopart.dbo.iLines.document
                     WHERE dbo.iLines.Pg not in (''60'',''61'',''62'')

                      ') i
left JOIN
dbo.PeriodInsert
ON 
i.Part collate SQL_Latin1_General_CP1_CI_AS = dbo.PeriodInsert.NewPareto 
WHERE
 (i.[DateTime] BETWEEN '2012-03-01' AND '2012-08-23') AND
 i.Acct = '1557' 

Please remember this I a break down of the original stored procedure but this is where the root of it occurs. I find it strange, the Original table called NEWpareto using the field pareto is an int aswell.
Any thoughts why this thing has suddenly stopped working just because of a table?

If you require more info just let me know.

Many thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T03:55:04+00:00Added an answer on June 10, 2026 at 3:55 am

    dbo.iLines.Part is not an int – it has a collation – so if NewPareto is, then you are trying to convert it to an int to do the join. Search that field for “BC8018” and check it’s valid. If it is, then you will have to join i.Part to convert(nvarchar(...), dbo.PeriodInsert.NewPareto)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using SQL, SQL server manager 2008, c-sharp.net 4.0 and ms visual studio professional 2010:
I have a table in a database on my development(local workstation) SQL Server 2008
I recently installed SQL Server 2008 Express on my Windows 7 Ultimate x64 home
Using C#, .NET 4, SQL, visual studio 2010 and sql server manager 2008. Hi
Win/7 Professional SQL Server 2008 R2 Express Reporting Services Configuration Manager When I launch
In MS SQL Server Manager Studio for 2008 Express, the Included Columns field is
Short to the point: I am using SQL Server Manager 2008 R2. I have
Im using SQL Server manager 2008. I have a query as follows: SELECT dbo.iLines.Part,
When I create a new VARCHAR column in Microsoft SQL Server Manager Studio, it
When in 'SQL Server Configuration Manager' I see, under 'SQL Server Services', 2 items

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.