Archived Months
January 2003
March 2003
April 2003
May 2003
June 2003
July 2003
August 2003
September 2003
October 2003
November 2003
December 2003
January 2004
February 2004
March 2004
April 2004
May 2004
June 2004
July 2004
August 2004
September 2004
October 2004
November 2004
December 2004
January 2005
February 2005
March 2005
April 2005
May 2005
June 2005
July 2005
August 2005
September 2005
October 2005
November 2005
December 2005
January 2006
February 2006
March 2006
April 2006
May 2006
June 2006
July 2006
August 2006
September 2006
October 2006
November 2006
December 2006
January 2007
February 2007
March 2007
April 2007
May 2007
June 2007
July 2007
August 2007
September 2007
October 2007
November 2007
April 2008


all groups > sql server programming > november 2006 > threads for thursday november 30

Filter by Day: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30

Eliminate duplicates from sum, not display
Posted by ana9 via SQLMonster.com at 11/30/2006 10:21:54 PM
I run a query for the salesperson, company name, project name, service type for the project and profit. I have to group the results based on the service type. I would like to be able to sum the profits for each salesperson however if a project has two different service types(product and service...more >>

SQL server and Access update
Posted by Bonzol at 11/30/2006 8:14:58 PM
Hey there,, I know when updating,, Access can be differnt from SQL server this works in access from a vb.net 1.1 prog SQL = "Update Clients SET UnameID= '" + updatevalue + "' WHERE ID = " + checkValue + "" Can anyone just quickly tell me what i have to change for it to work in SQL server...more >>

Adding images to the database
Posted by Earl at 11/30/2006 7:09:25 PM
Looking for an idea here. I've got a .Net app connecting to SQL2005 where I allow users to add pictures to the database. But I don't want them adding gigantic images, so I'm looking for an idea on how to control how big of an image they might add. I'm not interested in simply saving a pointer ...more >>

Original Excel File gets deleted and temp file gets created.
Posted by Sandy at 11/30/2006 7:08:00 PM
Guys, I have a major problem with an Excel workbook that i created and have been try to resolve this issue for a couple of weeks and my Bosses are breathing down my neck. Here is how it works: I have multiple users using the excel workbook at the same time (they will open as read only). On...more >>

insert/update triggers, SP, and calculations
Posted by Robert Bravery at 11/30/2006 7:04:19 PM
Hi all, I have an insert/update triger that amongst other things calls a SP which amonst other things does a some of the current table. Prpblem is, the newly inserted/updated amount is not included in the sum, (yeah because it is not pysically in the table yet). Any ideas as to how i can achi...more >>

clustered index's structure question
Posted by Derek at 11/30/2006 6:52:48 PM
hi reading up clustered indices and i'm trying visualize the structuring. if i build a clustered index then it is a b-tree and the leaf is the data record does the clustered index page look like this? 1 (1st level) / \ 2 3 (2nd level) / \ data data (3rd l...more >>

Cursor Speed 2000 vs 2005
Posted by Chuck Reif at 11/30/2006 6:21:02 PM
I ran two different tests on instances of SQL Server 2000 and SQL Server 2005 running on the same machine. The first involved a simple tight loop (while statement) of 50,000 interations in a procedure with no processing. The second involved an insensitive cursor on a table of 50,000 rows agai...more >>

sql query
Posted by rjmagana NO[at]SPAM gmail.com at 11/30/2006 5:21:46 PM
hi, i have the following output in Table1: Dept Item Region Price Date_Changed 4 555 north 99.99 1/6/05 4 555 north 109.99 2/6/06 4 555 east 89.99 11/13/06 4 555 east 108.99 1/6/05 4 111 north 99.99 2/6/06 4 111 north 109.99 11/13/06 4 111 east 89.99 1/6/05 4 111 east 108.99 2/6/06 ...more >>



Autoval in SQL Server 2005?!
Posted by Michel Racicot at 11/30/2006 5:17:49 PM
I used to do the following in SQL Server 2000 to see if I had at least one column in a table that have an identity column. select @AtLeastOneAutoval = count(*) from tempdb.dbo.syscolumns where id = object_id(@TableName) and Autoval is not null However, for an unknown reason, the identity co...more >>

SQL Server 2005 Express connection problem
Posted by TAC at 11/30/2006 4:47:34 PM
I hope this is an appropriate question for this group. I've posted this in the connect group without success. I just installed SQL Server 2005 Express edition with Visual Studio 2005, and created an app in Visual Studio using C#. I get the following error when trying to connect: ...more >>

Use cursors or no
Posted by Robert Bravery at 11/30/2006 4:31:07 PM
HI all, I have a situation where in a trigge of a particular table, I have to exec a Sp (which adds rows to another table), for each row of a third table, passing values from each row into the SP so trigger on table a for each row in table b exec Sp tableb_columna_value, tableb_columnb_valu...more >>

QUERY problems
Posted by Smokey Grindle at 11/30/2006 3:55:31 PM
whats wrong with this query? SELECT COUNT(*) FROM ( select * from components where components.coverageid = @CoverageA UNION select * from components where components.coverageid = @CoverageB ) it keeps saying Msg 102, Level 15, State 1, Line 21 Incorrect syn...more >>

Best x% analysis of SQL data
Posted by shripathikamath NO[at]SPAM gmail.com at 11/30/2006 1:35:49 PM
I want some help on ideas of how best to go about analyzing some data so that I can determine the best of a group. The following is an illustration of the nature of the analysis needed. I have a table of persons with points being assigned to them. What I want to do is determine the best 80% (...more >>

Trouble with Select Top SP
Posted by WB at 11/30/2006 11:52:48 AM
I have been struggling with the following Stored Procedure. The goal is to return the top (n) customers at each store. I created a View called View_test that is the recordset I want to work with. View_test (approx 6500 records) CREATE VIEW View_test AS SELECT c.StoreId, t.CustomerId, SUM((...more >>

returning rows with max value
Posted by David Cho at 11/30/2006 11:47:45 AM
This goes under the category of "Everything You Wanted to Know about SQL, but were Afraid to Ask." I will use the Orders table from NorthWind to demonstrate the concept. When I do "ORDER BY CustomerID, OrderDate DESC" OrderID | CustomerID | EmployeeID | OrderDate 130000_____ALFKI________...more >>

VIEW Help
Posted by Scott Rymer at 11/30/2006 11:40:56 AM
SQL2000 SP3 I'm working with a suppliers calendar table which is used to determine working vs. non-working days. Goes a little something like this... CREATE TABLE [dbo].[AdmCalendar] ( [CalCentury] [decimal](2, 0) NOT NULL , [CalYear] [decimal](2, 0) NOT NULL , [CalMonth] [decimal](2,...more >>

DESPERATE - Need help getting a SQL stored procedure output parameter to my .NET app
Posted by jbonifacejr at 11/30/2006 11:17:59 AM
Hi. I'm sorry to bother all of you, but I have spent two days looking at code samples all over the internet, and I can not get a single one of them to work for me. I am simply trying to get a stored procedure output parameter to be stored in a variable in my ASP code. The error I am getting is...more >>

Deleting duplicate entries
Posted by KMG at 11/30/2006 11:06:45 AM
Due to a removal of a column in one of our tables, we now have a table with many duplicates. Yes, this could have been avoided if database had been created correctly in the first place. So now I have duplicates, and I have fk's pointing to those duplicates. Any easy way to delete the duplic...more >>

Programmers & Databases
Posted by KMG at 11/30/2006 10:40:15 AM
Is it common for database administrators to lock the programmers out of the databases they are writing programs for? This is the first I have encountered this, and so much time is wasted because I have to wait for a database administrator to fix something. Seems pretty silly when the datab...more >>

Collation conflict for column 1 in SELECT statement.
Posted by gv at 11/30/2006 10:20:30 AM
Hi all, I'm geting this error and is related to the first Coolumn in the Select list with the J.[name] Column? Server: Msg 451, Level 16, State 1, Line 8 Cannot resolve collation conflict for column 1 in SELECT statement. SELECT DISTINCT CASE WHEN C.[name] = 'Report Server' THE...more >>

Checking for new records
Posted by David S. at 11/30/2006 8:59:20 AM
I need a programatic way of checking for and and moving new records from a view in one databse to a table in another. Can someone give me an example? ...more >>

help needed with SQL
Posted by shival.thakar NO[at]SPAM gmail.com at 11/30/2006 8:21:57 AM
I have a table called ATable(field1 varchar(1), field2 integer). The rows look like this: ATable: ===== field1 - field2 x-1 x-2 x-3 y-1 y-2 I want to find out distinct "field1" which has both 2 ****AND**** 3 as field2 values... SELECT DISTINCT field1 FROM ATable Where field2 IN (2,...more >>

SQL Book Suggestions?
Posted by Glenn Billand at 11/30/2006 6:51:20 AM
Hello, I'm trying to find a book for an intermediate SQL programmer and figured this would be the best place to go for suggestions based on any experiences you've had. I appreciate any help and/or suggestions you might have! ...more >>

SELECT Procedure
Posted by shapper at 11/30/2006 6:48:21 AM
Hello, I am moving from Access to SQL and I am trying to create DELETE and a SELECT procedures. I was following the Asp.Net 2.0 Membership, Roles, etc procedures but I am not getting there. Could someone, please, post just the 3 procedures for this example? It would be a start for me to wo...more >>

Add in query
Posted by jcatalah at 11/30/2006 4:38:54 AM
Hi. I would like to do something like this. SELECT TOP (n+5) * ORDER BY OrderColumn. But I get a error message. Somebody know how can I do (n+5). It is a syntax mistake but I do not know how I can resolve it. Thanks. ...more >>

SELECT UNTIL ?
Posted by Douglas at 11/30/2006 12:00:00 AM
Hi =20 Im not an SQL n00b, but I'm no SQL guru... I'd like to work out the SQL code required to achieve the following goal = in pseudocode: Grap a record Using info from that record, add (the width) to a running total. When the running total exceeds a certain value, stop grabbing records...more >>

;
Posted by TBoon at 11/30/2006 12:00:00 AM
What is the difference with or without the ';' at the end of a statement??? ...more >>

using character ' on dinamic sql
Posted by Roy Goldhammer at 11/30/2006 12:00:00 AM
Hello there I need to build a dinamic sql that looks like this: SELECT * FROM Customers where CostomerName = 'Roy' the only way i know to use it as dinamic sql is: exec ('SELECT * FROM Customers where CostomerName = ' + char(39) + 'Roy' + char(39)) is there better way to do this? ...more >>


DevelopmentNow Blog