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 > december 2006 > threads for wednesday december 6

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 31

Character range comparison, a bug in SQL Server ? Is anyone else getting the same result ?
Posted by GMG at 12/6/2006 11:33:39 PM
Basically, I have found that .. and - give different results in a character range comparison. [A-Z] will behave differently to [A..Z] See article below: http://www.mssql.com.au/kb/html/gmgxsl.dll/htmlkb?usexsl=y&sp=psearch_articl e_text&@sa_id=66 ...more >>


CASE in WHERE clause
Posted by shank at 12/6/2006 11:13:13 PM
You can probably figure out what I'm trying to accomplish by loking at the below better than I could explain. I'm getting syntax errors. Can someone lend some insight? DECLARE @A varchar(255), @T varchar(255), @BT int, @BA int, @SBF int, @MS varchar(5) SET @A = 'A' SET @BT = '1' SET @MS...more >>

SQL Server 2005 CLR UDF on Itanium Based Systems
Posted by George Kousis at 12/6/2006 10:57:00 PM
Hi, We are currently deploying an Itanium based SQLServer 2005 installation and are having trouble with a CLR UDF developed using vb.net. The UDF was originally tested on a 32 bit SQL Server 2005 with amazing results. The result was that some queries that were using the T-SQL version (S...more >>

datetime conversion
Posted by TBoon at 12/6/2006 9:50:03 PM
Converting a varchar column value of '2006-12-07 11:45:43' to '07-12-2006 11:45:43' using the function convert(datetime, createddatetime, 131) gives error "The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.". How can I fix this?...more >>

Can I migrate my SQL queries from ASP application to SQL Server 05?
Posted by zwieback89 via SQLMonster.com at 12/6/2006 6:18:30 PM
Hi, I have written some SQL queries in ASP applications to build an organization structure. Since some managers have deeper hierarchies than others, I see the execution over the website taking a long time - 32 seconds which is too long. Deeper hierarchies means it can go up to 4 levels deep fo...more >>

Odd behaviour on updating single rows in multi-row resultset
Posted by sebt at 12/6/2006 4:00:34 PM
Hi I'm trying to improve the performance of a kind of "pivot" procedure, which takes a master Orders table and child Order Items table, and pivots the child table "Product Type" onto columns, with the Quantity for each Product Type in the relevant column. Here's some sample DDL that sums it...more >>

Connection pooling questions
Posted by crbd98 NO[at]SPAM yahoo.com at 12/6/2006 3:19:27 PM
Hello All, Some time ago, I implemented a data access layer that included a simple connectin pool. At the time, I did it all by myself: I created N connections, each connection associated with a worker thread that would execute the db commands. The pool was fixed and all the connections were...more >>

copy table structure
Posted by Roger at 12/6/2006 3:08:04 PM
Hi, Using SQL 2005 Express Studio when creating new table how can the structure be copied from an existing table in the same db or another db on the same server? Happy Holidays Thanks, Roger ...more >>



Ancestor/descendant hierarchy via CTE/recursive queries
Posted by hendrik NO[at]SPAM wiegand-hansen.dk at 12/6/2006 2:25:27 PM
Does anyone have any good ideas on how to build a complete ancestor/descendant hierarchy from a id/parent-id table using CTE/recursive queries? I have succeeded in finding all ancestors/descendants for a specific node, but what I now want is a list of all ancestor/descendant-relations in the tab...more >>

Help with calulating balance based on the last record
Posted by aziza.shaikh NO[at]SPAM gmail.com at 12/6/2006 1:43:49 PM
Hi, I have a table which has got a column called as Balance which needs to be calculated based on the value of the last record. The schema of the table is as folls: Create table Txn ( AUTOID INT IDENTITY(1,1), DEBITS MONEY, CREDITS MONEY, BALANCE MONEY ) Insert Into Txn v...more >>

DBNULL not really equal to VB.NET NOTHING??
Posted by jobs at 12/6/2006 1:13:56 PM
I have a dropdownlist that can't match up a NULL value to entry during binding giving me this error: has a SelectedValue which is invalid because it does not exist in the list of items. Parameter name: value I know I can get around the issue by doing a union with a DBNULL in the column bef...more >>

Don't know how to do this - way above my pay grade!!!
Posted by Henry Jones at 12/6/2006 12:52:42 PM
I have four tables. One is BankMaster, Regions, SubRegions, and XRegions The rules are for any given bank, it can be in any region (A region is a State - CA, OR, NY, etc....) and can even be in multiple regions. There can be manu SubRegions also, - Los Angeles, San Francisco, Fresno, etc......more >>

DTS replacement in MS SQL 2005 ?
Posted by bringmewater NO[at]SPAM gmail.com at 12/6/2006 12:09:02 PM
I see that DTS is now Legacy in 2005, so what's the replacement please? Thanks ! ...more >>

Select with one instance of number - help
Posted by trint at 12/6/2006 11:39:04 AM
I have a categories table that will contain many of the same number in the parent_id field (column). How can I write the query to just select one of each number in that column? Example: id parent_id parent_code name description 1 1239 NULL Golf Cart Battery Cha...more >>

index and primary key?
Posted by sloan at 12/6/2006 11:32:01 AM
Is is redundant (unecessary, wasteful) to create an index ... on a column which is already a Primary Key? Here is my script: IX_EmpTest_EmpID is the item of discussion/concern. I believe it is unnecessary, but wanted to double check. I'm using 2005. set nocount on DROP TABLE dbo.Emp...more >>

Check Constraint Error
Posted by g.kurr NO[at]SPAM verizon.net at 12/6/2006 11:05:16 AM
There is one particular table that when I save its design in SQL Server 2000 Enterprise Manager I get a message saying "Error validating check constraint <name of constraint>." This happens in the "pre-save validation process" and it does let me save it. However, I cannot figure out why it eve...more >>

Between via greater than
Posted by Pat at 12/6/2006 10:25:27 AM
Hi Freinds, SQL2005 using between instead of > < has any performance advantage or disadvantage? like : select col1, col2 from table where dregdate between '01/01/2006' and '12/31/2006' or select col1, col2 from table where dregdate >= '01/01/2006' and dregdate <= '12/31/2006' t...more >>

Perfomance of Functions vs Stored Procedures
Posted by Pat at 12/6/2006 10:23:02 AM
Hi Freinds, SQL2005 I was wondering if you have experience with the performance of Functions via SPs. I am doing a select over 30 differennt databases and usiing union all and returning a table set. Which one will have more better performace? FN or SP ? Thanks in advance, Pat ...more >>

sql 2005 date issue
Posted by param NO[at]SPAM community.nospam at 12/6/2006 10:20:27 AM
Hi all, I am running into an interesting issue. The 2 queries below produce different results. Query 1 declare @dt datetime set @dt = '12/6/2006' select * from applications where fundeddate > @dt Returns 16 records Query 2 select * from applications where (fundeddate betwee...more >>

Ordering issue
Posted by Kim at 12/6/2006 9:27:01 AM
I have a one to many relation between two tables. This is basically an order table and a table containing the items in the order. Each of the items have a ship date. These items more often than not will have different ship dates. The ship date may also be null. I am being asked to create ...more >>

How to calculate column percentage
Posted by eddiev at 12/6/2006 8:49:31 AM
This may be a dumb question, but I need to ask anyway. Let's say I have a table with the following columns: ID and Cost. I want a select statement that generates three columns: ID, Cost, and PercentOfCost. If there are two rows in the table, and each row has a cost of $1, then the results...more >>

comparing data sets question
Posted by danielle.m.manning NO[at]SPAM gmail.com at 12/6/2006 8:14:58 AM
I have two separate queries which i guess I want to union together. However, what I really want to do is get a list of ids which appear in one dataset but not in the other. Here is a sample of my query: Select st.VendingMachineId, sl.ServiceTransactionType from ServiceTransaction st, Servic...more >>

Formula building -- use cursors???
Posted by cbmeeks at 12/6/2006 8:09:53 AM
I have a project that deals with building formulas....simple formulas. Something like: ((A * B) / C) + D However, since the formulas are dynamic (using a GUI) I thought about storing each character in a record. For example: SortOrder Value --------- ----- 1 ( 2 ...more >>

Connection to DB - Difference VS 2003 - 2005
Posted by Aibo at 12/6/2006 7:33:26 AM
Hello everybody, I made a program that connects to a database (Microsoft SQL Server 2005) in C# , version Visual Studio 2003. Everything worked properly. Buth then... I tried to update the program to the Visual Studio 2005-version, and now I receive error messages (eg. "the user is not associ...more >>

how to capture messages from SMO ExecuteWithResults()
Posted by Tim_Mac at 12/6/2006 4:53:40 AM
hi, when i'm in sql 2005 management studio and i execute some sql command, the window shows 2 tabs, one for the results, and another for the messages associated with the command. how can i collect these messages using SMO? SQLDMO included a method called ExecuteWithResultsAndMessages, but th...more >>

Recursive user defined function
Posted by niklas.arbin NO[at]SPAM nordicstation.com at 12/6/2006 4:43:15 AM
Hello, I'm trying to create a recursive user defined functio that will list all child objects given a parent object. The problem is my model allows for children being their parents parent. I need some way to determine if a node has already been visited. ALTER FUNCTION [dbo].[Test] ( @inO...more >>

Creating a month by month lookup table from incomplete data. Additional Help needed.
Posted by philipbennett25 at 12/6/2006 3:19:44 AM
philipbennett25 wrote: > Hi, I hope someone has an idea how I might do this. > I have a table that shows goods recieved. Simplified it looks something > like this: > Part Date QTY Vendor > -------------------------------------------------------------...more >>

specifying the column description in CREATE TABLE statement
Posted by newbie at 12/6/2006 2:38:52 AM
How do I specify the column's description in a CREATE TABLE statement? This is my CREATE TABLE statement so far: CREATE TABLE [tTest] ( [ID] [int] NULL , [Name] [varchar] (255) COLLATE Latin1_General_CI_AS NULL ) ON [PRIMARY] GO For the ID field I want a description that says: 'This ...more >>

SSIS Package to Send Emails
Posted by robin9876 NO[at]SPAM hotmail.com at 12/6/2006 2:25:25 AM
Can a generic SSIS package be created that allows emails to be sent based on some supplied values to the package? If it is possible how would you call the package with the parameters? ...more >>

Query Help
Posted by Jami at 12/6/2006 2:06:51 AM
Following is the sample code create table mytab1(PID smallint, PName varchar(30), L_No char(10), F_Name varchar(30), FL_No char(10), M_Name varchar(10) , M_No char(10)) go insert into mytab1 values (1,'James','1234ABC','Michael','1234XYZ','Tina','4567LMN') insert into mytab1 ...more >>

indexes or indices
Posted by Sammy at 12/6/2006 12:53:00 AM
This is a trivial matter but I have seen in various sources when writing about indexes the authors use indices. Is there some standard for the use of the word indices instead of indexes and if so when should the word indices be used thanks for any help Sammy...more >>


DevelopmentNow Blog