Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Noobie Update Question

Author  Topic 

munkdogg
Yak Posting Veteran

53 Posts

Posted - 2008-06-04 : 15:33:35
nil

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-06-04 : 15:49:59
To make your issue more clear, could you post a data example showing us what it looks like before the update runs, what it looks like when you run the update, and what it should look like if the update was correct?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Database maintenance routines:
http://weblogs.sqlteam.com/tarad/archive/2004/07/02/1705.aspx
Go to Top of Page

munkdogg
Yak Posting Veteran

53 Posts

Posted - 2008-06-04 : 16:03:41
nil
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-06-04 : 16:05:14
How do you know which row to update since the data has nothing in common (at least what you've posted)?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Database maintenance routines:
http://weblogs.sqlteam.com/tarad/archive/2004/07/02/1705.aspx
Go to Top of Page

munkdogg
Yak Posting Veteran

53 Posts

Posted - 2008-06-05 : 09:55:15
nil
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-06-05 : 12:46:17
Please post a better data example then.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Database maintenance routines:
http://weblogs.sqlteam.com/tarad/archive/2004/07/02/1705.aspx
Go to Top of Page

munkdogg
Yak Posting Veteran

53 Posts

Posted - 2008-06-06 : 09:50:16
nil
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-06-06 : 09:56:23
quote:
Originally posted by munkdogg

I apologize if the example is not clear - but the scenario in question is complex.

In a nutshell, I am trying to determine the correct syntax for an update statement that includes several concatenated columns (from separate tables) and multiple join statements.

Is there a reference point for just such a function?


You need to specify whts the relation between those tables like in your above example how do you decide that values 98765,XYZ Company & Transaction2 are to be concatenated together?
Go to Top of Page

munkdogg
Yak Posting Veteran

53 Posts

Posted - 2008-06-06 : 10:01:15
nil
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-06-06 : 10:19:49
quote:
Originally posted by munkdogg

quote:
Originally posted by visakh16

quote:
Originally posted by munkdogg

I apologize if the example is not clear - but the scenario in question is complex.

In a nutshell, I am trying to determine the correct syntax for an update statement that includes several concatenated columns (from separate tables) and multiple join statements.

Is there a reference point for just such a function?


You need to specify whts the relation between those tables like in your above example how do you decide that values 98765,XYZ Company & Transaction2 are to be concatenated together?



That is simply the naming convention of the data contained therein.

Part of this problem is the above noted tables all share a FK relationship to a separate table from the one being updated. ie - AccountNumber, CustomerName and AccountName all have a FK relation to the dbo.DocumentTable, which in turn has a FK relation to dbo.WorkArea.


UPDATE wa
wa.column1=CAST(pt.AccountNumber AS varchar(10))+ '-' + ct.CustomerName + '<re>' + pt.AccountName
FROM WorkArea wa
INNER JOIN DocumentTable dt
ON dt.linkCol=wa.linkCol
INNER JOIN PersonTable pt
ON pt.linkCol=dt.linkCol
INNER JOIN CustomerTable ct
ON ct.linkCol=dt.linkCol
INNER JOIN UpdateFlag uf
ON uf.linkCol=dt.linkCol
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-06-06 : 12:57:03
munkdogg, in regards to the email you sent me:

I provide free help in these forums. If you'd like help outside of the forums, I would charge for that.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Database maintenance routines:
http://weblogs.sqlteam.com/tarad/archive/2004/07/02/1705.aspx
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2008-06-06 : 15:34:31
Looks like we have another post eraser.

I've never understood why people do that. Are they embarrassed by their question? Do they think that they are getting back at us for failing to answer their question?






CODO ERGO SUM
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-06-06 : 15:44:34
I guess these kinds of people should be banned from using this site.
Go to Top of Page

munkdogg
Yak Posting Veteran

53 Posts

Posted - 2008-06-06 : 19:40:36
quote:
Originally posted by sodeep

I guess these kinds of people should be banned from using this site.


  • obviously my attmpts the explain this issue were unclear
  • regardless, thanks to all who read & who contributed quality responses to this thread
  • the original topic subject remains, and a simplified rendition of my question appears

  • like its the only sql resource on the internet?
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-06-06 : 20:40:10
I mean why in the heck of world you have to delete/edit the post so people can't see? you must be embarrassed by your question as michael has said. You have posted in "New to SQL server Forum" so it doesn't matter what kind of question you post coz you are new and everyone knows you can't be expert in every field.

My question is :
Do you think somebody will gain knowledge by looking at your answer and that's why you delete/edit?
If its yes then, it's really Cheap.
Remember! the more you share , the more you gain. I am sure you must be doing this in every forum.

like its the only sql resource on the internet?
It your choice. We don't drag you to come here.
quote:
Originally posted by munkdogg

quote:
Originally posted by sodeep

I guess these kinds of people should be banned from using this site.


  • obviously my attmpts the explain this issue were unclear
  • regardless, thanks to all who read & who contributed quality responses to this thread
  • the original topic subject remains, and a simplified rendition of my question appears

  • like its the only sql resource on the internet?


Go to Top of Page
   

- Advertisement -