Click here to Skip to main content
15,886,860 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a SQL table in which I have columns like BusKey, Joddate, TableName, QueryID, KeyValue, KeyName in which only keyvalue column is the one which I hace to insert 171 different values rest colum will have same values . How can I do that? I tried to use join but didnot work.

What I have tried:

I tried to use join but not working
Posted
Updated 6-Jul-21 1:52am
Comments
Maciej Los 6-Jul-21 7:43am    
Details, please!!!
CHill60 6-Jul-21 8:26am    
You have said that you must do this via an insert. We can probably help with that but we need more information.
Where are you getting the 171 different values from?
And show the join that you tried

1 solution

The easiest way is to set a default value for the column: SQL DEFAULT Constraint[^]
If you do that, then you only need to INSERT the one column value and all the others will get the default - but you can override that by providing a value .
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900