﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2008 / SQL Server Newbies  / Problem with a query - wrong update results / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Wed, 22 May 2013 17:11:08 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Problem with a query - wrong update results</title><link>http://www.sqlservercentral.com/Forums/Topic1426441-1292-1.aspx</link><description>I got it...thanks a lot!</description><pubDate>Wed, 06 Mar 2013 11:48:04 GMT</pubDate><dc:creator>montse 22199</dc:creator></item><item><title>RE: Problem with a query - wrong update results</title><link>http://www.sqlservercentral.com/Forums/Topic1426441-1292-1.aspx</link><description>Change your query to:[code="plain"]SELECT A.final_owner, tblUser.tName, A._owner_m, cast(A._owner_m as int), tblUser.aUserID, cast(tblUser.aUserID as int)FROM A INNER JOINtblUser ON cast(A._owner_m as int) = cast(tblUser.aUserID as int)[/code]And post the results.</description><pubDate>Tue, 05 Mar 2013 07:56:40 GMT</pubDate><dc:creator>ryan.mcatee</dc:creator></item><item><title>Problem with a query - wrong update results</title><link>http://www.sqlservercentral.com/Forums/Topic1426441-1292-1.aspx</link><description>Hello experts,I have 2 tables.One of the tables has the data I need to know which user input it. On the table I have a column name called owner_m, when I run the data import for some reason my sistem is bringing me instead of the user_names the id_user_numbers that is store in tbluser table.I need to update my data table with the users name and I have the following query for that:update Aset final_owner=tblUser.tNameFROM         A INNER JOINtblUser ON cast(A._owner_m as int) = cast(tblUser.aUserID as int)owner_m is a varchar and User id is an int. Thats why Im using the cast option.But for some reason the query is giving me the same user id for all the fields as follows:owner_m  tname19           Carol20           Carol28           Carol  instead of19           Carol       20           Rolando28           Estefania.Im asumming is because the data type and I already fix that with the cast function.I dont know what else to do, please help!!!  </description><pubDate>Mon, 04 Mar 2013 13:34:50 GMT</pubDate><dc:creator>montse 22199</dc:creator></item></channel></rss>