• autoexcrement (4/22/2013)


    Maybe it's just an SSMS problem then. I didn't have any trouble creating the table and the default via SQL:

    CREATE TABLE testfunc (checkdate datetime)

    ALTER TABLE [dbo].[testfunc] ADD CONSTRAINT [DF_testfunc_checkdate] DEFAULT (dbo.fn_get_pst_datetime(DEFAULT)) FOR [checkdate]

    GO

    But if I then try to open the table in "design" mode via SSMS, I get that severe server error.

    Why do you want to open this in design mode? Honestly design mode should rarely be used, if at all. It is easier and faster to modify your tables using t-sql. That being said I don't see anything wrong with your table or function that would cause those types of errors.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/