sql-server

MSSQL server and index join

Hi, I'm working on an assignment where I'm supposed to compare different join methods in SQL Server, namely hash-join, merge-join and index-join. I'm having difficulties getting SQL Server to perform an index-join. Can anyone show me how I can force it to use an index-join (using a join hint or similar), or just simply provide a simpl...

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. ...

How may I store contact methods (or similar typed data with different fields) in a normalized way?

I've crossed this problem in, oh, every application I've ever written. I'd like a final consensus answer! Is this the most normalized/efficient/proper way to store contact methods or any other data along this pattern in a database? Contact { PK ContactId, ... } ContactContactMethod {PK FK ContactId, PK FK ContactMethodId, Key, Commen...

Where is SQL Profiler in my SQL Server 2008?

I downloaded SQL Server 2008 and can't seem to find SQL Profiler anywhere. I believe I installed the SQL Server Enterprise Express/trial version? I guess it was Express and not Enterprise after all right? ...

What is the concept of an Online Reminder Service in ASP.NET, SQL ?

I want to develop an Online Reminder service in ASP.NET 2.0 (C#) and SQL2005. But I am not getting the concept of reminder service. What I know is using an online reminder service I can schedule a reminder for future dates, which is sent to me (who schedule reminder) via email or SMS on that date. But in asp.net how to do this, caz anyo...

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...

SQL Server FTS Timeout Error in ASP.Net, after application is idle for some time

Hi, We have a page calling a Search stored procedure which internally uses SQL Server 2005 FTS. If the application remains idle for 10-15 mins, the first consequent call to the stored procedure times out. All subsequent calls work. Is there any way to prevent this from happening? We don't want the first user getting a timeout and we al...

SQL data comparison tool for SQL Server Compact

Does anyone know of a tool similiar to RedGate's SQL Data Compare that works with Microsoft SQL Server Compact 3.5? ...

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 ...

Zend Framework and SQL Server

I'm trying to use Zend Framework with SQL server 2005 express (through Pdo_Mssql with wamp installation) but seem that pdo can't connect to SQL. This is my code: require '../application/bootstrap.php'; try { $db = Zend_Db::factory('Pdo_Mssql', array( 'host' => 'localhost', 'username' => 'sa', 'password' => 'veryst...

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...

Linq2sql/GridView: Pagination not working?

What's the best method to bind a linq2sql collection to a GridView, given that I want ot use builtin pagination and sorting? I've tried: public static void BindEnquiryList(EnquiryQuery query, GridView view) { DataContext db = DataContextManager.Context //view.DataSource = (from e in EnquiryMethods.BuildQ...

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 ...

Is there a way to import an Excel worksheed file (ver 2.1) into SQL 2005 using SSIS?

I am receiving an Excel Worksheet file (ver 2.1) from one of our clients as part of a weekly date update. I am trying incorporate it into our automated update process, but I can't import the file in SSIS (or Sql Management Studio) as the oldest format I can process is Excel 3.0. Is there an update that will add support for this older f...

Tool to upgrade SQL Express database after deployment

I have an app which uses SQL Express and my customers are mainly people who don't have a dedicated IT staff, so wouldn't know how to run scripts. So the deployment and upgrades has to be easy. The deployment part is all figured out. What I need to know is when version 2 of the product comes out and its time to update the database structu...

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...

SQL Server: How to limit CTE recursion to rows just recursivly added?

Simpler Example Let's try a simpler example, so people can wrap their heads around the concepts, and have a practical example that you can copy&paste into SQL Query Analizer: Imagine a Nodes table, with a heirarchy: A - B - C We can start testing in Query Analizer: CREATE TABLE ##Nodes ( NodeID varchar(50) PRIMARY KEY NOT NUL...

SQL Coalesce in WHERE clause

I'm trying to implement optional parameters in a stored procedure that I have but I am running into a problem. Here's a simplified query to illustrate the issue: SET ANSI_NULLS OFF DECLARE @MiddleName VARCHAR(20); SET @MiddleName = NULL; SELECT * FROM [Customer] WHERE [LastName] = 'Torres' AND [MiddleName] = COALESCE(@MiddleName, [Mid...

Connect Access 2007 to SQL Server 2008 Database

Hi, I've seen numerous answers to similar questions like this one. I haven't seen on the web many people have asked the seemingly simple question "How do I connect Access 2007 to an SQL server 2008 database" - but all of the answers describe how you can migrate from access 2007 to an sql server 2008 database, or they describe how to conn...

Get a Parameter List from an SQLDataSource given Stored Procedure Name

Is there a sane way to get a list of expected parameters from an SqlDataSource given the name of the stored procedure assigned to its SelectCommand property? ...