Author |
Topic |
marek
Starting Member
34 Posts |
Posted - 2011-06-03 : 14:20:09
|
Hallo boys...I have following problem. I want insert data from TabCompany to TabSalesManager, but column "autor" and percentage are default ("autor"=marek and percentage=0)ATTENTION! columns "autor", "percentage" not included TabCompany.TabcompanyNumCust....NumEmpl.....Branch.....dateTabSalesManagerNumCust....NumEmpl.....Branch.....date....autor....percentageMy syntax is not wokking:insert into TabSalesManager (NumCust, NumEmpl, autor default 'marek', branch, percentage default 80.00, date)select TabCompany (NumCust, NumEmpl, autor, branch, percentage, date)from TabCompanywhere /here is my condition that will do to select a dateI do not want add columns to Tabcompany,I am the reason why I have those 2 columns in TabSalesManager table... It must be so as I write.Big thanks all for help.....marek |
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2011-06-03 : 14:26:37
|
insert into TabSalesManager (NumCust, NumEmpl, autor, branch, percentage , date)select NumCust, NumEmpl, 'Marek', branch, 0, date from TabCompanyis how it would be done in Microsoft SQL ServerJimEveryday I learn something that somebody else already knew |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2011-06-03 : 14:27:25
|
I'm not sure where you came up with that syntax, but here's what it would be for T-SQL:insert into TabSalesManager (NumCust, NumEmpl, autor, branch, percentage, date)select NumCust, NumEmpl, 'marek', branch, 80.00, date)from TabCompanywhere ...Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/Subscribe to my blog |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2011-06-03 : 14:32:24
|
But the cool part is that we both pointed out that this is how it's done in SQL Server!JimEveryday I learn something that somebody else already knew |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
marek
Starting Member
34 Posts |
Posted - 2011-06-03 : 14:43:23
|
yes SQL server 2008ok..ok.....i will go try ok.. big thanks a total simple and I did not know |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
marek
Starting Member
34 Posts |
Posted - 2011-06-03 : 14:59:21
|
and photo? Why photo missing? my hobbies is oldtimers (veterans)ok you are mistress in SQL server 2008.....To my mind is SQL (studio,server2008) is best program for processing data.Why I dont have with SQL studio 2008 else Report builder 3.0 ?Report builder 3.0 is not automatically part (component) of SQL server 2008? |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
marek
Starting Member
34 Posts |
Posted - 2011-06-03 : 15:16:24
|
|
 |
|
|