Friday, February 17, 2012

Creating Defaults using Column Names

Hello to everyone,
Please help me on how to Create Defaults using Column Names.
I also don't how to use computed column names. If the latter is the answer.
Please help.
Thanks> Please help me on how to Create Defaults using Column Names.
> I also don't how to use computed column names. If the latter is the
> answer.
> Please help.
If you tell us **what** you want to do (not **how**), we might be able to
suggest something.|||Have you read this, yet?
http://msdn.microsoft.com/library/d... />
2_8g9x.asp
Based on your post I'm not quite sure what you need, so here goes:
To add a default constraint after the table has been created:
alter table <table>
add constraint <default name>
default (<default expression> )
for <column>
[with values]
To add a computed column after the table has been created:
alter table <table>
add <computed column> as (<expression> )
Does this come close to your expectations?
ML
http://milambda.blogspot.com/|||ML wrote:
>Have you read this, yet
>http://msdn.microsoft.com/library/d.../>
e2_8g9x.asp
>Based on your post I'm not quite sure what you need, so here goes:
>To add a default constraint after the table has been created:
>alter table <table>
> add constraint <default name>
> default (<default expression> )
> for <column>
> [with values]
>To add a computed column after the table has been created:
>alter table <table>
> add <computed column> as (<expression> )
>Does this come close to your expectations?
>ML
>--
>http://milambda.blogspot.com/
Hi to all,
When we voucher, we need to default Distribution date column based on
invoice date column.
For example: Our invoice date is 01/31/06 then our Distribution date field
should also be 01/31/06. In order to avoid mistake in manually inputting the
Distribution date then I think we might as well default the Invoice to
Distribution date using SQL script.
However whenever I am checking Default function, it seems it only allows
constant values.
Please help.
I really love this website amongst others. You can understand inquirers here
as not a technical person so you really explained it very well. Thanks so
much and good day to everyone!
Message posted via http://www.webservertalk.com|||minda wrote:
>[quoted text clipped - 20 lines]
>Hi to all,
>When we voucher, we need to default Distribution date column based on
>invoice date column.
>For example: Our invoice date is 01/31/06 then our Distribution date field
>should also be 01/31/06. In order to avoid mistake in manually inputting th
e
>Distribution date then I think we might as well default the Invoice to
>Distribution date using SQL script.
>However whenever I am checking Default function, it seems it only allows
>constant values.
>Please help.
>I really love this website amongst others. You can understand inquirers her
e
>as not a technical person so you really explained it very well. Thanks so
>much and good day to everyone!
Please help. Thank you in advance for your time.
Message posted via webservertalk.com
http://www.webservertalk.com/Uwe/Forum...amming/200602/1|||minda wrote:
>[quoted text clipped - 20 lines]
>Please help. Thank you in advance for your time.
Can someone help me on this matter? Please let me know if you need further
data. Thanks again.
Message posted via webservertalk.com
http://www.webservertalk.com/Uwe/Forum...amming/200602/1|||So what you want to do is set a default value based on the value in another
column?
"minda" <u18464@.uwe> wrote in message news:5b7ba24bb8e97@.uwe...
> Hello to everyone,
> Please help me on how to Create Defaults using Column Names.
> I also don't how to use computed column names. If the latter is the
answer.
> Please help.
> Thanks|||Jim Underwood wrote:
>So what you want to do is set a default value based on the value in another
>column?
>
>[quoted text clipped - 3 lines]
Yes, abosolutely. Thanks for understanding. Please help.
Message posted via http://www.webservertalk.com|||minda wrote:
>[quoted text clipped - 4 lines]
>Yes, abosolutely. Thanks for understanding. Please help.
Is my question very hard? I am sorry for taking your time. Thanks again.
Message posted via webservertalk.com
http://www.webservertalk.com/Uwe/Forum...amming/200602/1|||The question is not hard, just that we didn't understand what you wanted.
You may want to use a trigger for this, rather than using the default value
setting in EM. I haven't done much with triggers myself, so I'll let
someone else speak to the best way to go about it.
"minda via webservertalk.com" <u18464@.uwe> wrote in message
news:5b9e170dee63f@.uwe...
> minda wrote:
another
>
> Is my question very hard? I am sorry for taking your time. Thanks again.
> --
> Message posted via webservertalk.com
> http://www.webservertalk.com/Uwe/Forum...amming/200602/1

No comments:

Post a Comment