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 > january 2005 > threads for tuesday january 18

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

What cursor type do you use to retrieve multiple recordsets and Wh
Posted by Deepson Thomas at 1/18/2005 10:53:01 PM
Can anybody help me to answer this question .. "What cursor type do you use to retrieve multiple recordsets and Why ?" .... Thanks in advance -- Deepson Thomas...more >>

Two Methods of retrieving SQL
Posted by Deepson Thomas at 1/18/2005 10:47:04 PM
Hi, i was just going thru the interview questions in web for SQL. There in almost all sites i found this questions without answer. Can anybody help me by giving an answer for this ?? The questions is only this much "Two Methods of retrieving SQL" Thanks in advance. waiting for ur reply...more >>

Urgent : Adding ntext data
Posted by Sanjay at 1/18/2005 10:41:01 PM
hi, How can i add two ntext columns . Like i have one table which is having two columns defined as Ntext. create table temp (a ntext,b ntext) Now i want to add both of this column data and update another table column which is also Ntext. I tried but got message "Invalid operator for data ...more >>

Licensing for web application
Posted by tlm at 1/18/2005 9:25:08 PM
I am developing a web site and am considering using SQL Server to develop the database for the site. I understand that purchasing the Developer license will allow me to develop and test on my computer. When I have finished developing the web site and publish it to a web hosting service, wi...more >>

Strange bug, hard to reproduce - is it known?
Posted by Hugo Kornelis at 1/18/2005 6:45:56 PM
Hi, I'm working on a system that uses multiple stored procedures, calling each other and exchanging information through temp tables. The base tables in my system all store two versions of each row; they are accessed through views that expose either the "new" or the "old" row, based on a compar...more >>

How to assign row number for each row in result of SELECT?
Posted by Do Quyet Tien at 1/18/2005 5:34:45 PM
Hi, I have SELECT with GROUP BY clause, also I added a calculated column named "ROWNUMBER" with value is "number of this row in result return by SELECT", how can I set value for this column? and it should reset for each rowset grouped by GROUP BY. Thanks, Tien, ...more >>

Get rid if dublicates
Posted by Mark Goldin at 1/18/2005 5:29:34 PM
I have the following table: id INT SKU char(5) descr1 char(20) descr2 char(20) descr3 char(20) descr4 char(20) descr5 char(20) Here is a data sample: 1 12345 A B C D F 2 67890 Q W E R T 3 67890 Q W E R T 4 67890...more >>

