Tag: database

Does running a SQL Server 2005 database in compatibility level 80 have a negative impact on performance?

Our software must be able to run on SQL Server 2000 and 2005. To simplify development, we’re running our SQL Server 2005 databases in compatibility level 80. However, database performance seems slower on SQL 2005 than on SQL 2000 in some cases (we have not confirmed this using benchmarks yet). Would upgrading the compatibility level […]

Is there a limit to how long a SQL query can be in SQL Server?

Possible Duplicate: Maximum size for a SQL Server Query? IN clause? Is there a Better Approach I Googled for a while and can’t find whether there’s some hard limit on how huge query strings can be in SQL Server. I mean what if I build a 100 million character query – will it run or […]

SQL Server database change workflow best practices

The Background My group has 4 SQL Server Databases: Production UAT Test Dev I work in the Dev environment. When the time comes to promote the objects I’ve been working on (tables, views, functions, stored procs) I make a request of my manager, who promotes to Test. After testing, she submits a request to an […]

What are the problems with a join between two tables in two different databases?

I am interested in your thoughts about the the pitfalls of joining two or more tables from different databases. I’ll try to give an example. Suppose table Table1 is located in DatabaseA database and Table2 is located in DatabaseB . Let’s say i have a view, in DatabaseA that pulls out some data from Table1, […]

Find a value and shows me database,table,column,primary key of the found value

Consider have a table like named : People | Id | Name | Code | | 1 | John | 857 | | 2 | Mike | 893 | | 3 | Sara | 935 | this table is in PeopleDb Table. The question is : I want to find ‘Mike’ keyword. Situation : I […]

String concatenation operator in Oracle, Postgres and SQL Server

Is there a way to have a common operator for concatenation in Oracle, Postgres and SQL Server. In Oracle we uses ‘|’, postgres uses ‘||’ and sql server uses ‘+’. I’ve solved the problem in postgres by adding the custom operator ‘+’ to support string concatenation. Is there a way to add the same operator […]

Transaction count after EXECUTE indicates a mismatching number of BEGIN and COMMIT statements. Previous count

I am getting this exception about commits and rollbacks but am not sure what exactly is wrong with my Stored Procedure. I have read the answers in other such questions and am unable to find where exactly the commit count is getting messed up. So, this is the Stored Procedure I use: — this is […]

Database design : preferred field length for file paths

I have to store file paths in a DB field (/tmp/aaa/bbb, C:\temp\xxx\yyy, etc.). I can’t really tell how long they could be. Given this http://en.wikipedia.org/wiki/Comparison_of_file_systems and that http://msdn.microsoft.com/en-us/library/aa365247.aspx, depending on the file system there could be theoretically no length limit for a path. I guess that defining this field as a LONGBLOB or VARCHAR(very high […]

Entity Framework Algorithm For Combining Data

This pertains to a project I am inheriting and cannot change table structure or data access model. I have been asked to optimize the algorithm being used to insert data into the database. We have a dataset in table T. From that, we pull a set we will call A. We also query an XML […]

Track connection leaks

We have an app which seems to have connection leaks (SQL Server says that the max pool size have been reached). I am alone on my dev machine (obviously), and just by navigating the app, I trigger this error. The SQL Server Activity monitor shows a great number of processes using my database. I want […]

MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.