Is there a way I can improve this kind of SQL query performance: INSERT INTO … WHERE NOT EXISTS(Validation…) The problem is when I have many data in my table (like million of rows), the …
Tag: sql-server
efficient way to implement paging
Should I use LINQ’s Skip() and Take() method for paging, or implement my own paging with a SQL query? Which is most efficient? Why would I choose one over the other? I’m using SQL Server 2008, ASP.NET MVC and LINQ. Answer Trying to give you a brief answer to your doubt, if you execute the skip(n).take(m) methods on linq (with
How can I list all foreign keys referencing a given table in SQL Server?
I need to remove a highly referenced table in a SQL Server database. How can I get a list of all the foreign key constraints I will need to remove in order to drop the table? (SQL answers preferable over clicking about in the GUI of the management studio.) Answer Not sure why no one suggested but I use sp_fkeys
Is it possible to execute a stored procedure over a set without using a cursor?
I would like to execute a stored procedure over each row in a set without using a cursor with something like this: SELECT EXEC dbo.Sproc @Param1 = Table1.id FROM Table1 I am using T-SQL in SQL Server 2005. I think this might be possible using a function, but I’d like to use a stored procedure if possible (company standards) Answer
Simulating group_concat MySQL function in Microsoft SQL Server 2005?
I’m trying to migrate a MySQL-based app over to Microsoft SQL Server 2005 (not by choice, but that’s life). In the original app, we used almost entirely ANSI-SQL compliant statements, with one …
Is a view faster than a simple query?
Is a faster than the query itself to create the view (in order to have the same resultSet): ? It’s not totally clear to me if the view uses some sort of caching making it faster compared to a simple query. Answer Yes, views can have a clustered index assigned and, when they do, they’ll store temporary results that can
How do you import a large MS SQL .sql file?
I use RedGate SQL data compare and generated a .sql file, so I could run it on my local machine. But the problem is that the file is over 300mb, which means I can’t do copy and paste because the …
Are there Free SQL Server Mgmt Studio Autocomplete Add-ins? [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations. Closed 14 days ago. Improve this question I know Red Gate has such a product, but I’d rather
SQL – Temp Table: Storing all columns in temp table versus only Primary key
I would need to create a temp table for paging purposes. I would be selecting all records into a temp table and then do further processing with it. I am wondering which of the following is a better approach: 1) Select all the columns of my Primary Table into the Temp Table and then being able to select the rows
Table Naming Dilemma: Singular vs. Plural Names [closed]
Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 8 years ago. Improve this question Academia has it that table names should be the singular of the entity that they store attributes of. I dislike any