Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Simulating multiple tables
Message
 
 
General information
Forum:
Microsoft SQL Server
Category:
Database design
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01410856
Message ID:
01410906
Views:
36
>>Exactly - I was going to tell that it's not going to work this way because of multiple inserts possibility.
>>
>>But would this work?
>>
>>    INSERT INTO ProductFileData
>>    (ProductFileColumnId,ProductFileRowId,ProductFileId)
>>    SELECT INSERTED.Id,NewID(),INSERTED.ProductFileId
>>    FROM INSERTED INNER JOIN ProductFileData ON ProductFileData.ProductFileId = INSERTED.ProductFileId
>>
>>Or why not let ProductFileRowID field to have default NewID() and then you don't need to include it in insert?
>
>Actually what I posted above is complete rubbish. The ProductFileRowId has to be based on existing unique values for existing rows.
>Using NEWID() is completely wrong. Using a default would be worse because all the rows would have different Ids. Let me try again....

Can you post the problem definition again with the table creation scripts and some data?
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform