sql-server-2005

How i can create full index search on multi column pk

I need create full index search on table with multi columns as pk ...

sql server 2005 installation on vista, COM+ error

How to Work Around COM+ System Configuration Check Failure in SQL Server Setup? ...

Problem when changing context (impersonation) and using a server link in SQL Server 2005

I get a strange behaviour when I combine impersonation with database links in SQL Server 2005. First, I connect to a database server using simple SQL Server Authentication with Login 'John'. On this server, a server link remote_sqlserver is defined. I already have SELECT privileges for mydb in this server. When I simply query a table on ...

How do i add a column to a fact table 'after' it is already deployed and populated?

Hi Guys I have a SQL Server 2005 data-mart star schema with the usual fact and dimensions tables. This is deployed and being populated via an SSIS based ETL package. All fine so far. I have just been approached by the customer with a new requirement. Never, I hear you say! This requirement will mean I need to add a new dimension table ...

Select Count(*) over large amount of data

Hello i want to do this for a Report but i have 20,000,000 of records in my table and it causes an TimeOut in my application. SELECT T.transactionStatusID, TS.shortName AS TransactionStatusDefShortName, count(*) AS qtyTransactions FROM Transactions T INNER JOIN TransactionTypesCurrencies TTC ON T.id_Ent = TTC.id_Ent ...

Trying to initialize 2 values in 2 variables using 1 query, is it possible to do this. ?

SET @Password = ( SELECT UserPassword,IsLocked FROM [Authentication].[tblLogin] WHERE UserName=@UserName) i m trying to get both values userpassword and islocked in two variables to be used in same SP in next query. Is it possible or do i have to write two queries for this. Is it there a concept of arrays in sql server ...

Any idea why contains(...) querys so slow in SQL Server 2005

I've got a simple select query which executes in under 1 second normally, but when I add in a contains(column, 'text') into the where clause, suddenly it's running for 20 seconds up to a minute. The table it's selecting from has around 208k rows. Any ideas what would cause this query to run so slow with just the addition of the contains...

Using a variable from Foreach Loop Container in a SQL Task [SSIS]

Ok, I have a simple process... Read a table and get the rows that have a "StatusID" of 1. Simple. Select ProductID from PreorderStatus where StatusID = 1 Foreach row returned from that query, perform an action. For simplicity sake, let's just modify the original table to set the "StatusID" to 2. Update PreorderStatus set StatusID =...

Adding Windows account to SQL Server

Hi Friends, I need to add the window controllerservices account to the SQL server and give it right to start and stop trace. Can some body please let me know how can this be done. I would really appreciate it. Thanks ...

Using Trigger to get ID on Insert - SQL 2005

I have a table (table_a) that, upon insert, needs to retrieve the next available id from the available_id field in another table (table_b) to use as the primary key in table_a, and then increment the available_id field in table_b by 1. While doing this via stored procedures is easy, I need to be able to have this occur on any insert into...

Call a Stored Procedure from another Stored Procedure.

I want to call a SP from another SP. I know I can easily call it. But Problem is, if an error occurs in SP2 then I want to ROLLBACK SP1. SP1 BEGIN Tran [Some Code] Call to SP2 [Some Code] SP2 BEGIN TRAN [Some Code] [Error Comes] ROLLBACK TRAN This would rollback Tran in sp2 only. I...

SQL Server 2005->2008 upgrade: detach/attach vs. backup/restore?

There was a similar thread on this earlier, but my question is specific to upgrading from SQL2005 to 2008: when upgrading in-place is not possible because the machine has to be re-imaged, which method is preferrable - detaching and re-attaching the db files, or backup/restore? Detach/attach is obviously faster and accoding to msdn possi...

sql server ple + san

Hi All, Having some strange memory issues with sql. We have two different sqlsvr2k5 databases that sit on a san and have two different controllers. One of the DB's is a 3rd party product that has been operating fine for years (and has had no schema changes), the other is our own db. The PLE has dropped significantly over the past month...

SQL Full Text search on HTML/XML data

I have a sql full text catalog on a cms database (SQL 2005). The database holds the CMS page content within a ntext column which is part of the full text catalog. As expected the searching takes into account the xml tags within the page content so searching for "H1" returns all the pages with H1 tags. Is it possible to apply filters wi...

Trouble deploying database from VS2008 to SQL2005

We are using VS2008 deployment for our databases [database solutions in VS where each one has their own schema.] The script it produces does not work quite well. "Before deployment it compares the server objects and then creates the script" is the way msdn is telling, but obviously it tries to create objects those exist, or tries to drop...

sql server unpivoting table

Hi, I'm having trouble trying to unpivot the following table. | operation | ...other columns... | A1 | B1 | C1 | A2 | B2 | C2 | A3 | B3 | C3 | ... | into something like this... | operation | ...other columns... | AValue | BValue | CValue | Right now im doing it like this SELECT operation , ...other columns , Avalue, BValue , CVa...

Can we use "if else" in "Check" constraint in sql server

Can i use if else under a check constraint. Can i use check constraint using a variable need xplanation with eg. ...

SQL search multiple fields, return one

I have a query that needs to compare a value against multiple columns, and only return results from one. I keep getting a conversion error when it tries to convert a string argument into an integer, but I haven't been able to find a good way to circumvent this. SELECT DISTINCT CASE WHEN table_one.integer_col = CAST('argument%' AS...

Profiling Microsoft Dynamics SL 7 (Solomon) performance issues.

We are using Microsoft Dynamics SL 7 (Solomon) and are having performance issues when logging into the application and pulling up information associated with accounts. Aside from a very generic approach to diagnosing the problem(s) such as running SQL Profiler, I was wondering if there was an SL specific approach to discovering performa...

How do I find the data directory for a SQL Server instance?

We have a few huge databases (20GB+) which mostly contain static lookup data. Because our application executes joins against tables in these databases, they have to be part of each developers local SQL Server (i.e. they can't be hosted on a central, shared database server). We plan on copying a canonical set of the actual SQL Server ...