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 wednesday september 17

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

ADSI?
Posted by Frank Dulk at 9/17/2003 10:12:38 PM
How to Access is base for SQL, I tried to rotate the sp_addlinkedserver, but when I try to open the table it accuses mistake of Provider OLEDB and Of the Objeto ADDSOObject. ...more >>


MSDE Default Server
Posted by news-server.nc.rr.com at 9/17/2003 9:52:39 PM
I am running Microsoft SQL Server Service Manger version 8.00.760 I can not seem to figure out how to get this started so that my default trey\netsdk auto starts on when it get run. I set it up using the INSTANCENAME=NETSDK. I can go to the server pull down dialog and enter treys\netsdk and...more >>

Combining output from two stored procedures
Posted by Mike Irwin at 9/17/2003 9:03:27 PM
I've got two stored procedures, 'GetShows' and 'GetActs'. GetShows returns: show_id date venue_name city state venue_www --------- ----------- ------------- ---------- ----- ----------- - 1 1/22/2003 venue A Detroit ...more >>

primary key question
Posted by tony at 9/17/2003 8:24:03 PM
if i create a new table and have a primary key field then i am not able to enter the same value more than once in that column this part makes sense in the northwind [order Details] order id is a primary key but the order ids are repeated in that column how is this possible?...more >>

drop database
Posted by Kevin3NF at 9/17/2003 8:03:17 PM
How can I drop a database that was halfway through a restore when the job was stopped? The system shows it as in use, but sp_who does not list it... ...more >>

Replace * '-' with ' '
Posted by Benjamin at 9/17/2003 7:07:56 PM
I have a table that contains address' within the 'Address' field I would like to do a "FIND AND REPLACE". As I am a complete novice in TSQL, I would like to know how I can do this within the SQL environment using QA. EG: '17-22 Name St' would become '17 22 Name St' Is this possible?...more >>

@@ERROR not getting set
Posted by Laurence Nuttall at 9/17/2003 6:51:07 PM
In SQL server 2000. The following stored procedure. I run it from a VB program using ADO. When the stored procedure fails, an error occurs, the @@ERROR is not getting set. I don't just check for the return-value parameter I trap the error, the error is trapped, but there is no error co...more >>

Locking Question
Posted by London Developer at 9/17/2003 5:28:52 PM
Hi, I have a view, that is accessed through a query through linked table in access. If that makes sense! So, it goes: SQL2K View -> MS Access Linked Table to View -> MS Access Query The query is then used to populate a list box in Access..... If the select statement in the MS Acc...more >>



One big database vs. many small
Posted by Boaz Ben-Porat at 9/17/2003 4:42:07 PM
Hi all My company is going to implement a central database (over Web services) for about 400 shops. We use SQL server 2000 as DBMS. We need to choose between 2 confugurations: 1. One big database for all clients, with one table-set, where each table has a column "ShopId" to identyfy the ow...more >>

Help with Stored Proc.
Posted by Peter Griffin at 9/17/2003 4:25:00 PM
I cannot get this SP to return a single value when calling from VB> CREATE PROCEDURE dbo.sp_tmpTableExist (@tableName varchar(20), @Stat int OUTPUT) AS IF OBJECT_ID('tempdb..' + @tableName) IS NOT NULL SELECT @Stat = 1 ELSE SELECT @Stat = 0 SELECT @Stat GO Any ideas? ...more >>

T-SQL Debugger Message
Posted by Tom at 9/17/2003 3:53:20 PM
I am developing a program with VB6, MDAC 2.6, SQL2000 and using Exchange data. I have a call to a stored procedure that is working properly some of the time. The times it isnt working properly it is opening a message box with this title "T-SQL Debugger" with the following message: "The Quer...more >>

Processes big problem
Posted by Virgil Trasca at 9/17/2003 3:45:46 PM
I have a client using my application written in Delphi with SQL Server. My log indicates Maximum number of DBPROCESSes already allocated and I can see that I have 250 sleeping processes in their SQL Server process information screen. My application is set to connect 1 tim...more >>

