New answers tagged insert
On your tables/columns have you tried creating an index? If so what is the fragmentation level of the index(s)
You shouldn't be surprised that a load takes longer when there's more resource usage. However, there's probably a simple explanation for your poor performance. I would examine the following: The INSERT with UNION ALLs is highly suspicious. Is the load more than 100MB? If yes, use COPY. Are the projections optimized for load? Is the query profiled and no ...
Sure you get an error. If for example sifra is S then the sifra <> 'P' will cause the error to appear. Change the OR into AND.
This is my version of the cross-reference table where you'll store users and the categories they are members of. Notice there is a primary key clustered index on (UserID, CategoryID); this ensures each row is unique: CREATE TABLE dbo.XREFUserCategories ( UserID INT NOT NULL CONSTRAINT FK_XREFUserCategories_UserID FOREIGN KEY ...
opinion based answers are not the most popular here, try to give evidence when possible. Well, that is not entirely fair given that ultimately, the "evidence" for what works the best will come from your system ;-). Your hardware, your data, your system load, etc will determine what works the best. There are a lot of variables in both how to approach ...
Top 50 recent answers are included