sql-server

Sql Server 2000: Return "true" or "false" based on any 1 of 25 columns being "true"

Hi, I have to create a query that checks across several different columns, and if any of them have a 1, I want to return true. Ideal output would be along the lines of: ID:55 Name:John Doe IsDealerType1:True IsDealerType2:True IsDealerType3:False IsDealerType4:False IsDealerType5:True The problem is, instead of those 5 dealer col...

Does SQL Server jump leaves when using a composite clustered index?

Consider the following composite clustered index: CREATE UNIQUE CLUSTERED INDEX ix_mytable ON mytable(a, b) Obviously, a separate index on b will make searching for a particular value of b faster. However, if a separate index on b is not employed, it seems to me that the composite index can still be used to find tuples with a particu...

Data in Sql Server should use Unicode?

I want to store English, French, German, Italian, and Spanish in a Sql Server 2005 database to be used with a .NET application. Can I get away with not using Unicode? Will there be any issues with these languages? ...

T-SQL - create partition function and scheme - SQL Server 2008

I am creating partition function and schemes. In SQL Server 2008, it only defines range partitioning and not list partitions. Dont we have list partitioning in SQL Server? I am using SQL Server 2008 Enterprise edition. ...

Converting non-unicode SQL Server data and stored procs to Unicode

I need to convert a non-unicode SQL Server 2005 database to a unicode based database. I have hundreds of stored procs and of course the data is stored in varchar. I know that I need to change all the data types to the unicode equivalent (varchar to nvarchar) but don't I have to change how the stored procs are written or will they conti...

CONTEXT_INFO() and CONVERT

In an attempt to build example code for this question, I ran into a problem with CONTEXT_INFO(). What I'm doing is converting an int to varbinary(128) so I can pass that to SET CONTEXT_INFO. I can convert the varbinary back to int before I do the SET, but after I SET and then GET, the CONVERT always returns zero even though the varbinar...

Do I need to install SQL Server 2008 SP1 on the management studio express?

Basic Question - I have installed SQL Server Express 2008 with integrated SP1. This is the database engine alone. I realise now that I also need the express studio in order to perform a few tasks. I have installed it, however I know that it was the original installer from before SP1 was released. I have tried it and it appears to work...

SQL Server Express CREATE DATABASE permission denied in database 'master'.

After I change the option as UserInstance="False", then the error starts to happen. Because I want to use full-text search, the option change is required. BUT, it stopped to work. Is there any way to make it work again? I'm running Application Pool as Network Service with full control. ...

Full Text Search Index Problem

I want to search product information using Full Text Search, I have used six table in search query but i faced below issue I want to use full text search in SQL Server 2005. So I am facing the problems which is as below. 1) I am using 6 tables. i) Product (ProductID primary key,Name,Description,Summary,ImageFileNameOverride) ii) M...

The request failed or the service did not respond in a timely fashion?

I have the following error while I connect to SQL Server 2008 Management Studio with Windows authentication. "The request failed or the service did not respond in a timely fashion. Consult the event log or other applicable error logs for details." Is anybody tell me why i am getting this error, whereas my SQL Server is running under n...

Help with SQL Server Log, Master and TempDB locations on specific array config

I have a quick question that is specific to the server setup we have available to us. We are getting ready to migrate our help desk to a new server, as well as convert a small ACT DB to the full version of SQL 2005 Standard (from SQL Expr.) Right now, we only have the following resources available to us as far as array configurations ...

How can i export table data with column name in text file in sql server 2005?

How can i export table data with column name in text file in sql server 2005? ...

data storage limitation issue

I face one problem, one column is i have taken as numeric(38,0) Data stored in this column is going out of range, means it is reach it's storage limitation. i have tried with also bigint , but facing same problem.i can not take it as varchar because i have to use in another calculation so at that time i must need to convert it from varc...

How to get web site user's Windows login name from stored procedure invoked through website

I have a web page that runs under an account named, WebUser (IIS runs under this account) Now the problem here is that, when the webpage is accessed by users (intranet), users are authenticated through Windows Authentication. The webpage calls a stored procedure, SaveClientInfo. When I was trying to get the user's name (say, User1) wh...

How to compare two column values which are comma separated values?

I have one table with specific columns, in that there is a column which contains comma separated values like test,exam,result,other. I will pass a string like result,sample,unknown,extras as a parameter to the stored procedure. and then I want to get the related records by checking each and every phrase in this string. For Example: T...

Select and merge rows in a table in SQL Stored procedure

Have a temp table with schema: ID | SeqNo | Name ID - Not unique SeqNo - Int (can be 1,2 or 3). Sort of ID+SeqNo as Primary key Name - Any text And sample data in the table like this 1 | 1 | RecordA 2 | 1 | RecordB 3 | 1 | RecordC 1 | 2 | RecordD 4 | 1 | RecordE 5 | 1 | RecordF 3 | 1 | RecordG Need to select from this ...

Is it possible to use SqlBulkCopy in SQL 2008 without permission 'db_datawriter' ?

I want to limit my database possible access ways to only using stored procedures. Everything works fine except System.Data.SqlClient.SqlBulkCopy. I'm using it only in one class for massive data import. Is it possible to avoid this problem? I tried to grant a right before calling SqlBulkCopy and remove it after: EXEC [db_mod].[sys].[sp...

howt to use .MDF file

work on SQL Server 2000.i have CustomerDetails_Data.MDF file .from this file i want to take all information on my database .How to do? ...

CheckPoint Vs DBCC Shrinkfile

i have million of records insertion and procession in a table. DB is in Full recovery Mode. when Any insert command and group by etc.. executed it filled off ldf file(of size 1mb) to (120 GB). Shld i use Checkpoint or Alter database set recovery simple and then shrinkfile etc. i think as i am inserting data ...

Mixing System.Transactions with SqlTransactions

I've been brushing up on my knowledge this evening, trying to overcome 4 years of bad programming practices because of the company I was working for. One of the things I've recently stumbled on was System.Transactions. After reading about them for the last few hours, I think I have an adequate understanding of how they work and why you w...