Archived Months
January 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


all groups > sql server (alternate) > september 2003

Filter by week: 1 2 3 4 5

Import Human-Readable text file into SQL Server 2000
Posted by sstorhaug NO[at]SPAM webuniverse.net at 9/30/2003 10:03:01 PM
Hello, I am receiving a text file that is produced from a mainframe that is out of my control. I am attempting to find a (hopefully clean) way to import it into a SQL Server database in an automated fashion. I am not really concerned about how many tables it requires or what the schema look...more >>

FoxPro Index called from SQL Server
Posted by Steve Perry at 9/30/2003 6:54:46 PM
Hi, I have a large FoxPro table with an index that I need to be Queried from SQL Server by OLE.DB or ODBC. If I query the DBF directly a search takes 1 Minute +. Is there a way I can call the data from the table and use the existing FoxPro Index? Thanks Steve ...more >>

Retrieve One Row at a time
Posted by chris NO[at]SPAM dagran.com at 9/30/2003 5:43:13 PM
Hi, I am going to be difficult here... How do I retrieve one row at a time from a table without using a cursor? For example, I have a table with 100 rows. I want to retrieve the data from row 1, do some stuff to it and send it on to anther table, then I want to grab row 2, do some stuff ...more >>

Calculating Time Difference
Posted by Shaun at 9/30/2003 4:02:58 PM
Hi, I have a table called Bookings which has two important columns; Booking_Start_Time and Booking_End_Time. These columns are both of type DATETIME. Given any day how can I calculate how many hours are available between the hours of 09.00 and 17.30 so a user can see at a glance how many hour...more >>

Return Value in a Stored Procedure
Posted by frank niedermeyer at 9/30/2003 3:49:50 PM
Hello Newsgroup ! My Tools are: Windows 2000, VBA(Access 2000) and MS SQL Server 7.0 I wrote in an *.adp project (Access 2000) a Stored Procedure "xyz" with parameters a,b In my VBA Code i wrote: Dim par As New ADODB.Parameter Cmd.CommandType = adCmdStoredProc Cmd.CommandText = "[p...more >>

how to add column in database at runtime.
Posted by NetPointer at 9/30/2003 3:00:02 PM
Hello all, I m trying to add a column in my database (it is a csv file) but it is giving me following exception. ------exception------------ {System.Data.OleDb.OleDbException} ErrorCode: -2147467259 Errors: {System.Data.OleDb.OleDbErrorCollection} HelpLink: Nothing InnerException: Nothing ...more >>

TEMPDB now at 4 GB
Posted by steve.archer NO[at]SPAM deaconessokc.org at 9/30/2003 2:05:04 PM
I have shut down the SQL agent, rebooted the box and still my TEMPDB is at 4 GB plus. Is there any way to shrink it another way?...more >>

Cannot convert Varchar to Numeric issue
Posted by Michel at 9/30/2003 1:34:21 PM
Hi again all, I have a small issue. Here's an example dataset : F1 F2 F3 1 0.58 Hi 2 0.70 Hello 3 Fail Bye 4 <Null> Hi When I write this statement : SELECT SUM(CONVERT(DECIMAL(16,8),F2)) MySum FROM T1 WHERE IsNumeric(IsNull(F2,'X'))=1 I get "Can...more >>



SQL Server Hogs 100% CPU
Posted by abbasrazam NO[at]SPAM yahoo.com at 9/30/2003 12:28:03 PM
I am running a t-sql script which makes a bunch of calls to stored procedures, updates few tables and inserts records. I do this in Begin Tran and commit. The problem I am having is that SQL Server hogs 100% of cpu. This degrades the performance of other applications obviously. The memory it use...more >>

Looping database queries
Posted by julian.rickards NO[at]SPAM ndm.gov.on.ca at 9/30/2003 10:58:09 AM
Hi, newbie here: I have created a small (5 fields) Access table which I will be converting to MS-SQL Server format when the ASP code has been completed. It is basically a collection of links to news releases from mining companies. The group of people who will be browsing this database want to...more >>

Many fields update from a Group by Clause
Posted by Michel at 9/30/2003 9:26:29 AM
Hi All, In Oracle, I can easily make this query : UPDATE t1 SET (f1,f2)=(SELECT AVG(f3),SUM(f4) FROM t2 WHERE t2.f5=t1.f6) WHERE f5='Something' I cannot seem to be able to do the same thing with MS-...more >>

Connection.CommandTimeout
Posted by peter.dawson NO[at]SPAM kingsch.nhs.uk at 9/30/2003 6:33:02 AM
Running VB6 with SQL Server 7, opening a connection and setting this parameter by Conn.CommandTimeout does not always seem to force a command (stored procedure) executed through Conn.Execute to timeout after the specified period. Is anybody able to suggest what may be going on here. Thanks...more >>

where clause messed up
Posted by PipHans at 9/29/2003 9:31:36 PM
Hi, Consider this (light example): SELECT [template].[id], [template].[navn], [tvalues].[id] FROM template LEFT JOIN Tvalues ON [tvalues].[templateid]=[template].[id] This returns ok. But I have a clause on the Tvalues like this: WHERE [tvalues].[nr]=1; Now I dont get what I want any...more >>

Cursor, Query, View and Recordset
Posted by sci at 9/29/2003 7:07:14 PM
Could someone help me by answering the questions below? What's a cursor? What's difference between Query and View? Is a RecordSet just part of a table? Can it be part of a query of view? If the content in a table changed, is it necessary for a old recordset to renew itself by do "Requery()"?...more >>

About virus
Posted by ALEX KLEIN at 9/29/2003 5:15:48 PM
During last 10 days I receive a lot of viruses in my email. Analysis showed me that this virus touched all users that participate in news server. Article http://update.internetweek.com/cgi-bin4/DM/y/ec5O0B4qcg0V30B85D0Ap that I read today proved this. I recommend to everybody who care about his...more >>

Select, insert and delete queries timing out
Posted by Simon Withers at 9/29/2003 2:01:57 PM
I am using a sql server 2000 database to log the results from a monitor that I have running - essentially every minuite, the table described below has a insert and delete statements similar to the ones below run againt it. Everything is fine for a few weeks, and then without fail, all accesses...more >>

Rows as Columns
Posted by Guinness Mann at 9/29/2003 12:30:53 PM
I know this is a self join, but I can't remember exactly how it goes. Could someone help me out? create table A { int idA, varchar(30) dataA } create table B { int idB, varchar(30) dataB } create table A_B { int idA references A(idA), int idB references B(idB) } inse...more >>

SQL Server Monitoring
Posted by rsanderson NO[at]SPAM allmerica.com at 9/29/2003 11:19:31 AM
I am currently evaluating Quest (Foglight & Spotlight) vs. BMC (Patrol & DBXray) and I am soliciting feedback from the community on these two products or any others that I should check out. Any success stories, shortcomings or anything else that you may be able to contribute to my Proof of Conce...more >>

SELECT a random row for each different Type
Posted by Yannick Turgeon at 9/29/2003 9:43:07 AM
Hello all, I'm using SS 2000 Based on the following table and data: CREATE TABLE T ( F1 VARCHAR(1), F2 INT, F3 INT) /* T has no unique key */ /* The data */ INSERT INTO T SELECT 'A' AS F1, 1 AS F2, 10 AS F3 UNION ALL SELECT 'B', 2, 12 UNION ALL SELECT 'B', 3, 11 ...more >>

multi-thread tasks using a single connection object concurrently
Posted by hui_km NO[at]SPAM star-quest.com at 9/29/2003 6:56:45 AM
is it possible to use a single connection object shared by several tasks where each task is handled by a thread? these tasks call stored procedures that return record sets, no editing, update or delete. my objective is that db connection is expensive and each user can only have 1 connection ob...more >>

Order by clause
Posted by romeo9225 NO[at]SPAM yahoo.com at 9/29/2003 6:54:40 AM
If I use the order by clause to sort on a date, where the date and time stamp are the exact same for multiple records, how does SQL output the data? At random... or does it look at the primary key?...more >>

