Is is possible to have an enumeration of valid values for a column/field?
For example -
If I needed a field that could only be one of:
Red
Green
Blue
without creating another table and limiting by using a foreign key.
Thanks in advance!
I am working on a strongly typed collection using collectionbase
When I change a property of an item in the collection (such as item.name) I want to validate it against the collection so as to prevent duplicate property values.
Similar to the way when you change the name of a datatable that...
Ok, got my collection working (finally) ....
So I think I am going fine, but I need another bread crumb.
I would liek to make a property of an item that points back to its parent such as can be done with the datatable.row as below in the debug.writeline statement.
Dim dt As New...
I have the following strongly typed class...
I would like to use a for... each loop to iterate through collections.... Is that possible.
Public Class Tags
Inherits CollectionBase
Default Public Property item(ByVal index As Integer) As Tag
Get
Return...
I have a class that has within it subclasses...
I am trying to implement a collection of those subclasses as a property of the top most class such that I can utilize a .add() type funcation.
such as follows:
dim dt as datatable
dt.rows.add(dt.newrow)
I would like to use this strucature with...
I have an array of a custom class that I have written.
I have attempted to do an indexof to check for equality (i.e. is there a copy of the class already assigned to the array.)
Array.IndexOf doesn't seem to work, and if I check for direct equality then I do not get what I would expect there...
I am atemptting the following
select @tstint = max(field) from @table
@table is passed in the UDF paramaters
I get the following: Must declare the variable '@table'.
What gives?
I have output from a stored procedure that I desperately need to use as the default value of a column...
I cannot seem to write the sp as a UDF due to the use of a temporary table and 'exec sp_executesql as follows:
insert into #Foo exec sp_executesql @statement=@SQLQuery
Please help
Is it possible to set things up so that a specific UDF or SP will run at a specified interval.
I don't want it to start automatically when the server starts, but to run in an endless loop (at interval) once trigged until the server is stopped.
Is it possible to change the value of an inserted item from within an insert trigger?
Such as
inserted.[field] = 1
There are several reasons, but one of them is to replace a value with a default if the value doesn't meet a FK Constraint so as to allow the insert to happen.
I am attempting to use the sp sp_MSdependencies to determine the order in which I can appy additions of new items,functions, views etc to a database...
The problem is that when I try top create items in the order the query returns there are dependency issues...
Any reliable way to return the...
I have a trigger based auditing scheme in place, but I would like to log changes to structure (not just data)..
i.e. if someone renames a column, table, etc. ??
Is there a way to do such a thing :cool:
I have a table in which the user enters a table name and a column name.
I would like to add a constraint that would only accept valid combinations of table and fields but don't seem to be able to use a subselect in a constraint
I am using MSSQL 2000.
Please help :)
I have an an api that accesses an external time keeping device that I would like to use as a default value in an SQL Table column.
I know that I cannot do it directly, but is there a way to write an SQL function/stored proceedure that can retreive a value from an external API?
Nothing like try to script/code in something that you haven't ever done prior to put you in your place :(
I am having trouble getting a if then else structure in a UDF -
CREATE function aw_GetShiftDate (@excavator varchar(20),@datetime datetime )
returns datetime
as
begin
Declare...
Is it possible to create a Foreign key on part of a field in MSSQL?
i have a field that is a delimited list of values contained in another table that i would like to establish a relation...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.