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
 Update value Insert

Author  Topic 

Vack
Aged Yak Warrior

530 Posts

Posted - 2008-09-11 : 16:00:53
Can I set a value during the insert of a record?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-09-11 : 16:01:57
Yes. Show us an example of what you mean and we'll help you write it.

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

Subscribe to my blog
Go to Top of Page

Vack
Aged Yak Warrior

530 Posts

Posted - 2008-09-11 : 16:05:01
insert into gbnkmut
(account, cus_no, item)
select
order.account,
cus.cus_no,
...

we want to set "XYZ" as the value for item_no
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-09-11 : 16:06:36
insert into gbnkmut(account, cus_no, item)
select
order.account,
cus.cus_no,
'XYZ',
...
FROM ...

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

Subscribe to my blog
Go to Top of Page
   

- Advertisement -