full text index help
Posted by SQL Apprentice at 1/18/2005 4:02:45 PM
Hello, I have a database that uses full text index; however, it is not working. I looked into Books Online for "full-text indexes, adminstering". and copy and ran the following: -- Create and populate a table. IF EXISTS (SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NA...more >>



to find the connection string
Posted by mp at 1/18/2005 3:45:35 PM
what is the extension of the file that connects you to database? I have forgotten this. Thanks ...more >>

union all
Posted by Subbaiahd at 1/18/2005 3:27:40 PM
does union all change results? I thought it only merges two result sets, but in my case it changed the results I have a query as mentioned here select * from ( (result set 1) union all (result set 2) ) order by col1, col22 result set 1 has a select on multiple tables with inner and o...more >>

Writing Stored Proc to Export query
Posted by Chris at 1/18/2005 3:09:03 PM
I'm trying to write a procedure to export a query, but I'm stuck. I've looked on the net to see if there are any examples of this, but the one that I found isn't working. Does anyone have any examples of this that they can pass along? Thanks in advance, Chris...more >>

Help with complex query needed
Posted by Ric at 1/18/2005 3:06:49 PM
Hello, it will be easier to show what I need rather than explain. I have written a query that returns a recordset. Below is a sample record set: ChangeNum TaskNum Analyst RespGroup CompletionDate 1200 100 BakerM ConfigMgmt 2005/01/12 14:22 1200 110 BakerM Dev...more >>

Cant' explain performance
Posted by Mardy at 1/18/2005 2:53:04 PM
I have a procedure that takes 4 parameters. These include a start and end date. The date column is a clustered index and is a datetime datatype. when I submit parameters that span 2 days the query runs quickly and according to profiler, performs 2000 reads. When I run the same procedure with a...more >>

Query question
Posted by Kikoz at 1/18/2005 2:46:08 PM
Hi all. I think the answer to my question is very simple but I can't figure it out. Suppose, there is for tables: Orders, Parts, Charges, Payments, something like this: OrderID .... .... PartID OrderID PartPrice .... ChargeID OrderID Amount .... PaymentID OrderID ...more >>

Help with an ADOCE SQL statement
Posted by William at 1/18/2005 2:29:03 PM
Hi all, Could really use some help here. Am developing a database for my company using the program Sprint DB Pro which uses ADOCE SQL. Am trying to construct two simple queries that just will not work. Query 1: I want to find all records where the field Call_Date is equal to the system ...more >>

SQL Avg Two Tables
Posted by Joe K. at 1/18/2005 2:13:02 PM
I am collecting sample from Windows 2003 server perfmon which is sampled every one minute saved into two tables. I'm trying to write a SQL statement from the two table that will average the countervalue in an hourly format using approximately 20 different values for computername and instan...more >>

Export Data to Access without DTS
Posted by Jason at 1/18/2005 1:56:39 PM
I want to export up to a million rows from an SQL Server table (2000 Server on Win2003 Server) to an Access 2003 table via a VB.NET program running on Windows XP. I don't want to use DTS. I would optimally like to use Bulk Insert commands or something like that. I can figure out how to get it ...more >>

How to parse data into groups and then filter - pivot?
Posted by Chris Crowe at 1/18/2005 1:46:33 PM
I have a problem with a 3rd party application that stores its data as follows: I need to find a fast method to parse data into groups and then filter it so I can basically query it as follows: Select ComponentValue as FreeSpace where TypeCode='Drive' and ComponentDescription = 'Capacity' an...more >>

sql server 2000 large table
Posted by Rick at 1/18/2005 12:25:03 PM
sql server 2000 I am currently maintaining a table that contains 30 Million+ records, 30 columns, and 11 indexes(fill factor 10%) and will double within the next six mouths. The application that accesses this table, mainly for read-only purposes, runs without any problems. We have begun using ...more >>

Why Select Count(1) = Group by
Posted by Patrick Paquette at 1/18/2005 12:12:03 PM
Hi, i want to know why i need to use the clause "group by" on a query with a count ? Because i have a lot of huge query and i think that the group by will be heavy to run. A group by of 13 fields is certainly more slow than just 1. I dont need to group by 13 fields. thank Patrick ex...more >>

sql version
Posted by JFB at 1/18/2005 12:09:58 PM
Hi All, I want to restore a msdb database but I have this problem http://www.support.microsoft.com/kb/264474/EN-US/ My original server have version 8.18 and the server that I want to restore this data have the 8.00.760. How can I found out witch hot fix do I need? Tks JFB ...more >>

Connection is busy with results for another hstmt
Posted by garey.taylor NO[at]SPAM gmail.com at 1/18/2005 11:54:51 AM
Hi All, I've been getting this error: execute (SELECT sa_id, sa_title FROM SubjectArea WHERE j_id = 42 AND active_ind = 1 AND list_id = 1 ORDER BY sa_title): [Microsoft][ODBC SQL Ser...more >>

adding a datestamp automatically
Posted by Neil Jarman at 1/18/2005 11:40:31 AM
Hi, As a convert from Access, I need a little help please. I need to get a datestamp into a new record when it is created. I can see the line for Default Value, but don't know what code to insert here. Many thanks, NEIL ...more >>

Finding and Deleting Duplicates in 1 Table
Posted by Drew at 1/18/2005 11:34:22 AM
How can I find duplicates in the following table? I have tried many different ways, but they don't seem to work correctly. Here is the table structure, CREATE TABLE [dbo].[Users] ( [UID] [int] IDENTITY (1, 1) NOT NULL , [Username] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT ...more >>

Calculate Weekly date in the where clause?
Posted by culam at 1/18/2005 11:27:02 AM
Hi, I need your help in calculated a weekly date? Example SELECT name FROM table WHERE datefield BETWEEN begin_week AND end_week Your help is greatly appreciated, Culam ...more >>

All rows in table A but not table B
Posted by Joshua Campbell at 1/18/2005 11:05:41 AM
I have two tables that are pracitcally the same. Both of them contain SoldToNumber, ShipToNumber and OrderNumber. How can I return a list of all rows from table A that are not in table B? Thank you. Joshua ...more >>

Converting nvarchar to ntext
Posted by Konstantin Loguinov at 1/18/2005 10:30:33 AM
Hey all! Can somebody tell me what the syntax for converting nvarchar to ntext data type is? Thanks! Konstantin ...more >>

Can't DROP CONSTRAINT DF_ on a bit data type?
Posted by Rob R. Ainscough at 1/18/2005 10:02:17 AM
I can't seem to drop a DEFAULT CONSTRAINT on a bit data type in SQL Server 2000. I try the following two statements but neither works: EXEC SP_UNBINDEFAULT 'MyTable.MyField' or ALTER TABLE MyTable DROP CONSTRAINT DF_MyTable_MyField ...more >>

TSQL - getting count of not null values in each column of tables in database
Posted by dfate at 1/18/2005 9:39:53 AM
Hi, I'm looking to do some clean up on an in house application that contains many more columns than are needed to support the application. How can I get a count of the number of records that are not null for each column in the user tables in a database? Would I use sysobjects some how? The pr...more >>

SQL Statement (Perfmon Data)
Posted by Joe K. at 1/18/2005 9:19:13 AM
I am using Windows 2003 server with perfmon to collect data and write the samples to a database. I have approximately 20 fields and are sampled every minute. I would like to write a SQL Server statement that averages the values by hourly or daily within a week interval. Please help me cre...more >>

Database Updates
Posted by DavidM at 1/18/2005 9:14:32 AM
I'm developing a VB6 project that using SQL Server as its backend database. As each new release of the software is ready, there will likely be database schema changes required for the update. I.E., adding new tables, fields, or deleting old fields or deleting usued fields, etc. What is the...more >>

How to tell if primary key is used as foreign key before deleting
Posted by Vern at 1/18/2005 8:59:02 AM
I have a code file that contains a 3 character code and a description. It is used in numerous tables and defined as the foreign key to those tables. If I wanted to delete one of those codes, is there a way to tell if it is in use and therefore cannot be deleted before I attempt the delete? ...more >>

Insert Statement Bloating Log
Posted by David R at 1/18/2005 8:39:04 AM
I have an Insert statement that gets data from 8 joined tables. The actual result set has about 200,000 records in 11 char/varchar columns according to my calculations this result set should be less than 1 GB. But when I execute this query the log file grows to over 80 GB! Then I get the foll...more >>

Post into Messaging Queing
Posted by Bart Bloemers at 1/18/2005 8:31:06 AM
Can I post a message (from a stored procedure) into a Message queque. thanx in advance Bart ...more >>

Database deployment
Posted by j-m-autry NO[at]SPAM austin.rr.com at 1/18/2005 7:34:18 AM
What is the best way to deploy a moderately sized database schema with a software package? I had heard running scripts to create this schema, but not sure if this is the best way. Thanks ...more >>

How to detect locks within a database and kill them?
Posted by Snake at 1/18/2005 7:17:01 AM
We have an Access app that refuses to release locks and even Microsoft is unable to help. Therefore, I have been directed to write a procedure that will kill connections that have any locks in a given database and add this to our Load jobs. I am trying to write the procedure but would like s...more >>

Help with UDF
Posted by Brad Alexander at 1/18/2005 6:51:04 AM
I'm new to T-SQL and need help with a User Defined Function: I have the following SQL that I need to create as a Function SELECT FullName= rtrim(u.firstName) + ' ' + rtrim(u.lastName) FROM ContactUser cu INNER JOIN [user] u ON u.id = cu.userId INNER JOIN ProductLine p ON p.id = cu.p...more >>

Transaction deadlocks
Posted by Khasibhatla at 1/18/2005 6:27:03 AM
I am trying to run a set of procedures from a wrapper procedure. The procedures in the Wrapper Procedure do delete and bulk insert operations, by generating dynamic table name and the path of the files. I have begin Transaction and commit transaction only in my wrapper procedure. But this wo...more >>

MCBDA
Posted by Mal at 1/18/2005 5:47:01 AM
Hi Not the right place maybe, but I trust your opinions since I know how you code and things like that. I want to do my MCDBA in the next few months, I've been doing SQL for 3 years now, I'm 23. I was wondering which books are the best. Obviously the ones from MS Press looks promising ...more >>

Inserting Rows Using INSERT...SELECT?
Posted by AKG at 1/18/2005 5:45:01 AM
Hi, I'm tring insert some rows in a table from some other table, but I need to append some additional fixed information to be added as well. Here is the schema: CREATE TABLE T1 (ObjectID INT) INSERT INTO T1 VALUES (1) INSERT INTO T1 VALUES (2) INSERT INTO T1 VALUES (3) CREATE TABLE T...more >>

best soloution ?
Posted by Peter Newman at 1/18/2005 5:43:04 AM
Im trying to write an application in vb6 ( sp5 ) to reconcile the status of our bureau, with file sin / out agains the text log produced by a third party. The files recieved are all stored in SQL2000 tables. To make the reconcilliation a lot quicker and easier, i would like to import the t...more >>

Using a linked server
Posted by jaylou at 1/18/2005 5:27:03 AM
HI All, I am trying to make a backup copy of one of my tables to a linked server in a stored procedure. My code is : select * into BR0133srv.DataChgBU.dbo.tblmaincontractsB4TermitePay from tblmaincontracts Which gives mre the following error: Server: Msg 117, Level 15, State 1, Line 1 The...more >>

RDO query error with SQL Server 7.0
Posted by ak3010 at 1/18/2005 4:45:04 AM
While using RDO query(VB5.0) to create a temporary table in SQL Server 7.0(with SP4), I am getting the following error: Code '40002': Error: S0001: :[Microsoft][ODBC SQL Server Driver][SQL Server] There is already an object name '#<name of temporary table>' in the database. Please help to ...more >>

SQL Server and ASP page no longer speak
Posted by Earnie at 1/18/2005 3:41:05 AM
my application is involves passing a numeric value from an ASP web text field to a SQL procedure I'am developing this on a local machine using IIS the text field is of the type "double" and the procedure parameter is "decimal (18,4)" this has served perfectly well for the last year but...more >>

Create a full-text index table with sql...
Posted by Daniele at 1/18/2005 2:03:02 AM
Hi, how is it possible to create a full-text index table with sql? Thanks, Daniele...more >>

differences between ORACLE and MS SQL
Posted by evagelos at 1/18/2005 1:26:45 AM
i want to create some queerys in MS-SQL 1) this queery in ORACLE-SQL works fine , in MS-SQL? SELECT code_card, card_date + 31 FROM card i searce and find out that i must use "DATEADD ( datepart , number, date )" but how? 2) this queery in ORACLE-SQL works fine , in MS-SQL? ...more >>

Current Row Number
Posted by Kiran at 1/18/2005 12:32:07 AM
Hi, Is there a way to get the current Row number. If get this as a result of select statement, 12 as 56 yu 89 gh I need like this 1 12 as 2 56 yu 3 89 gh I saw some eg.s using temporary tables. But Is there a straight forward way to get this. Thanks Kiran ...more >>


DevelopmentNow Blog