sql-server

Locking a SQL Server Database with PHP

I'm wanting extra security for a particular point in my web app. So I want to lock the database (SQL Server 2005). Any suggestions or is this even necessary with SQL Server? Edit on question: The query is failing silently with no errors messages logged, and does not occur inside of a transaction. Final Solution: I never was able to s...

SQL Server Management Studio Alternatives

I was wondering if there are any alternatives to Microsoft's SQL Server Management Studio? Not there's anything wrong with SSMS, but sometimes it just seem too big an application where all I want todo is browse/edit tables and run queries. ...

SQL Server 2008 FileStream on a Web Server

First of all, congrats to Jeff, Joel and the guys for getting this thing up and running! OK, I've been developing a site using ASP.NET MVC, and have decided to use the new SQL Server 2008 FILESTREAM facility to store files 'within' the database rather than as separate entities. While initially working within VS2008 (using a trusted conne...

Tables with no Primary Key

I have several tables whose only unique data is a uniqueidentifier (a Guid) column. Because guids are non-sequential (and they're client-side generated so I can't use newsequentialid()), I have made a non-primary, non-clustered index on this ID field rather than giving the tables a clustered primary key. I'm wondering what the performan...

User access log to SQL Server

Greetings all, I need to get a log of user access to our SQL Server so I can track average and peak concurrency usage. Is there a hidden table or something I'm missing that has this information for me? To my knowledge the application I'm looking at does not track this at the application level. I'm currently working on SQL Server 2000, ...

What is the best way to store connection string in .NET DLLs?

The application my team is currently developing has a DLL that is used to perform all database access. The application can not use a trusted connection because the database is behind a firewall and the domain server is not. So it appears that the connection string needs to have a DB username and password. The DLL currently has the dat...

Java + SQL Server - a viable solution?

I'm going to start a new project - rewriting an existing system (PHP + SQL Server) from scratch because of some very serious limitations by design. We have some quite good knowledge of SQL Server (currently we're using SQL Server 2000 in existing system) and we would like to employ its newer version (2008 I guess) in our new project. I...

Is there a way to create a SQL Server function to "join" multiple rows from a subquery into a single delimited field?

To illustrate, assume that I have two tables as follows: VehicleID Name 1 Chuck 2 Larry LocationID VehicleID City 1 1 New York 2 1 Seattle 3 1 Vancouver 4 2 Los Angeles 5 2 Houston I want to write a query to return the following resul...

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 t...

Dropping a group of tables in SQL Server

Is there a simple way to drop a group of interrelated tables in SQL Server? Ideally I'd like to avoid having to worry about what order they're being dropped in since I know the entire group will be gone by the end of the process. ...

SQL Server 2008 compatibility with SQL Server 2005

What is the best way to use SQL Server 2008 as a development database, but ensure that the database is compatible with SQL Server 2005? ...

Reorganise index vs Rebuild Index in Sql Server Maintenance plan

In the SSW rules to better SQL Server Database there is an example of a full database maintenance plan: SSW. In the example they run both a Reorganize Index and then a Rebuild Index and then Update Statistics. Is there any point to this? I thought Reorganize Index was a fast but less effective version of Rebuild Index? and that an index ...

Replicating between SqlServer 2005 and Compact Edition

Can it be done and how? ...

Connection Pooling in .NET/SQL Server?

Is it necessary or advantageous to write custom connection pooling code when developing applications in .NET with an SQL Server database? I know that ADO.NET gives you the option to enable/disable connection pooling -- does that mean that it's built into the framework and I don't need to worry about it? Why do people talk about writing...

Reading recommendations for: SQL Server 2005 Reporting Services

I have been shuffled around at work. Can anyone recommend a quick book/site to get me up to speed on SQL Server 2005 Reporting Services. Additionally; I have the following books available, a quick rating would be handy. Professional SQL Server 2005 Reporting Services by Paul Turley, Todd Bryant, James Counihan and Dave DuVarney...

How do you handle audit logging with SSRS?

I have some reports in SQL Server Reporting Services 2005 that I need to keep audit logs for. The audit log should include who ran what report with what parameters. I can't use Windows authentication. What is the best way to log this information? ...

Storing a file in a database as opposed to the file system?

Generally, how bad of a performance hit is storing a file in a database (specifically mssql) as opposed to the file system? I can't come up with a reason outside of application portability that I would want to store my files as varbinaries in SQL Server. ...

How do I get dbmail to process items from the queue for SQL Server 2005?

When I use the spsenddbmail stored procedure, I get a message saying that my mail was queued. However, it never seems to get delivered. I can see them in the queue if I run this SQL: SELECT * FROM msdb..sysmail_allitems WHERE sent_status = 'unsent' This SQL returns a 1: SELECT is_broker_enabled FROM sys.databases WHERE name = 'msdb' ...

ADO.NET Connection Pooling & SQLServer

What is it? How do I implement connection pooling with MS SQL? What are the performance ramifications when Executing many queries one-after-the other (i.e. using a loop with 30K+ iterations calling a stored procedure)? Executing a few queries that take a long time (10+ min)? Are there any best practices? ...

Using Parameters in MS Reporting Services (SQL 2008) against an ODBC data source

I writing a report in Visual Studio that takes a user input parameter and runs against an ODBC datasource. I would like to write the query manually and have reporting services replace part of the where clause with the parameter value before sending it to the database. What seems to be happening is that the @parmName I am assuming will be...