sql-server-2005

SQL Analysis Services - Dimension attributes with a "many" cardinality

I am creating a cube with the following tables: Customer CustomerID, Name Customer Rep CustomerID, RepID Rep RepID, Name The important thing here is that there is a many to many relationship between Reps and Customers. I want to be able to ask the question "How much sales for customers working with rep 'A'?" In the data source view...

How to Revoke SELECT Permission for system_views To public

I have the following T-SQL to display all the permissions granted to principals on my SQL server 2005: select dp.NAME AS principal_name, --1 dp.type_desc AS principal_type_desc, --2 o.NAME AS object_name, --3 p.permission_name, --4 p.state_desc AS permission_state_desc --5 from sys.database_permissions p left OUTER JOIN ...

SQL Server - Performance/Size Drawbacks of Null Columns

I'm working on a table design that could involve many NULL values in about 10 fields maybe 75% of the time the fields would be unused. I just generated some fake data (a million records) and could not sense any impact on SQL Server 2005. Size difference was in the KB. Performance - no measurable difference after adding an index to the 3...

Are there any compelling reasons not to upgrade to SQL Server 2008?

I have noticed that a fair number of developers are still using SQL Server 2005. Is there any compelling reason not to use SQL Server 2008? Is it simply that your employer sees no benefit in upgrading? I am planning to start a new project soon, and I am wondering which version would be better to use. ...

MSDTC Service on SQL server 2005

How do I Start the MSDTC service on SQL Server 2005? ...

Arithmetic overflow error converting expression to data type datetime.

This select statement gives me the arithmetic error message: SELECT CAST(FLOOR((CAST(LeftDate AS DECIMAL(12,5)))) AS DATETIME), LeftDate FROM Table WHERE LeftDate > '2008-12-31' While this one works: SELECT CAST(FLOOR((CAST(LeftDate AS DECIMAL(12,5)))) AS DATETIME), LeftDate FROM Table WHERE LeftDate < '2008-12-31' Could there be...

Milliseconds wrong when converting from XML to SQL Server datetime

I've run into a problem related to converting datetimes from XML (ISO8601: yyyy-mm-ddThh:mi:ss.mmm) to SQL Server 2005 datetime. The problem is when converting the milliseconds are wrong. I've tested both implicit and explicit conversion using convert(datetime, MyDate, 126) from nvarchar, and the result is the same: Original ...

SSIS SQL Native Client Error - Can't Diagnose Cause

We have a very large number of SSIS jobs that are scheduled every evening/early morning to run in succession. These jobs populate and update large amounts of data for our production systems. Recently, we have begun receiving an error message on different jobs at different times. So far, it has been impossible to reproduce on a consistent...

How to get difference between two rows for a column field?

I have a table like this: rowInt Value 2 23 3 45 17 10 9 0 .... The column rowInt values are integer but not in a sequence with same increament. I can use the following sql to list values by rowInt: SELECT * FROM myTable ORDER BY rowInt; This will list values by rowInt. How can get get the difference of Valu...

Could not generate mail report.An exception occurred while executing a Transact-SQL statement or batch.Supply either @id or @name.

In SQL Server 2005 I have a maintenance plan set up to back up databases. I have a notify task. I am getting a blank email. The maintenance job history shows the error: Could not generate mail report. An exception occurred while executing a Transact-SQL statement or batch.Supply either @id or @name. I have set up database mail, I have ...

Select similar like rows within the same table

I am trying to write a query to find all USERS in a USERS table that are similar. Its like finding all non distinct rows but using a LIKE statement not an equals statement. Below is an example column of a USERS table USERNAME ------------ tim.smith doug.funny tim.smith1 dan.snyder tim.smith20 doug.funny2 emily.hunt after query the o...

Active - Active DR Strategy for SQL Sever 2005

We are trying to come up with an Active - Active DR strategy for our 6 TB data warehouse. Our datawarehouse has 40 DBs and everything has to be replicated on a real time bases. Site 1 : Needs to handle all the ETL Site 2 : Will handle all the reporting queries. Database Mirroring (Cannot afford to drop and create snapshots as we cann...

Replacements for Full Text Search

I am not a big fan of Full Text search with MSSQL(not sure if there is another) does anyone know of any other options to this? ...

Return unordered list from hierarchical sql data

I have table with pageId, parentPageId, title columns. Is there a way to return unordered nested list using asp.net, cte, stored procedure, UDF... anything? Table looks like this: PageID ParentId Title 1 null Home 2 null Products 3 null Services 4 2 Category 1 5 ...

SQL Query - Search across multiple fields

Hi everyone, I'm trying to implement a search, where you can enter more than one searchterm to form an AND-Condition. Also it should search in different fields of the database. So for instance: You when you enter "Bill Seattle", you should get a record where NAME matches Bill and CITY matches Seattle. You shoudn't get any rows where ju...

Sql Server INSERT scope problem

This may have been asked before, but it's really hard to search for terms that limit the search results... Take the following SQL snippet: declare @source table (id int) declare @target table(id int primary key, sourceId int) set nocount on insert into @target values (0,0) insert into @source(id) values(1) --insert into @source(id)...

Reporting Services Report Deployment / downgrading problem

I have a reporting services project with lots of reports developed in SQL server business intelligence development studio that comes with sql server 2008. I want to deploy these reports to a server that has reporting services 2005 only but the deployment is failing. I'm wondering if any one around here has been able to deploy reports dev...

how to forward engineer database diagram from visio 2003 file ?

I came across some vb macros that export it to a mdb ( ms access ) file. But does not work very well when copying forward constraints , etc. I want generate schema from the database diagram for sql server 2005 database. ...

Set Identity_insert on - Merge Replication - SQL Server 2005

I have merge replication set up between two databases and am using identity ranges on both. I want to add a specific row to a merged table (setting the identity value to something outside of the identity range) on the publisher. When I try this, I get the following error. The insert failed. It conflicted with an identity range check c...

SSIS Derived Column Missing Downstream

I've created a derived column that translates a 1 to an 'M' and a 2 to 'F'. i.e. a gender indicator. The derived column feeds into a Fuzzy Lookup transformation and then to a conditional split. The problem is the derived field does not show up in any of the downstream components. In the Fuzzy Lookup transform the "Pass Through" check...