UNIQUEIDENTIFIER Column

  • I'm using SQL Server 2000 with transactional replication and the column,msrepl_tran_version has beed added to my tables with a default of newid().

    When i attempt to perform an insert to the table without specifying a value for this column, i receive "Server: Msg 213, Level 16, State 4, Line 1

    Insert Error: Column name or number of supplied values does not match table definition. "

    The default does not appear to fire.

    Anyone have any ideas?

  • This sounds like you are doing something like the following...

    INSERT INTO Foo

    SELECT * FROM Blah

    But Blah and Foo don't have the same number of fields. Classic case of why you don't want to use *. And why you do want to explicitly define the fields you are inserting into.

    Gary Johnson

    Microsoft Natural Language Group

    DBA, Sr. DB Engineer




    Gary Johnson
    Microsoft Natural Language Group
    DBA, Sr. DB Engineer

    This posting is provided "AS IS" with no warranties, and confers no rights. The opinions expressed in this post are my own and may not reflect that of my employer.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply