Search results

  1. R

    SQL Server 2005 - Enumeration

    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!
  2. R

    SQL 2005 Foreign Key on View

    Is it possible to establish a Foreign Key on a view?
  3. R

    collectionbase

    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...
  4. R

    Reference to Parent Object

    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...
  5. R

    For each loop

    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...
  6. R

    .Add to a derived class

    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...
  7. R

    Custom Class Equality

    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...
  8. R

    Triggers

    Anybody have a bit of SQL that will list the triggers on a table along with the trigger's name and the text of the trigger?
  9. R

    Enterpise Manager (Defaults)

    What is the Defaults section under the database used for?
  10. R

    Dynamic table name in UDF

    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?
  11. R

    Default Values using Stored Procedure

    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
  12. R

    MSQL - Timer

    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.
  13. R

    Trigger Question

    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.
  14. R

    sp_MSdependencies

    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...
  15. R

    Detect/Log Change

    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:
  16. R

    Constraint

    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 :)
  17. R

    SQL and external code

    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?
  18. R

    UDF - If then else syntax

    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...
  19. R

    GetDate within a UDF

    I am using MSSSQL 2000 and would like to know what the alternative is to using GetDate within a UDF?
  20. R

    Foreign Key / Relation

    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...
Top Bottom