Retrieving nested values
Posted by Wayne Sheffield at 9/17/2003 3:44:48 PM
For the following DDL and data... if exists (select * from sysobjects where id = object_id('BUSINESS_GROUP') and sysstat & 0xf = 3) drop table BUSINESS_GROUP GO CREATE TABLE BUSINESS_GROUP ( business_group_seqno int NOT NULL , business_group_value varchar (15) NOT NULL , bgt_name var...more >>

Another query
Posted by Adel at 9/17/2003 3:31:57 PM
I have 2 tables 1-Clients table which has 2 fields (client_id (key) and client_name) 2-Work_order table has(work_order_no (key),client_id (F. key),Amount) So as you can guess it's one to many relation between these 2 tables, since one client can have more than a work order client...more >>

Prefix object names with sp, tbl, vw e.t.c
Posted by London Developer at 9/17/2003 2:39:48 PM
Hi, Is it good SQL Programming practice to preceed stored procedures with "sp" - e.g sp_InsertAddress and views with vw_AddressList and tables with tblAddresses ? Are there any guidelines on this or strong opinions? Thanks ...more >>

exiting an osql batch
Posted by Will Mullen at 9/17/2003 2:35:48 PM
how do i get the osql utility to exit and return control back to the command line when i run a batch query against it? At the DOS command prompt, if I type: osql -Usa -Smysvr -Pmypwd -q"select @@servername" the result is mysvr 1> my DOS shell is stuck inside the osql utility instea...more >>

is there any array (or arraylist) in sql?
Posted by Sean at 9/17/2003 2:18:16 PM
I need to return some values from a select statement. I want to assign the return value to an array, and loop through the array. I know the cursor may work, but I am not familiar with cursor. Is there any other easy way to do it? Any idead? Many thanks. ...more >>

Not Null Constraint
Posted by Franck Jobard at 9/17/2003 2:16:54 PM
Hello, I would like to know the syntax to create a "NOT NULL" constraint on an existing column I try this syntaxe without success : Alter Table ADRESSE ADD CONSTRAINT ADRESSE_Not_null NOT NULL Thanks for your help Franck P.S : This answer as been duplicated in french on microsoft.pub...more >>

MSGBox Equivalent, or make RAISERROR Friendlier
Posted by BillC at 9/17/2003 1:51:40 PM
greetings when running a stored procedure i'd like to monitor a 'total-available' field and notify the user if the value goes below zero. this is not fatal, but i'd like the user to be made aware of the condition and then continue on. RAISERROR('blahblah',16,1) performs...more >>

Non-Clustered Indexes not Populating with New Rows
Posted by Vince at 9/17/2003 1:39:49 PM
I have some simple SQLServer 2000 tables with non-clustered indexes such as a unique integer that should be populating when records are added. I can see that the primary key gets populated of course but the indexes do not: SELECT rowcnt FROM sysindexes WHERE id = OBJECT_ID('Tasks') I get ...more >>

paging---for a website
Posted by SStory at 9/17/2003 1:28:14 PM
Is there a way to use SQL Server to do paging for a website. Datasets for the datagrid have the failing of loading all records each time--with lots of records this is not feasible on a rented host. I was wondering. Could I call the same query multiple times and ask for records 20-40 of the...more >>

open connections
Posted by Jonas Knaus at 9/17/2003 1:03:01 PM
hi there i made a c# application. now i am not shure if the application closes all open connection right. is there a toll or something in the entrprisemanager which helps to see if there are remaining open connections ??? thank you very much for your help jonas knaus ...more >>

Newbie question on calculated fields in tables
Posted by Kim Dupre at 9/17/2003 12:53:30 PM
I need to create a table containing both text & numeric fields. The user will put numbers into the numeric fields and will need to have a calculated result appear in a subsequent field (basic addition, subtraction, division type stuff). Do I create these numeric fields as an integer type...more >>

SQL query
Posted by Shakti Tripathy at 9/17/2003 12:53:06 PM
Hi If a have a table like this idno description 5 alpha 7 beta 9 gama how can I get this result set using one select statement <column> idno description 1 5 apha 2 7 beta 3 9 ...more >>

Foreign Key Syntax
Posted by Sherman Smorth at 9/17/2003 12:31:15 PM
Hello What is the syntax for create a table with one column and making a foreign key that refernces another table? Create table Test (Number1 Varchar(45) Foreign Key (Test2) Something like that i guess...more >>

Selecting RANDOM and TOP10
Posted by Arda at 9/17/2003 12:22:50 PM
Hi all, I need some example statements(sqlCommands) for ; 1.. Selecting a RANDOM row(cell) from a table, 2.. Selecting TOP 10 row (e.g. First 10 records,descending int) from a table Any help will be appriciated Kind Regards, Arda ...more >>

Improve performance: changing data type from int to bit?
Posted by inzy 2000 at 9/17/2003 12:13:21 PM
I've this table called "Accts" that has more than 4 millions records stored in it. The table has a field called "Category" which is of type INT. It has only 0s and 1s stored in it. I've set a PK on "Accts" table which is based on the composite key (ID,Category). The developers use the "Category"...more >>

10' 1" (Ten Foot One Inch)
Posted by JoeShmoe at 9/17/2003 11:53:55 AM
Suddenly ran into a problem with this query. I have been doulbing up on the single quotation marks. When I run this one it fails. I am entering the value as a varchar parameter via a store procedure... Error.Description Incorrect Syntax Near '101'.'' Ex. '@ControlName Set oPa...more >>

Partition Table : SQL Server 2000
Posted by Venugopal Vemuri at 9/17/2003 11:43:50 AM
Hi, I want to partition a table horizontally based on the year ( e.g. 1999). Can u let me know or put me to an article that will give information as to how to do it, advantages/disadvantages, and how to access information after partitioning. An early reply would be appreciated. Regards...more >>

where EXISTS / NOT EXISTS do not work (I am really pannic)
Posted by David N at 9/17/2003 11:37:37 AM
All, This WHERE EXISTS () in this UPDATE statement does not work UPDATE SERVER SET active_flag = 'F' WHERE EXISTS (SELECT 1 FROM DELETED_SERVER DS (NOLOCK) WHERE DS.server_id_s = SERVER.server_id_s) It sets every record in my SERVER table to 'F'. When I change the statement t...more >>

How to do join inside a case statement
Posted by Sam at 9/17/2003 11:32:53 AM
How to do join inside a case statement Example CASE WHEN @mSupCoun = '' THEN 1 ELSE CASE WHEN t.ClinNo IN (SELECT ClinNo FROM tblClient WHERE SupCounNo = @mSupCoun) THEN 1 ELSE 0 END END = 1 How can I replace clinno in the above with the join on clinno instead? Thanks...more >>

quick way to select data from large table
Posted by LamP at 9/17/2003 11:28:01 AM
Hi Helper, I only want data for the previous 2 days from a very large table. It takes a long time for table scan. Is there a faster way to pull the data without creating temp table? Thanks, LamP...more >>

Bulk Insert Error
Posted by alonlydad NO[at]SPAM hotmail.com at 9/17/2003 11:09:20 AM
We are migration from SQL Server 7 to 2000. While the Bulk Insert works in Ver. 7 it does not work in 2000. There error I am getting is: Bulk Insert data conversion error (type mismatch) in tow X, column 7(SubId). Here is the Format File: 7.0 7 1 SQLCHAR 0 3 ...more >>

Notify When Agent Fails?
Posted by Frank Py at 9/17/2003 11:05:11 AM
Is there a way I can send an e-mail when the agent fails? Help appreciated. Thanks. Frank *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!...more >>

Basic SQL User Stats
Posted by Dave Slinn at 9/17/2003 11:04:41 AM
Is there a tool, either MS or third party, that gives me a breakdown of user statistics, such as how much of the CPU cycles and disk activity is attributed to each user on SQL? We periodically experience massive slowdowns on our system, and when I pull up performance monitor, the CPU cycles and...more >>

Indexing with bit fields
Posted by Kevin Jackson at 9/17/2003 10:54:55 AM
How come Enterprise Manager won't let you create an index on a bit field but you can do it with a CREATE INDEX statement? ...more >>

Updating using table aliases
Posted by Rob C at 9/17/2003 10:38:58 AM
I am trying to do an update to a table that uses aliases. I am able to do a SELECT and get the right records. Now I want to do an update on these records and am having trouble with the syntax. The SELECT is as follows: SELECT * FROM BedStatus BS1 INNER JOIN BedStatus BS2 ON ...more >>

Need Help
Posted by niitmalad at 9/17/2003 10:11:54 AM
Dear Friends I have write the following procedure ALTER PROCEDURE dbo.ProformaInvoiceReport_UpdateVL (@InvoiceNumber varchar(7)) AS SELECT BNKCHRGS, sumcn, Commission1, cpcb, THC, SUMPCAMT, InsuCrgs, MATERIALCOST, DIV, MCDIV, NETQTY, ftamt, THCCURR, baf, PcCurr, INVCURR, ...more >>

SQL Query
Posted by Adel at 9/17/2003 10:10:52 AM
Hello guys I have created a SQL query to retrive data from 4 tables, I used Left outer join to have thr right result , every thing is fine, except that I would like to not repeat some data from row to another row Ex: Disp# w/o Trip container Len Hi wgt truck ----- ---- ---- ...more >>

Group by week
Posted by Andy Williams at 9/17/2003 10:05:16 AM
I have the following statement which returns the total dollars shipped for each day. Is there an easy way to group this by week? SELECT OrderHeader.DateShipped, SUM(OrderSubtotals.Subtotal) AS Total FROM OrderHeader INNER JOIN OrderSubtotals ON OrderHeader.FBNumber = OrderSubtot...more >>

Check if two of five fields are "true"
Posted by Michael Ramey at 9/17/2003 9:38:22 AM
Hello I'm working on an authorization form, and I need to see if there are at least two "true" out of 5 possible columns. Each of these columns represent approvals by managers. I know I can write a long sql statement, to check every field with every other field, but that seems overkill. Is ...more >>

VB.NET Retrieving Identity form MSSQL2000 without using stored procedures
Posted by Taras at 9/17/2003 8:56:58 AM
Hello! I have a problem. I'm using a dataset in VB.NET with multiple tables with relations between them. I would like dataset to update to all related tables with right identity, when certain record is added. The problem is that I don't know how to do it, when I'm not using stored procedures....more >>

Interesting Query
Posted by phil at 9/17/2003 8:10:51 AM
Hi All, Just wanting to know if someone can help me, I have one table where I want to count the number of times a value appears and show what that value is, this is the easy bit, I also want tp join the table to another one, where the one value can appear another of times but take the max da...more >>

update another table with result value
Posted by Niitmalad at 9/17/2003 8:05:52 AM
Dear Friends I have created a store procedure which calculate the Cost price from purchase table as. Netqty*rate=Costprice I want to update the sales table field with cost price. Please suggest how i can achive the same. Your earlier action will be helpful. Best regards Niitmalad...more >>

SQLDMO scripting
Posted by rob at 9/17/2003 7:18:49 AM
Hi I'm trying to create a script for a table using SQLDMO. I have used DMO many times in the past but I have never been able to script only the table schema, that is so that it doesnt include the primary keys, constraints. I only need the schema. I cannot seem to find any script option th...more >>

is this possible w/o using dynamic sql?
Posted by FH S at 9/17/2003 6:54:50 AM
Hi! please see below the ddl and sql code, i was wondering if this is possible i.e. combining records of ID 7 and 16 without using dynamic SQL. please let me know. thank you. create table #t(id int,amt money) insert #t values (7, 10) insert #t values (16, 20) declare @ID i...more >>

SP_Tables, SP_Columns sp_?
Posted by Jonesgj at 9/17/2003 6:01:19 AM
I have a simple VB.NET app which returns all the tables in a selected database into a listbox using Sp_Tables, and then the columns of the selected table into a listbox using Sp_columns. What I would like to do next is allow the user to see the properties of the column they select, but I cannot ...more >>

alias column query
Posted by shau at 9/17/2003 5:19:31 AM
Hi I am trying to retrieve all customers with a positive outstanding balance as the column I am referencing only exists in my query if I do where 'outstanding balance' <> '.00' I still get customers with 0 balance does any one know of a way round this problem..thanks select c.custno,...more >>

query an alias column that only exists in the query
Posted by shau at 9/17/2003 3:51:34 AM
Hi I dont know if this is posssible but I want all customers with a positive outstanding balance where I entered 'where 'outstanding balance' <> '.00' 'this does not work does anyone know how to search an alias coumn that only exists in the query ? thanks for any help select c.custno, ...more >>

Managing Multiple Versions of databases
Posted by Timb at 9/17/2003 3:48:35 AM
Hi, We are currently developing a EPOS system which will be rolling out to 60+ stores over the next year. This means we will need to manage version of the database so we know which site has what version when applying updates. We currently have release history directory on our serv...more >>

SQL to retrieve views, sp's and tables
Posted by Julie at 9/17/2003 3:07:20 AM
Hello, Apologies if this is a re-post but my orgininal post did not come on. I was wondering if some nice kind person could help me with a query. We have two databases Development and Test. Test gets its structure from Development. I would like a view in Test which would look in ...more >>

Can Extended stored procedures return metadata (2)
Posted by Leonid at 9/17/2003 1:29:15 AM
>Subject: Extended stored procedures and metadata From: "Leonid" <leonid.sokolovsky@pulsetrain.con> Sent: 9/16/2003 11:14:04 AM >Hi >is it possible to return metadata information from extended stored procedure? So when it is executed with SET FMTONLY ON metadata informatio...more >>

DDL operations in PL/SQL
Posted by atmakurisekhar at 9/17/2003 1:01:03 AM
Why PL/SQL has been designed in such way that it doesnt allow any DDL operations? Ofcourse there is Dbms_Sql package to do that.. -- Posted via http://dbforums.com...more >>


DevelopmentNow Blog