sql-server-2008

Is there a way to display PRINT results with SQL server JDBC driver?

If my stored procedure has a print statement inside it: print 'message' Is there a way to fetch the output in java program that connects to SQL Server 2008 through JDBC? Also, is there a danger that print messages left for debugging would shutdown connection when called from JDBC application? ...

Is there a SQL Server 2008 method to group rows in a table so as to behave as a nested table?

This could turn out to be the dumbest question ever. I want to track groups and group members via SQL. Let's say I have 3 groups and 6 people. I could have a table such as: Then if I wanted to have find which personIDs are in groupID 1, I would just do select * from Table where GroupID=1 (Everyone knows that) My problem is I h...

SQL Recursive Menu Sorting

I've got a simple table that I'm using to represent a hierarchy of categories. CREATE TABLE [dbo].[Categories]( [ID] [int] IDENTITY(1,1) NOT NULL, [Title] [varchar](256) NOT NULL, [ParentID] [int] NOT NULL, CONSTRAINT [PK_Categories] PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP...

indexing pros cons in sql server 2008

I am working on social networking site. now our team decide to store user profile in denormalized manner. so our table structure is like this here attribute it means one fields for user profile e.g. Firstname,LastName,BirthDate etc... and groups means name of a group of fields e.g. Personal Details, Academic Info, Achievements etc.. *...

How many characters in varchar(max)

How many characters can a SQL Server 2008 database field contain when the data type is VARCHAR(MAX)? Thanks guys, helped me out a lot :) ...

Reporting Services - get data into subreports

I'm tasked with reporting on survey data using Reporting Services 2008. My challenge is this: a survey has any number of questions a question is one of three types (a numerical eval, a yes/no question, or a free text) To handle this, I decided to use subreports on my main report, e.g. I defined one report for each of the three que...

select query in sql server 2008

I have two tables create table tblchildinfo (id int, name varchar(50), pickuppointid int, dropdownpointid int) and create table tblpoint(pointid int, PointName varchar(50)) So I have primary table tblpoint and child table as tblchildinfo and i want to write a statement such that i will get child id, child name, pickuppointID...

How best to do a partial text match in SQL Server 2008

I've a large (1TB) table in SQL Server 2008 that looks something like this: ID int | Flag BIT | Notes NTEXT I need to search every row and set the Flag bit to 1 where Notes contains the word flip Is UPDATE Table SET Flag = 1 WHERE Notes LIKE '%flip%' the 'best' way to do it? I'm thinking that this could take days to run on such a...

Business Intelligence Development Studio 2008 installation

I'm feeling like a bit of a moron, but I can't find how to install Business Intelligence Development Studio 2008. I have 2005 currently, but need to upgrade for some features. I'm pretty sure that it's included with SQL Server 2008 Standard, but I guess I could be wrong. Is it included? and if so, where do I find the install for it? ...

Has anyone used Classic ASP with SQL Server 2008 and it's new FileStream feature?

I'm getting ready to use SQL Server 2008's FileStream capability but I'm not sure if Classic ASP can read and write from SQL 2008 FileStream. We still have an old application we'd like to update to support File Uploads to database and would like to consider FileStream. If needed I can build a COM object via .NET to handle this but would...

SQL Server 2005 user prioritization

I currently have a SQL Server 2005 database that is accessed by multiple users. Is it possible to have SQL give processing priority to specific users based on their login names? ie, if Alice and Bob are both running queries simultaneously, I want to ensure that Bob is given priority over Alice. ...

Change case of a column name

I have a table in my warehouse that has columns in all uppercase. It scripts out like this: CREATE TABLE [dbo].[Outlet]( [OUTLET_KEY] [varchar](10) NOT NULL, [OUTLET] [varchar](8) NULL, [CITY_CODE] [varchar](4) NULL, [OUTLET_NAME] [varchar](25) NULL, [COUNTRY_CODE] [varchar](3) NULL, [EXTENDED_CATEGORY_CODE] [var...

Monitoring dashboard for IIS and SQL Server

We have developed a .NET web application that uses SQL Server as a backend. Now we would like to provide a monitoring dashboard app for the tech support team. The idea is that this monitoring app will show a global picture of the "health" of the web servers hosting the application and the database servers holding the data. This "health" ...

Does Covering Index Duplicate Data?

Suppose we have this index CREATE INDEX IX_test ON t1(c1) INCLUDE (c2) Does this mean that we will have c2 in both index page and the actual data page? The real question is - does updating c2 mean that SQL Server will have to update IX_test and the actual data row (clustered index)? ...

Migrating from SQL Server 2000 to SQL Server 2008

I need to migrate SQL Server 2000 databases to SQL Server 2008 and need to formalize a generic strategy for this migration. Need a ordered list of activities which should be done to achieve this. ...

Create db user with limited privileges

I have to create a sql 2008 database user that can backup and restore databases but NOT execute INSERT, UPDATE, DELETE. Is it possible or the two operations are incompatible? ...

SQL: Deleting duplicate records in SQL Server

hi! I have an sql server database, that I pre-loaded with a ton of rows of data. Unfortunately, there is no primary key in the database, and there is now duplicate information in the table. I'm not concerned about there not being a primary key, but i am concerned about there being duplicates in the database... Any thoughts? (Forgive...

SQL Server 2000 vs SQL Server 2008 Query Performance

I'm working with a client who had a SQL Server 2008 converted from a SQL Server 2000 DB and one of the queries has quite dramatically increased in time since it was on SQL Server 2000. However, if I change the compatibility level to 2008 in the DB, the query goes like a rocket (40-50 times faster). The query does use a number of UDFs. ...

Transactions in .Net 2.0 application-- what to use?

Hi everyone, I'm working on a .Net 2.0 application and need to wrap some database transactions in my code. The backend is SQL Server 2008. I've been away from .net for a few years, the last time I did any transaction processing was in .Net 1.1 with serviced components. I know about TransactionScope, and was wondering if that's a good...

Reporting Services Install/Uninstall Fails "Input String..."

I have done my best to install a copy of SQL Server 2008, but have discovered my "Reporting Services" installation has failed. Furthermore, when I attempt to "repair" both the installation (and the "Shared Components" only, per a work-around I found here, will update with link if I find it) I have no had any success, as the SQL Server 2...