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
 User defined domains

Author  Topic 

babes_axa
Starting Member

4 Posts

Posted - 2008-09-05 : 07:41:30
Hello,

Can anyone please tell me how to define domains using Microsoft Mgmt Studio Express - or if it is at all possible.

Thanks alot.

MJ

blindman
Master Smack Fu Yak Hacker

2365 Posts

Posted - 2008-09-05 : 10:22:51
It's easy:
declare	@Domain varchar(50)
set @Domain = 'WTF if a Domain?'
print @Domain


Boycotted Beijing Olympics 2008
Go to Top of Page

preethi
Starting Member

11 Posts

Posted - 2008-09-06 : 13:53:44
quote:
Originally posted by babes_axa

Can anyone please tell me how to define domains using Microsoft Mgmt Studio Express - or if it is at all possible.




SQL Server is not a programming tool to define domains and namespaces in the same way a programming language may use. However, you can use schema for this purpose. Download AdventureWorks database and have a look. It has different schemas Sales, Production, Personal etc.

Hope this helps.

Cheers,
Preethiviraj Kulasingham
MCITP: DBA
Go to Top of Page

blindman
Master Smack Fu Yak Hacker

2365 Posts

Posted - 2008-09-07 : 12:38:46
He may be talking about the "domain" a column, which would be equivalent to a constraint.
Just can't tell from his post.

Boycotted Beijing Olympics 2008
Go to Top of Page

preethi
Starting Member

11 Posts

Posted - 2008-09-07 : 14:04:07
Blindman,
It is very hard for me to believe that you thought domain as a column.
As I joined recently, I am watching the topics and especially your answers. Recently I saw you went to the extent of saying "Those who invented CLR procedures should be shot" and someone here commented "Thank God he is [a] blindman"
I understand if you are frustrated with people who make silly mistakes and ask simple questions without doing basic search. But when you make whole lot of negative comments without giving any answer, it will not help anyone, including you, and even if you try to help someone, they may not listen. Tomorrow they may even walkout from the forum completely.

We need to understand and give an helping hand to those in need. Through this process we learn and grow. That is the reason I joined this forum. After helping them if you tell them what are the mistakes they have made, it is possible they will listen.

Dear friend, join with the right attitude, and you can make a big difference.

Just my two cents. I thought of sending you a private message, but I couldn't find the link. (As you know I am new to this forum.)

Cheers,
Preethiviraj Kulasingham
MCITP: DBA
Go to Top of Page

blindman
Master Smack Fu Yak Hacker

2365 Posts

Posted - 2008-09-07 : 17:00:50
quote:
Originally posted by preethiDear friend, join with the right attitude, and you can make a big difference.
Dear friend, I've been helping people on this and other forums for more than five years now and recieved many posts of thanks.

quote:
Originally posted by preethiIt is very hard for me to believe that you thought domain as a column.
Dear friend, it is hard for my to believe you are completely unfamliar with the mathematical concept of a domain, or think that such a concept could not be applied to columns (see http://en.wikipedia.org/wiki/Data_domain).

quote:
Originally posted by preethiAs I joined recently, I am watching the topics and especially your answers. Recently I saw you went to the extent of saying "Those who invented CLR procedures should be shot"
Dear friend, I gave that poster several good pieces of advice, for free, which he chose to ignore. The mess he makes of his project after that is his fault for not following my advice, not my fault for giving it.

quote:
Originally posted by preethiI understand if you are frustrated with people who make silly mistakes and ask simple questions without doing basic search.
Dear friend, I am only frustrated by people who expects clear concise answers without bothering to ask clear concise questions, and people who disregard the advice I give because it is not the answer they were hoping for.

Cheers

Boycotted Beijing Olympics 2008
Go to Top of Page

preethi
Starting Member

11 Posts

Posted - 2008-09-07 : 21:33:10
Dear Friend,

Thank you for the reply. I know that you have ansered a lot of posts, and my only conceern is in your recent posts, you have given a lot of negative thoughts.
This is what I follow: I give only a helping hand. I do not take ownership. The decision should be taken by the other party, and he/she is responsible for the decision taken as well. Even accepting and rejecting my choice is his/her choice. The next time when he comes with a problem, I may simply ignore the post, if I feel I can do little there.

Thanks you for sharing your thoughts. Hope you will continue to share your expertise with others.

Cheers,
Preethiviraj Kulasingham
MCITP: DBA
Go to Top of Page

jezemine
Master Smack Fu Yak Hacker

2886 Posts

Posted - 2008-09-07 : 21:44:35
perhaps the OP means something like what postgresql calls domains:

http://www.postgresql.org/docs/8.1/interactive/sql-createdomain.html

you could create that in SQL Server with a user defined datatype.


elsasoft.org
Go to Top of Page

babes_axa
Starting Member

4 Posts

Posted - 2008-09-09 : 05:32:02
quote:
Originally posted by babes_axa

Hello,

Can anyone please tell me how to define domains using Microsoft Mgmt Studio Express - or if it is at all possible.

Thanks alot.
MJ



Thanks everyone,

I really did mean a column constraint which is similar to data types but not exactly the same. For example, in MySQL domains can be defined as a range of values for a column...

Best,
Go to Top of Page

blindman
Master Smack Fu Yak Hacker

2365 Posts

Posted - 2008-09-09 : 09:15:14
You're welcome. Post again if you have any questions about how to implement constraints.

Boycotted Beijing Olympics 2008
Go to Top of Page
   

- Advertisement -