sql-server-2008

Connecting to SQL Server Express in silverlight 4 appl, the db doesn't shows up in Management Studio Express

I'm using SQL Server Express named instance and LinqToSql in my Silverlight 4 application. The database located in the web application App_Data folder. I attached the db via VS2010. The connection string generated by the program automatically, after double clicked on the db file. When I load the solution, I get an error: "The connecti...

Why is Java app unable to open database when started via webstart/JNLP?

I've got an app that used to work fine against a SQL Server 2005 database. We upgraded to SQL Server 2008R2 and I had to update the JDBC driver in use. Oddly, since the update, it fails with a database connection timeout when started via web start/JNLP. Run from inside Netbeans, or from the CLI and it operates just fine. Problem exis...

ASP.NET Sql Provider

I got a problem. When i'm creating the new project in ASP.NET using VS 2010, it's web.config with a default connection string about SQL Express created. But i haven't even got SQL Express installed. What should i do to change the default AspNetSqlProvider to work with my instance of full-weight SQL Server as a services database? And how ...

sql: DELETE + INSERT vs UPDATE + INSERT

A similar question has been asked, but since it always depends, I'm asking for my specific situation separately. I have a web-site page that shows some data that comes from a database, and to generate the data from that database I have to do some fairly complex multiple joins queries. The data is being updated once a day (nightly). I ...

How update in a Multi Tenant app all schema of all tenants?

I am development a app multi tenant. I chose the approach Shared Database/ Separeted Schema. My idea is has a schema default (dbo) and when deploy this schema, do update schema of outhers tenants (tanantA, tenantB, tenantC). In other words, make sincronization schemas. How can sincronized this schemas of tenants with schema default? ...

SQL Server 2008 reports

Hi Is SQL Server 2008 reports works in adobe reader 5.1? How can i test that one? What is Microsoft report viewer? ...

What does SQL Server execution plan show?

There is the following code: declare @XmlData xml = '<Locations> <Location rid="1"/> </Locations>' declare @LocationList table (RID char(32)); insert into @LocationList(RID) select Location.RID.value('@rid','CHAR(32)') from @XmlData.nodes('/Locations/Location') Location(RID) insert into @LocationList(RID) select A2RID from tblCdbA2 ...

SQL Server 2008 Express one row write problem

Hi everyone, I have the most bizarre problem (at least it is bizarre to me) with SQL Server Express 2008. The problem is the following: On the development machine I use SQL Server 2008 Enterprise....I get some data from a WCF service and write that data to the database (simple as it can be)....I should point out however that the wr...

Why this doesn't work: [MySQL][ODBC 5.1 Driver]Access denied for user

So I know that there is a very similar question to this all over the web as well as stack overflow: http://stackoverflow.com/questions/2539961/error-access-denied-for-user-mysql-server but my question I think is different. So I have set up a linked server and it works...I have the correct permissions set up for my IP's that I am using....

SQL Server - Missing Indexes - What would use the index?

I am using SQL Server 2008 and we are using the DMV's to find missing indexes. However, before I create the new index I am trying to figure out what proc/query is wanting that index. I want the most information I can get so I can make informed decision on my indexes. Sometimes the indexes SQL Server wants does not make sense to me. ...

Step into Stored Proc gives "Canceled by User" in VS 2010 but works in VS 2008

I'm running a local instance of SQL 2008 standard on my workstation. Also have VS 2008 and VS 2010 installed on it. I've (for this test) disabled the Kaspersky AV and ensure windows firewall is off. When I debug a stored proc on my local SQL instance by right clicking and selecting "Step Into Stored Procedure" in VS 2008 it works. I ge...

Efficiently select top row for each category in the set

I need to select a top row for each category from a known set (somewhat similar to this question). The problem is, how to make this query efficient on the large number of rows. For example, let's create a table that stores temperature recording in several places. CREATE TABLE #t ( placeId int, ts datetime, temp int, PRI...

will such store procedure cause deadlock?

Hello everyone, I am using SQL Server 2008 Enterprise. I am wondering whether this store procedure cause deadlock if executed by multiple threads at the same time? Another question is -- is it best practices we define begin and end transaction inside store procedure, or defining begin and end transaction from client code (e.g. ADO.Net c...

Huge performance differences between connections

I was trying to test the performance difference between inserting into a table directly versus inserting into a view in a different database which points to the table. I was shocked to see that a WHILE loop with 10,000 inserts into a simple table took 3 seconds but against the view it took 30 seconds. As I investigated, I found that if ...

SQL Server 2008 - Document storage schema's

Hey, I'm looking to make a hopefully rather simple document storage system in sql 2008. We have a general idea of the elements we need, some meta data storage, filesteam, etc, but there are a few things we aren't quite sure of. Specifically, we would like to implement a fake folder structure, as well as some (flexible) permissions. P...

SQL Server 2008 error message from stored procedure

Hello everyone, I am using SQL Server 2008 Enterprise. When we met with such error message from stored procedure, Message 1205, Level 13, State 52, the process Pr_FooV2, Line 9 Services (Process ID 111) and another process is deadlock in the lock | communication buffer resources, and has been chosen as the deadlock victi...

foreign key and index issue

Hello everyone, I am using SQL Server 2008 Enterprise. I have a table and one of its column is referring to another column in another table (in the same database) as foreign key, here is the related SQL statement, in more details, column [AnotherID] in table [Foo] refers to another table [Goo]'s column [GID] as foreign key. [GID] is pri...

Why single SQL delete statement will cause deadlock?

Hello everyone, I am using SQL Server 2008 Enterprise. I am wondering why even a single delete statement of this stored procedure will cause deadlock if executed by multiple threads at the same time? For the delete statement, Param1 is a column of table FooTable, Param1 is a foreign key of another table (refers to another primary key c...

How to do bulk update of views?

My database has about 30 views, most of which have a reference to another database on this server (call it DB1). Now, without going into the reasons why, I need to update all those views to DB2, also on the local server. I would hate to have to do this manually on each view. Is there some SQL query I can run that will replace all occu...

Undo table updates in SQL Server 2008

I updated a table in my SQL Server 2008 by accident, I was updating a table from another by copying cell by cell, but I have overwritten the original table. Is there a way that I can restore my table contents as it was? ...