sql-server-2005

Database backup - differential file size question

For my backup plan for SQL Server 2005, I want to do a full on Sunday: BACKUP DATABASE myDatabase TO DISK = 'D:\Database Backups\myDatabase_full.bak' WITH FORMAT GO Then I want to do a differential nightly the rest of the week: BACKUP DATABASE myDatabase TO DISK = 'D:\Database Backups\myDatabase_Diff.bak' WITH DIFFERENTIAL GO My a...

What does it mean if I don't provide an InitialCatalog in a OLEDB connection string?

I have a connection string (to an SQLServer 2005 database) which specifies a server, username and password, but does not specify an InitialCatalog. When I try and open connection it works, and I can list the tables, which lists a lot of tables, but not the table from the database I am interested in. What is it I am connected to when ...

Speed up a UPDATE with SELECT query

I have two tables: Table 1 has Episode and Code, with Episode as distinct. Table 2 has Episode and Code, but Episode is not distinct (other fields in the table, not relevant to the task, make each row unique). I want to copy Table 1's Code across to Table 2 for each episode. The current code to do this is as follows: UPDATE Table2 SE...

How to save password in SSIS package configuration using Visual Studio 2005 BIDS?

I know this isn't a "good" thing to do, but its also a temporary measure on several internal servers used by a select few developers. So please forgive me engaging in "very bad things" :) The crux of the problem can be seen when I open any of my connection managers: the password field is empty. I am using SQL Server Authentication with ...

Remote Database Managemnet

I am looking for a .Net Web Application to manage a Sql Server 2005 database, i am thinking something along the lines of phpmyadmin. Note : My current hosting provider does not provide any management interface or allow direct connections. ...

adding lock option to Create Table statement in Sql Server 2005

I am busy creating tables in Sql Server from a Sybase database. In the Sybase database when the tables are created an option 'lock allpages' was used, how can I replicate this when creating the tables in Sql Server 2005. ...

How to present the result of a dynamic pivot request in SQL Server 2005 Reporting Services?

I have a dynamic pivot request I would like to present in a report of Reporting Services. As it is dynamic, the number of columns of the result is variable (as is the name of the columns). How could I create a report showing a table handling this variable number of columns ? ...

Adding percentages to multiple counts in one SQL SELECT Query

I have a SELECT statement similar to the one below which returns several counts in one query. SELECT invalidCount = (SELECT COUNT(*) FROM <...a...> WHERE <...b...>), unknownCount = (SELECT COUNT(*) FROM <...c...> WHERE <...d...>), totalCount = (SELECT COUNT(*) FROM <...e...> WHERE <...f...>) This works fine but I wanted to...

C# Dynamic WHERE clause in a LINQ to SQL Query

I would like to execute a LINQ query with a dynamic where clause depending on how many different options a user has entered for their criteria. Is this possible? I have posted code below of how I would like it to work. Anyone got any suggestions? P.S. I have attempted using the .Contains method (generating a WHERE IN on SQL, however ...

SQL Statement help required. Thanks.

UPDATE Finally managed to work it out! Thanks for all the help from everyone. If you spot any potential errors or scope for improvement in my query please let me know. SELECT * FROM TBL_CAMPAIGNS C INNER JOIN TBL_MEMBERS M ON C.campaign_MemberId = M.members_Id INNER JOIN TBL_CAMPAIGNS_CHARITIES CC ON C.campaign_Key = CC.camcha...

Query to Linked Server never stops executing

I have created a linked server in SQL Server 2005 to an Oracle DB. When I run a query, The query never stops executing, and never returns results. When I cancel the query, it never completes cancelling. I have to close the window to get it to stop. I have set things up as follows: Installed Oracle Client Tools on SQL Server Ran fol...

Analysis Services Excel KPI not appearing

I have an analysis services database with an excel front end. At one point I had the KPI coming though to excel 2007 but now I have no option to select them. Is this a known issue? ...

Why use the INCLUDE clause when creating an index?

While studying for the 70-433 exam I noticed you can create a covering index in one of the following two ways. CREATE INDEX idx1 ON MyTable (Col1, Col2, Col3) -- OR -- CREATE INDEX idx1 ON MyTable (Col1) INCLUDE (Col2, Col3) The INCLUDE clause is new to me. Why would you use it and what guidelines would you suggest in determining wh...

Create a one to many relationship using SQL Server

how do you create a one to many relationship using SQL Server? thank you ...

Sql Server 2005 Analysis Service -cannot connect to sql browser

This is my first attempt at using Business Intelligence development studio. I have set up the project and now trying to deploy my changes. When I run the project I get an error ensure that sql browser is running. Done- setting up cubes & mining structure. Checked that database instance is correct. I have checked that sql2005 is running....

SQL 2005 Express on SBS2008 connection issues from Vista x32 SP2 machines

I have a VB6.0 application running at a client's site on Vista SP2. When attempting to connect to a SQL 2005 Express database on a named instance ([edit]running in Mixed Mode - not Windows Authentication Only), on a SBS2008 server, from THREE OF THE FOUR Vista workstations in the office I receive the following errors: "SQL Server does n...

Approach to generic database design

An application that I'm facing at a customer, looks like this: it allows end users to enter "materials". To those materials, they can append any number of "properties". Properties can have a any value of type: decimal, int, dateTime and varchar (length varying from 5 characters to large chunks of text), Essentially, the Schema looks...

Stop SQL Server 2005 Rebuild index

Can I stop SQL Server reorganising and rebuilding index task while it is still going? Thanks ...

PIVOT syntax in SQL Server 2005

Pulling my hair out with this query. Maybe some of the experts here can see what I'm doing wrong? I have a TimeSheetTime Table as follows: CREATE TABLE TimeSheetTime( TimeSheetTimeID int IDENTITY(1,1) NOT NULL, TimeSheetItemID int NOT NULL, OffsetToEntryDate tinyint NOT NULL, Hours float NOT NULL ) This is populated w...

SP return null as ZERO ?

Using a stored procedure i have a fairly complex SQL statement which returns a COUNT value as a pseudo column. In many cases the result will be 'null'. This causes problems in my application, so i am wondering if it is possible to return a 'null' as '0' by default from the stored procedure? Thanks. UPDATE I need to apply the ISNULL to...