Query Help
Posted by Jesse Fitterer at 9/28/2003 11:51:48 PM
This query works except when the count for the Wins and losses is 0, the query returns nothing. The count has to be at least 1 or more. ANy ideas? Select fname+' '+lname as full_name,SubQuery.Wins, Query.losses from tbl_Participants a inner join (Select Part_ID,count(*) as Wins from tbl_W...more >>

Data File in a Different machine on the network.
Posted by bschandramohan NO[at]SPAM yahoo.com at 9/28/2003 10:05:11 PM
Hi All, I have a requirement to create the database with data and log files in a different machine on the network. Googling, I got a link which said Mapped drives do not work but UNC paths work. However in my case, both are failing. Any advices or links on net will be highly useful. T...more >>

Reasonably simple query question
Posted by Chris Vinall at 9/28/2003 11:44:12 AM
I'm an SQL beginner and this is driving me nuts as it seems simple enough but I can't figure it out. I have a table that looks like: ID: int MajorVersion: int MinorVersion: int Content: ntext The ID is not the table key - different rows can have the same ID. The MajorVersion and Mino...more >>

Creating a Stored Procedure from 3 queries
Posted by Satvic at 9/28/2003 3:12:34 AM
Hi all, Sorry for HTML, there is a lot of code & comments =20 I tried to create a stored procedure from 3 queries .. to reduce # of = times DB gets access from 1 asp page. The result procedure only works = 1/2 way (does return the rest of the SELECT statement) :( =20 Please help me figure...more >>

AutoNumber
Posted by VideoSmeden at 9/27/2003 11:01:58 PM
Hi Please help me URGENT How do i make an tableField with a Auto-Incr, the same like in an access DB where it's called AutoNumber Thanx in advance __________________________________________________________________ Flemming Paulsen ICQ#: 270065050 Current ICQ status: + More ways to contact m...more >>

Erro running a query if dashes present in the string
Posted by Satvic at 9/27/2003 1:38:40 PM
Hi all, I have a table in the DB which holds ISBN book nubers .. which, as you know have dashes (examlple: 0-98765-8-9). When I run a query from an ASP page to find the number, it doesn't return anything: sISBN = "0-98765-8-9" OpenSQL(select URL from ISBN_Redirect where ISBN=" & sISBN )...more >>

Performance Complex SQL Issue
Posted by timasmith NO[at]SPAM hotmail.com at 9/27/2003 1:27:08 PM
Hi, I have a table ORDER_DETAIL with 22 million rows which has an index of (person_id, code_id, created_dtt) I have another ORDER table with 5 million rows which has an index of (order_dtt, person_id) I have a small CODES table with 1000 rows which allows me to get the 50 ...more >>

Recordset Problem
Posted by Andrew at 9/27/2003 9:36:49 AM
I have a Recordset as below which works SELECT DISTINCT MemberID, RegStatus, ProfileDate, Title, PostTown, PostCode FROM [Site Photos] ORDER BY ProfileDate DESC However as soon as I add a further field called "images" it all goes wrong MemberID may have 3 images attached How can I do t...more >>

sum() for textual fields?
Posted by Zaka Ferenc at 9/26/2003 3:17:25 PM
Hi all, Many times would be useful (for me at least) if sum() could summarize textual fields by simply concatenating them : eg a table named 'lessons' contains Lesson Teacher math Mr. Brown history Mr. Brown math Ms. White gym Mr. Green geo Ms. White so I ...more >>

How could I do that (Query)
Posted by Yannick Turgeon at 9/26/2003 2:59:56 PM
Hello all, I'm using SS 2000 Based on the following query, how could I get only one row for each different field "F1"? I don't want to use temp table. ---------- SELECT ??? FROM ( SELECT 'A' AS F1, 1 AS F2, 10 AS F3 UNION ALL SELECT 'B', 2, 12 UNION ALL SELECT 'B...more >>

How can i get a return code of 1 for an osql command which has a lower severity..
Posted by ajayz90 NO[at]SPAM hotmail.com at 9/26/2003 1:10:09 PM
I am running the following OSQL command and capturing the return code for the error .Whenver i have an error like server not exists or uable to login I get a return code of 1 for the %ERRORLEVEL%.However whenever I have an errorof a wrong dbcompatibility error the retun code id 1 even though sql...more >>

Duplicate records are being inserted with one insert command.
Posted by georgem NO[at]SPAM crystalgraphics.com at 9/26/2003 11:14:03 AM
This is like the bug from hell. It is kind of hard to explain, so please bear with me. Background Info: SQL Server 7.0, on an NT box, Active Server pages with Javascript, using ADO objects. I'm inserting simple records into a table. But one insert command is placing 2 or 3 records into t...more >>

Bulk Insert - Cannot perform SET operation.
Posted by cladre NO[at]SPAM hotmail.com at 9/26/2003 10:34:05 AM
I am trying to use Bulk Insert for a user that is not sysadmin. I have already set up the user as a member of "bulkadmin". When I run the following script: DECLARE @SQL VARCHAR(1000) CREATE TABLE amdbo.#temp ( [id] [varchar] (10) NULL ,[fld2] [varchar] (10) NULL ,[fld3] [varchar] (...more >>

DEFAULT keyword performance
Posted by JayCallas NO[at]SPAM hotmail.com at 9/26/2003 9:55:34 AM
I have a function which performs a query and returns a table. The one parameter that can get passed in is a date which defaults to NULL. There is an IF statement in the function that will set the paramter to an actual date if null. If I call the function while passing in a date the function come...more >>

Alter table permission to dbo
Posted by masri NO[at]SPAM vsnl.com at 9/26/2003 7:34:21 AM
I have the following requirement I am creating a login and database user 'test' on a database with dbo role . I want to remove create table , alter table permisions to this user. I am able to revoke create table permission but alter table goes through. I gave a command deny insert,delete,...more >>

Looking for physical design suggestions...
Posted by Alexey.Aksyonenko NO[at]SPAM coanetwork.com at 9/26/2003 7:12:25 AM
I got a server that has a RAID-5 array partitioned into C: and D: drives (OS Win2K Adv. Server installed on C:). The server also has a mapping to a NAS device using the latest protocols that trick the system into thinking the map is actually a local SCSII drive. That's drive X:. This server i...more >>

Problems installing SQLServer 2000 Developer Edition on Windows XP Pro
Posted by Daniel Kim at 9/26/2003 6:41:53 AM
Hello! When trying to install SqlServer 2000 Developer (as Administrator) on my Windows XP Professional I get the following message at the point where the system asks Local Account or Domain account: The logon account cannot be validated for the SQL server service. Verify that the user na...more >>

DTS import renames my SPs to previous names
Posted by serge at 9/26/2003 6:19:24 AM
I am using SQL Server 7 SP4. I have created a blank database in which i am trying to import using DTS wizard all tables/views/stored procedures without any DATA (records). I keep getting different errors when importing the views and/or the SPs. I've tried many things unsuccessfully. Now e...more >>

Concatenating a field while grouping records
Posted by dshokes NO[at]SPAM cox.net at 9/26/2003 5:56:56 AM
All, Given multiple records with identical values in all fields except a single varchar field, is there an efficient query that will group the records into a single record and concatenate the aforementioned varchar field into a single field with each of the source records' values separated by...more >>

Two int fields or one varchar field
Posted by foooool NO[at]SPAM hotmail.com at 9/26/2003 4:05:18 AM
I am setting up a database that will receive a lot of data from two separate telephone centers, the log table will in a short time have over 1 million lines, and I was wondering if I should use 1 identify field or two: case 1: [Id] [int] IDENTITY (1, 1) NOT NULL [ServerId] [int] NOT NULL ...more >>

Which one to buy?
Posted by manish NO[at]SPAM bullnose.co.uk at 9/26/2003 2:34:34 AM
Hello Please help me as i am quite new to this. I intend to buy SQL 2000 but dont know which one to get. developer/standard/enterprise. I want to develop databases for multiple clients for their websites but i dont wish to host them in-house as I will put them in web-hosting servers whic...more >>

SQL 2000 Server Hangs...!
Posted by senthurs NO[at]SPAM yahoo.com at 9/26/2003 1:51:04 AM
Hi, The SQL server 2000 Server hangs some times. It is not periodic. It is not specific in any queries, which are taking more time to execute. Because, it is occurring for different types of applications on the same server on different machines. For the same applications when we had the SQL S...more >>

Am I being role happy?
Posted by Me at 9/25/2003 10:25:36 PM
I'm working on the security portion of this vb app. In the application the user is presented with a list of commands that can be executed on a piece of data. My client wants to be able to block certain users from seeing certain commands on their screen. The commands are loaded into a listv...more >>

Strange database deadlock
Posted by mpong_imail NO[at]SPAM yahoo.com at 9/25/2003 8:22:30 PM
Hi, I had a deadlock situation on SQLServer 2000. When I look at the Locks / process ID screen on Enterprise Manager, for one of the session, I see the object being one table and the index is on another totally unrelated table's primary key. This is really odd since there are no foreign key...more >>

Multiple selects on same column, same table, one query
Posted by JackT at 9/25/2003 7:24:16 PM
I want to get a column count several times in one query using different filters but can't work out how to do it - can anyone point me in the right direction? For example, how would combine these two selects into one query that will list the total and filtered actions: SELECT COUNT(actions) ...more >>

Bulk insert of long unicode strings
Posted by Ty at 9/25/2003 6:24:58 PM
Here is the situation, please let me know if you have any tips: ..TXT files in a share at \\foo SPROCS run daily parses of many things, including data on that share. The other day, we encountered rows in the TXT files which looked like: column1Row1data,column2Row1data column1Row2data,col...more >>

To make an existing column become an identity column
Posted by Gunnar Vøyenli at 9/25/2003 1:53:20 PM
Hi (SQL Server 2000) I have an existing table (t) with a column that is NOT an identity column (t.ID), but it has manually inserted "row numbers". I want to make this column become an identity column. This column is a key field to other tables, so I want to keep the row numbers that are allre...more >>

Question re: multiple joins
Posted by Pejo at 9/25/2003 12:08:53 PM
Table Users FName(text), LName(text), UserID(number) Table Correspondence. Date(datetime), msg_From(number), msg_To(number) Table Users Data John, Quincy, 1 Jane, Doe, 2 Table Correspondence Data 2/2/2002, 1, 2 Ideally the query would return a Record that would look like. 2/2/2...more >>

Query Performance Problem
Posted by JayCallas NO[at]SPAM hotmail.com at 9/25/2003 10:37:00 AM
The following stored procedure is taking too long (in my opinion). The problem seems to be the SUM line. When commented out the query takes a second or two. When included the response time climbs to minute and a half. Is my code that inefficient or is SUM and ABS calls just that slow? Any sug...more >>


DevelopmentNow Blog