.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Imran Ghani
Post New Web Links

Declaring a foreign key to a column of 'formula' datatype

Posted By:      Posted Date: April 10, 2011    Points: 0   Category :
 
I have a primary key declared as 'Computed'. Trying to relate a foreign key to this column in the Database Diagram, it complains on data types being different. Declaring the Foreign key as nvarchar or varchar did not help. When declaring it as 'Computed', column was not available for selection as a foreign key. Any advice?
Baruch Barness



View Complete Post


More Related Resource Links

Datetime column with [Computed column specification] formula

  
i have a datetime field in my SQL Server table i dont want to add weekend dates in this column. For this reason i always have to check the calendar. how can i use [Computed column specification] formula so that i never add weekend dates?

Using equal operator in transact-SQL for ntext datatype column

  
Hi, I've a problem with using equal operator in transact-SQL for ntext datatype column. (SQL Server 2000) I'm using the following SQL command text. use NorthwindSelect * from Categorieswhere Description ='Seaweed and fish' If I use 'like' operator intead of '=' then the qurey retuns correct value. Any idea about this? Any help is appreciated. Regards, Julia

What can be the datatype for a column having records as weblinks?

  
Hi, i am trying to insert records in a column having records as weblinks but it gives me following error. --------------------- Msg 128, Level 15, State 1, Line 2 The name "www.yahoo.com" is not permitted in this context. Valid expressions are constants, constant expressions, and (in some contexts) variables. Column names are not permitted. -------------------------------- NOTE : i have tried nvarchar(2083) but still giving me the same error. but if i try insert something like http://yahoo.com i get ERROR : incorrect syntax near 'http:'-   

how to get datatype a column in sqlserver ?

  
hi all I want have datatype a field in sqlserver how to get it with (T-sql) thank you

Caculated column formula for Workdays between two dates ? Excluding weekends? DateDiff

  
This gives me the number of days between two days.. great=DATEDIF([Completed],[Issued],"D")is there any way to exclude weekends?

formula validation setting on column sharepoint 2010

  
Hi, Hi,  I have a two fields(mailid,cost,mailid2), i need a list validation of mailIds if already existing  mails three time I need a validation for new request , i need a formula for column in validation setting ->formula in SP2010  if mail is already existing validation  i need formula for validation setting for list it's new feature in sharepoint 2010 Regards

Lookup column uses ID instead of Title in rule formula

  
I have two SP lists: Partner and Request. Partner just has a Partner Name column, plus the ID column. In Request, I have a lookup column pointing to the Partner list. There is also a Title column and a Request Date column. When I set up the lookup I set it to get info from the Partner list’s Partner Name column, not the ID column.   I made an InfoPath form to make a new Request, with the Partner being selected from a Drop-Down List Box. When this form is submitted, I would like to change the Title field to be a string concatenation of Partner Name, a comma, and the Request Date. I made a rule to do this. Example of what I want: “Partner A, 8/27/2010”.  However, the result is that the Partner ID is used instead of the Partner Name and what I get is “1, 8/27/2010”.   (More: In production I would use the Form Submit rule to do this. For development I used a rule that runs when the field changes. If I change the Drop-Down List Box properties Value property (on the data tab) from d:ID to d:Title the string is formatted as desired, but the form won’t submit and shows a tooltip that only positive integers are allowed.)   How can I make the rule use the Partner Name column in the formula for the rule, instead of the ID?   Thank you, James.

Caculated column formula for user name Compare

  
Hi , i  have a formula in sharepoint 2010 (form library->validation setting-> formula $ userdefine message)  example : =username =<"2" user messge  your request is already existing ,,, i have  1fields that user name but i need formula for is user already existing two time we did not allow  3 time i am using of validation setting and formula in sp2010 Regards Raju

how to retrieve various date format from datetime datatype column

  

first table

Area_code (varchar)    Loan_date (datetime)

USA                             9/21/2009  12:00:00 AM

CAN                            10/22/2010  12:00:00 AM

ARG                            12/23/2009 12:00:00 AM

Second table

Area_code (varchar)    Date_format(varchar)

USA                             dd/mm/yy

CAN                             yy.d.m

ARG                            yy'?'d'?'m'?'

I want to add Loan_date column in second t

how to retrieve various date format from datetime datatype column

  

first table

Area_code (varchar)    Loan_date (datetime)

USA                             9/21/2009  12:00:00 AM

CAN                            10/22/2010  12:00:00 AM

ARG                            12/23/2009 12:00:00 AM

Second table

Area_code (varchar)    Date_format(varchar)

USA                             dd/mm/yy

CAN                             yy.d.m

ARG                            yy'?'d'?'m'?'

I want to add Loan_date column in second table and nee

disable foreign key link depending on column value in the current row using Attributes

  

Hi ,

I want to disable  some foreign key links depending on column value in the current row

I am trying to have attribute like this :


[Disablelink("True","OrderDate","==","null"] 

 public partial class Order
    {

        internal sealed class OrderMetadata
        {
          
            [Disablelink("True","OrderDate","==","null"]
            public EntityCollection<Order_Detail> Order_Details { get; set; }

            public Nullable<DateTime> OrderDate { get; set; }

          

         }
        }
    }


I had a look at Mr. Steve code for row highlighting , Conditional UIHint

http://csharpbits.notaclue.net/2010/07/conditional-row-highlighting-in-

get database column datatype from metadata

  

Is there a way to get the database column DataType length information given a table's EntityType by sql query?

 

Example like: varchar(MAX), nvarchar(255),decimal(16, 4) .....

 

I need that query for documentation purpose.


Meng Chew

ODBC API to retrieve User-Defined DataType of a Column in a ResultSet ?

  

Hi,

ODBC APIs such as SQLDescribeCol(), SQLColAttribute() could be used to retrieve SQLDataType of a particular column in a ResultSet.

Similarly, Is there any ODBC API which could be used to retrieve User-Defined DataType of a particular column in a ResultSet?

-Vengatesh

 


Dropping a foreign key column in replication

  

I have set up transactional replication. I want to drop one column which acts as a foreign key in one of the tables in publisher. If I drop that column, will that drop be reflected in the subscriber??? BTW, can I drop that column without any issues?? If not, what are the steps to be followed for dropping that column?? Can some one please help me.....


multiple foreign keys to same table and same column

  

I am working with two Tables. Table A contains Id, Names. Table B  keeps only the reference to table A by InventoryID1, InventoryID12, InventoryID3.

Table A
-----------
InventoryID
Name
Price

Table B
---------
MenuID
Name
InventoryID1
InventoryID2
InventoryID3

I need a select statement to pull up all items from table B, showing the InventoryID 1, 2, 3 by their corresponding Name on Table A  

At first I thought this would be a simple inner join statement, which it does work when only InventoryID1 is involved
 
select * from Inventory
inner join Menu On (Inventory.InventoryId1 = Menu.Inventory)

The problem arises when I try to obtain the Inventory Name from Table A for the second or third (InventoryID2 or InventoryID3) from Table B. So basically, my problem is how to request a second or third Inventory.Name in the same select statement


Calculate Ageing using Formula Column

  

Hi,

What I'm after is to create an ageing column that displays the number of days that a document has been in our library.  We've eliminated the whole calulated column thing because it's not dynamic. Where we've arrived now is to create a List View and are using SharePoint designer to create a calculated column. We get to the point where we open up the XPath expression builder an we're trying different syntax, but can't seem to get it figured out.  We have a column that exists called DateDumped that we just want to know the number of days since that date based on todays date. Any suggestion on the syntax or any other ideas would be greatle appreciated.

Thanks in advance.

Andre


Today's date Sharepoint column formula

  
How do I access the today's date in a column formula in Sharpoint List.  The TODAY function doesn't work in calculated columns values.
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend