sql-server

Is it possible to see what queries have been run in an uncommitted transaction?

My application (C++ using SQL Native Client with SQL Server 2000) is consistently finding its way into a hanging state. I believe this is because a transaction is left uncommitted someplace on a table and a SELECT query on that table, as a result of the open transaction, is blocking. Unfortunately, I'm really having trouble determining...

Rename a sql server instance

Hi, Is it possible to change a sql server instance name? Or is it something that can only be set during installation? ...

What is the best way to use SQL Server Analysis Services data in a line of business application?

We'd like to see if we can get some improved performance for analysis and reporting by moving some of our key data into Analysis Services cubes. However, I haven't been able to find much in the way of good client front ends. Our users have Office 2003. The move to 2007 is probably at least a year out and the Analysis Services add-in fo...

How can I see where the tab stops are in the SQL Server Management Studio editor?

I dictate SQL using speech recognition, and lining things up is a pain. If I could see where the tab stops are it would save me a lot of time. ...

Maintaining subclass integrity in a relational database

Let's say I have a table that represents a super class, students. And then I have N tables that represent subclasses of that object (athletes, musicians, etc). How can I express a constraint such that a student must be modeled in one (not more, not less) subclass? Clarifications regarding comments: This is being maintained manually, n...

BizSpark deployment license hosting

I have signed up with BizSpark and it is a great deal, especially for people like myself in perennial startup mode. As part of BizSpark you get 3 year deployment licenses for software such as Windows Server and SQL Server. Is there any dedicated hosting companies that will allow you to use these licenses without having to pay for license...

separate table for picture items with image field

I store different items (notes, articles, pictures, files) in a single table (there are many metadata in common for all the item types - for example, categories, tags, rating, statistics etc.). My first design was like this: table Items, plus another "detail" table for each of the item types (NoteItems, ArticleItems, PictureItems etc.)....

sql search query for multiple optional parameters

I'm trying to write a query for an advanced search page on my document archiving system. I'm attempting to search by multiple optional parameters. I have about 5 parameters that could be empty strings or search strings. I know I shouldn't have to check for each as a string or empty and create a separate stored procedure for each combi...

How to use a view name stored in a field for an sql query ?

I have a table with a view_name field (varchar(256)) and I would like to use that field in an sql query. Example : TABLE university_members id | type | view_name | count 1 | professors | view_professors | 0 2 | students | view_students2 | 0 3 | staff | view_staff4 | 0 And I would like to update all rows with some aggregate calcula...

How to convert fields into rows through SQL in MS Access 2007 or MS SQL Server 2005

I have a legacy MS Access 2007 table that contains 52 fields (1 field for each week of the year) representing historical sales data (plus one field for the year actually). I would like to convert this database into a more conventional Time/Value listing. Does anyone knows how to do that without writing queries with 52+ explicit paramete...

SQL Server Alerts - Best Practices

What SQL Server Alerts do you always setup for every database? What do you always monitor regardless of the database? ...

Create a DDL trigger in every database on a 2005 instance

I need to create a trigger in every database on my sql 2005 instance. I'm setting up some auditing ddl triggers. I create a cursor with all database names and try to execute a USE statement. This doesn't seem to change the database - the CREATE TRIGGER statement just fires in adventureworks repeatedly. The other option would be to pr...

Configuring SQL Native Client ODBC on the client computer?

We have an application where our clients are connecting to a SQL Server 2005 database - via a SQL Native Client ODBC data source. We are having some difficulties with the ODBC connection getting severed during program execution. After questioning a tech support person, he said that he had seen this type of error before, but they fixed th...

Mass Insert Into Sql Server

I am attempting to insert a mass of records into SQL Server 2005 from Vb.Net. Although the insertion is working fine, I am doing my best to try to make it as fast as possible. Currently, it takes ~ 11 mins for 100,000 records. What would be the suggested approach to inserting a large number of records into SQL Server from an Applicati...

Restrict Number of Records in SSIS Package

I have a table with 7M records I want to trim down to 10k for dev. I tried a delete, but the whole world was nearly overpowered by the transaction log size, so I truncated the table. Now I wish to insert 10k records from the original table, into my dev table, but it has a identity column, and many, many other columns, so I'd thought I'...

Using SQL Server as Image store

Is SQL Server 2008 a good option to use as an image store for an e-commerce website? It would be used to store product images of various sizes and angles. A web server would output those images, reading the table by a clustered ID. The total image size would be around 10 GB, but will need to scale. I see a lot of benefits over using the ...

Create a Search Engine with SQL 2000 and ASP.NET C#

I am looking to create a search engine that will be based on 5 columns in a SQL 2000 DB. I have looked into Lucene.NET and read the documentation on it, but wondering if anyone has any previous experience with this? Thanks ...

How can I synchronize views and stored procedures between SQL Server databases?

I have a 'reference' SQL Server 2005 database that is used as our global standard. We're all set up for keeping general table schema and data properly synchronized, but don't yet have a good solution for other objects like views, stored procedures, and user-defined functions. I'm aware of products like Redgate's SQL Compare, but we don'...

What is the limitation in the length of an SqlCommand query

Is there a limitation in the length of a query that SQL Server can handle? I have a normal SqlCommand object and pass a very long select statement as a string. The query seems to be fine when running against an SQL Server 2005/2008 engine but doesn't execute against an SQL Server 2000 engine. I don't have any error details as I only...

How to pass parameters to Table Valued Function

I want to do something like Select * from tvfHello(@param) where @param in (Select ID from Users) ...