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 > september 2003 > threads for tuesday september 9

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

What to do?
Posted by Arjen at 9/9/2003 10:52:13 PM
Hello, I have a table with a lot of records. The records can be selected/update/inserted/deleted with a XML webservice. On the same time: One user select * records. Second user update record x. This means that the index has changed.... and posible the first user has wrong data. What ...more >>


cyrillic data in database
Posted by gian-carlo at 9/9/2003 10:23:20 PM
I need to realize a database interfaced to the web this database is the classic products, descriptions, prices and so on and in several languages as Italian, French, English and ( and that is my problem ) in russian(cyrillic) so I need help thanks for any kind of info ...more >>

Check command
Posted by Arjen at 9/9/2003 9:18:44 PM
Hello, When developing a software application with database access are the most developers using the command check or are they checking values inside the business logic? Thanks! ...more >>

is it helpful to "Prime" a Stored Procedure?
Posted by rooster575 at 9/9/2003 8:48:04 PM
So that users do not experience a time-delay while a stored procedure runs for the 1st time, would it help to run a heavy stored procedure with arguments that will not return values (such as zeros) in advance, so that when a user actually uses the SP, it will already be cached? Thanks. ...more >>

Can't find a happy median
Posted by Gabicus at 9/9/2003 7:10:50 PM
Hi, I have written some code to find the Average score, only to find that I need to be looking for the Median score. I am not sure how I would go about getting the median instead of the average. This is what I wrote. Does anyone have any suggestion on what would be the best way to chan...more >>

Median Query in SQL Server 2000
Posted by Steven at 9/9/2003 7:05:06 PM
Hi - Does anyone know how to calculate for Median in Transact SQL? I have searched various websites, books, etc and can only find code that uses one column. I need to be able to have two coloumns: Table: ID # 1 Item # 1 5.00 ID # 2 Item # 1 8.00 ID # 3 Item # 1 6.00 ...more >>

SQL JOIN SYNTAX
Posted by MAB at 9/9/2003 6:48:39 PM
Erland Sommarskog <sommar@algonet.se> wrote in message news:Xns93EFA9C57954AYazorman@127.0.0.1... > MAB (fkdfjdierkjflafdafa@yahoo.com) writes: > > What I want is the sum of the amounts of the last payments of all > > customers. Now the last payment of a customer is not necessarily the one > > ...more >>

nochmals ein locking-problem
Posted by Jonas Knaus at 9/9/2003 5:59:07 PM
hallo zusammen... ja..ich komme nochmals mit einem locking-problem ich gabe folgendes versucht select * from tblAdresse with (updlock) where adrNummer = '1' leider lockt es mir so jeden reccord in der tabelle, dabei möche ich nur den datensatz mit adrNummer = '1' locken... ich habe es ...more >>



Can't link to Server using Enterprise manager
Posted by Nick Stansbury at 9/9/2003 5:45:40 PM
Hi, This is a follow on earlier thread. Previously unable to create linked server or run ad-hoc distributed queries against it. Now have discovered that if I am physically located at the local server I can run xp_cmdshell 'ping XXX.XXX.XXX.XXX' <thanks Tom> but despite creating the relevant ...more >>

WHERE CURRENT OF seems to not be working as advertised
Posted by K. Shier at 9/9/2003 5:04:31 PM
ALTER PROCEDURE dbo.ProcessAdminTransactions /* iterates through each unprocessed 'ADMIN' transaction and subtracts the Amt. from the related Contract's DirectDepositAccount. then sets the PostDate of that transaction to the current date/time */ AS DECLARE @Trans_cursor CURSOR DECLARE @C...more >>

Cursor returning last row twice
Posted by Nick Stansbury at 9/9/2003 4:44:52 PM
Hi, New to cursors. My first stored procedure is returning the last row twice. Anyone have any ideas why? Code follows: Thanks Nick set nocount on DECLARE curPayCount CURSOR FOR select PAY.payId from tev170payments as PAY inner join tev160charges as CHARGE on PAY.chargeID = CHARG...more >>

Slow query
Posted by Simon at 9/9/2003 4:29:33 PM
I have this select in my SP, but it's extremly slow? Does anybody know what to do? Maybe change the sintaks or use index tunning wizard - by the way, how to load this SP into index tuning wizard? select T3.* FROM (select sum(T2.vir) as vir,T2.kupec,count(T2.ID)as vsiRacuni,sum(T2.ostaloV)as os...more >>

Is there a better way than a cursor?
Posted by Tom Celica at 9/9/2003 4:23:47 PM
My Goal is to write a query that will find any city state combination in LocationSource where that combination does not exist in the Subset Table Tables: LocationSource, Subset Colums: LocationSource.State, LocationSource.City, Subset.State, Subset.City To solve this problem,...more >>

How do I read a hyperterminal text file to a SQL Table
Posted by Brian at 9/9/2003 4:14:20 PM
Hi I need to read a hyperterminal text file continuously from a caller ID box into a SQL table and trigger events on changes in the information. How do I do this. Thanks in advance Brian I could communicate with the device directly if someone knows how to do that. Brian...more >>

T-SQL
Posted by Dishan at 9/9/2003 3:30:20 PM
Hi all this is my question??? Create table #T1( id int ) Create table #T2( id int ) INSERT INTO #T1 VALUES (1) INSERT INTO #T1 VALUES (2) INSERT INTO #T1 VALUES (NULL) INSERT INTO #T1 VALUES (NULL) INSERT INTO #T2 VALUES (1) INSERT INTO #T2 VALUES (4) INSERT INTO #T2 VALUES (NU...more >>

TOP N question
Posted by Derek Ruesch at 9/9/2003 3:20:40 PM
I have the following table: tbl1 ID(Int-PK) Name ProjectNo 1 Steve 10 2 Mark 10 3 Dave 10 4 Ryan 20 5 Dennis 20 6 Mike 20 7 Ted 30 8 Ken 30 9 Elvis 30 I...more >>

update on the fly?
Posted by SSP at 9/9/2003 3:16:46 PM
Dear SQL Server Programmers I have a table called "tblX" with the following structure: ---------------------------------------------- XID | XScore | XOID ---------------------------------------------- 111111 0 1 22222...more >>

Configured for DATA ACCESS?
Posted by TJ at 9/9/2003 3:06:13 PM
Any ideas why I might receive the noted error when executing the following from QA? DECLARE @DBN varchar(30) SELECT @DBN=DB_NAME() SELECT 'Searching ... ' + @DBN EXEC sp_indexes @table_server = @@SERVERNAME, @table_catalog = @DBN, @is_unique = 0 --------------------------------...more >>

Variables in SQL Statements
Posted by Darrell Wright at 9/9/2003 3:01:42 PM
I have declared and set a variable in a stored procedure. I am now trying to use that variable in a 'BULK INSERT' statement as: BULK INSERT dbo.W3SVC3_INTERNAL FROM @pLogFileName WITH (FORMATFILE = 'C:\iis_log_formatfile.fmt', FIRSTROW = 4) I keep getting this: Msg 170, Level 15, Sta...more >>

CURSOR PROBLEM , Database timeout, Multiple Users
Posted by daniel.hynes NO[at]SPAM bcnepa.com at 9/9/2003 2:55:15 PM
Hello, I recently wrote a survey application. Each question is very similar. The first questions gives me a problem when there are multiple people taking the survey (The Database connection Timed out) I am using the Data Access Application Blocks as ASP.NET (using VB.NET) and SQL 2000. I...more >>

Delete question
Posted by JasonH at 9/9/2003 2:05:23 PM
Ok, got another that has me stumped. A field in my table is datatype INT - field name is optnum. I want to do a "mass deletion" of records based on a comma separated list of numbers received from a ASP web page form. In query analyzer, this will work: delete from MyTable where optnu...more >>

How to enumerate records in a group
Posted by Meir at 9/9/2003 1:28:54 PM
Hello, I have the following example: CREATE TABLE [dbo].[Table1] ( [DictionaryId] [int] IDENTITY (1, 1) NOT NULL , [Explanation] [char] (50) NOT NULL , [Type] [char] (3) NOT NULL ) INSERT Table1(Explanation,Type) VALUES('A','N') INSERT Table1(Explanation,Type) VALUES('B','V') INSER...more >>

deadlock
Posted by Andre at 9/9/2003 1:24:54 PM
I have a relatively simple query that is giving me a deadlock error. The query is as follows: select distinct o.systemnumber as SystemNumber, s.description as SystemName, nc.short as NetworkChannelNumber, convert(varchar(10), o.showedon, 101) as ShowedOn, Title = t.title, sum(o.reco...more >>

error creating temporary table inside if then...
Posted by Tariq Ahmad at 9/9/2003 1:16:22 PM
hi, i am trying to create a temp table called #STOCKLIST2 inside a stored procedure. the way it is created depends on some other critera. i would expect this code to work cause the table will only ever get created once, yet i get this error message: Server: Msg 2714, Level 16, State 1, P...more >>

Tables & Stored Procedures
Posted by Avi G at 9/9/2003 12:55:05 PM
Hi. I was wondering the following: Each developer uses tables and stored procedures in SQL Server 7.0. What we want is to create sort of a 'versioning' system that will version the table structure and stored procedures at a given time. Is this possible, and if so, what methods exist that wil...more >>

Jobs big problems...I can't run them!
Posted by fabriZio at 9/9/2003 12:54:49 PM
Big problem here.... Scenario: One w2k ITA standard server sp4, web-server with IIS and SQL Server ITA sp3 installed, no domain. Recently I have done following things: 1) I have changed tha password for Administrator of the server. 2) I have created a new SQL user that I made sysadmin,...more >>

Make DBO a member of a role?
Posted by Arthur Hoornweg at 9/9/2003 12:53:07 PM
Hello World, I'm trying to make myself, the dbo of a database, a member of a role in MS SQL server 2000 but it won't work. The reason is that I need a listbox in my application that lists all users that are members of that role so that I can give these users specific privileges in the appli...more >>

intermittent performance problems
Posted by dk NO[at]SPAM realmagnet.com at 9/9/2003 12:50:14 PM
I have a SP that I use to insert records in a table. This SP is called hundreds of times per minute. Most inserts complete very fast. And the profiler data is as follows: CPU: 0 Reads: 10 Writes: 1 Duration: varies from 1 to 30 But once in a while the insert SP seems to stall and takes ...more >>

select question
Posted by cshow at 9/9/2003 12:46:31 PM
What I'm trying to do is pull back all vendor contracts of type vendtype where standard='Y' and compare that against the list of standard contracts(custandard) of "N'. I want know if there are 13 buildings with standard service contracts (e.g Entity 101 has the following contracts: HVAC, Car...more >>

TSQL puzzler - how to get only one of a type
Posted by Puget4753 NO[at]SPAM yahoo.com at 9/9/2003 12:35:10 PM
Hello, and appreciate any ideas here. I have a table of different types of phone numbers, and am trying to get one of them back - first the home if available, then business, then cell, then fax. Here's the scripts: create table Person ( PersonID int ) create table PersonPhoneNumber (...more >>

more query help
Posted by Bite My Bubbles at 9/9/2003 12:16:39 PM
Hi, I don't quite get this one. I need a results table that shows ItemNO, Cost, Count_of_This_Cost_Until_The_Cost_Changes Can you help? thanks! create table test1 ( idno int NOT NULL IDENTITY (1, 1), itemNo int, cost money, thisdate datetime) insert into test1 (itemNo,...more >>

Update Table A on the basis of Table B
Posted by Richard Davies at 9/9/2003 12:14:27 PM
Hi This must be a FAQ, but I can't find anything in the archive. I have 2 tables. Products and Stock. I want to update a value in Products using a query based on data in Stock and Products UPDATE dbo.tblProduct SET ProductAvailabilityID = 2 WHERE (tblproduct.ProductID...more >>

Parsing comma separated or delimited values
Posted by Kevin Lorimer at 9/9/2003 11:31:24 AM
I have looked at the posts describing various ways to parse a delimited string and separate the values but cannot find any that would solve the following problem. ~ = Field Separator ^ = Multi-Field Separator Input Data Field 1 = 'Apples~Oranges~Pears' Field 2 = 'Small~Small^Medium~Medium...more >>

How do I correct dependency issue?
Posted by Ricardo Forde at 9/9/2003 11:04:04 AM
Hi. Whn i try to display the dependencies for User Defined Types I do not see any. I now that they are since the original DB had. Can i put them in manually? Or is there anything I can do to make the dependencies appear? Any help at all would be great. *** Sent via Developersdex http://...more >>

Combining multiple rows into a single row
Posted by knhaynie NO[at]SPAM adelphia.net at 9/9/2003 10:28:59 AM
OK...I really need some help from all you SQL gurus out there! I have a table of players. Each record in this table represents a player who belongs to a particular group identified by the column called GROUPID. What I'm trying to do is to build a view which combines all players in a particul...more >>

replace
Posted by mahesh at 9/9/2003 10:10:10 AM
is there any way to force the replace function to replace the first match only. e.g. I have mahesh bhatt S I want it to be mahesh, bhatt S i.e. replace the first space with comma and a space. Thanks. ...more >>

how to use IsDate with Convert?
Posted by Rich at 9/9/2003 9:39:56 AM
Hello, I imported a bunch of data from a Microsoft Access mdb to a sqlServer tbl. Access tbl has a datefield with a lot of errors so I imported that field as an nvarchar field in sqlserver. The dates all came in as numbers. I want to convert the numbers (in the nvarchar field) back to ...more >>

@@CURSOR_ROWS
Posted by Todd at 9/9/2003 8:47:18 AM
Hi, I have 'cursor theshold' set to -1 (the default). When I run this (just an example): DECLARE curDeleteMe CURSOR FOR SELECT groupid from sysfilegroups OPEN curDeleteMe PRINT @@CURSOR_ROWS CLOSE curDeleteMe DEALLOCATE curDeleteMe I get -1 instead of 1. From what I read, a nega...more >>

Can't retrieve heirarchical recordset
Posted by Brad Wood at 9/9/2003 8:35:52 AM
I have a table with a classic heirarchical self reference like: CREATE TABLE Personnel (emp CHAR(10) NOT NULL PRIMARY KEY, boss CHAR(10) DEFAULT NULL REFERENCES Personnel(emp)); Personnel emp boss =================== 'Albert' 'NULL' 'Bert' 'Albert' 'Chuck' ...more >>

rowcount inside view
Posted by Sarah at 9/9/2003 8:33:49 AM
Is there a way to have a running total of the number of rows inside a view, and reset that on the change of a group? Thanks! ...more >>

can a SP return a Hierarchical Recordset?
Posted by Deke at 9/9/2003 8:12:50 AM
Hi, Is it possible to develope a SHAPE statement within a SP and have it return the Hierarchical Recordset? Thanks Deke...more >>

Variable user entry
Posted by Sam at 9/9/2003 7:36:18 AM
For the printing of certain reports there is a query to accept up to 6 registration numbers: Select ....fields.... where registration_number = {userentry:Enter reg no} or registration_number= {userentry:Enter reg no} etc That was OK but really what is needed is to be able to enter a vari...more >>

any example code please
Posted by shau at 9/9/2003 6:56:27 AM
Hi I am creating a stored proc that should only run on one parameter but you have the oppurtunity of inputing two separate parameters example' either search by custno or invno' but not both..would anyone have any example code as to give me a good idea how to accomplish this task thanks S...more >>

Query to determine if an index is unique.
Posted by jettaboy NO[at]SPAM lycos.com at 9/9/2003 5:32:40 AM
I'm using ERStudio to generate my migration scripts for database. ERStudio is scripting indexes with a DROP INDEX statement even if some of the indexes are unique. Is there a way I could query a table or object to know if the index is unique?. Thanks....more >>


DevelopmentNow Blog