all groups > sql server programming > july 2003 > threads for sunday july 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
COUNTING PROBLEM !!!
Posted by Olaf_Bönning at 7/6/2003 10:58:03 PM
I have a serious problem: Each time I run the following=20
query the count result is changing!
SELECT count(*) from posnad WHERE lfn_pos IS NULL
lfn_pos is defined as an 'int' and used as a foreign key.
The table is quite big (8,000,000 rows) and the count=20
result should return about 1,60... more >>
Performance tunning in SQL Server 7.0
Posted by Ebron at 7/6/2003 9:13:41 PM
Hello,
In SQL Server 7.0, we are having a stored procedure to
select the records and insert into another temporary
table. In SQL server, there are two query formats
available.
1. INSERT......SELECT
2. SELECT....... INTO
Which one is performance wise good?
In SQL Server 7.0, we are ha... more >>
Replace character in SELECT results
Posted by David at 7/6/2003 9:05:42 PM
Hi,
I have a SELECT statement of multiple columns from joined tables. One of
the columns is an address field. It is one field that contains the name,
street address, city, state, zip each seperated by a linefeed (Oa)
character. I am trying to print the results of the SELECT statement and
t... more >>
Nesting IF's in Stored Proc
Posted by Gary at 7/6/2003 8:57:35 PM
I am getting an error on a nested IF statement. Is this not possible in a
stored procedure?
For example;
Create Procedure Test
@Variable VARCHAR(10)
AS
If @Variable = Whatever
BEGIN
If (Select Count(*) from Table)) > 0
BEGIN
INSERT INTO Table.... more >>
How to write this query... please help!
Posted by Paul Dussault at 7/6/2003 7:26:57 PM
Hi all,
I can't find my way out of this little problem and my deadline is coming
fast... So if someone could help me out...
I have 2 tables, say:
tblCategories(category_id, category_name)
and
tblItems(item_id, category_id, item_name)
in a one-to-many relationship: each item in tbl... more >>
using 'exist'
Posted by Arvind at 7/6/2003 2:43:40 PM
GO
select * from publishers where exists (
select distinct * from titles where titles.pub_id =
publishers.pub_id and type = 'business'
--select distinct * from titles full outer join publishers
on titles.pub_id = publishers.pub_id where type
= 'business'
)
select * from publishers where... more >>
Trace statements executed by ASPs
Posted by Raymond Du at 7/6/2003 1:18:31 PM
Hi,
I have a website that has about 200 ASPs, a lot of these ASPs send SQL
statements to a SQL 2000 sever for execution, is there a way to trace which
ASP is issuing which statements?
I would like to know if it's possible to trace from SQL server side. Of
course I can modify all ASPs to i... more >>
Index problem with Update
Posted by Jason Davis at 7/6/2003 1:11:11 PM
I have two tables (Product and Category).
Product has 2 columns: Product_temp_category_id and
Product_final_category_id
Category has 2 columns: Category_id and Category_default (int)
I'm trying to improve this query. Overall it is updating the Product table
with a final_category_id (from Cate... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Temp table question
Posted by Uri Dimant at 7/6/2003 12:08:52 PM
Hello!
I need someone will shed light on this strange behaviour of temp. table
SQL 7.0 (sp2) on NT4.0
I try to create #tem. table with follow syntax.
CREATE TABLE #Items1 (
Id int INT NOT NULL ,
ItemId int NOT NULL ,
CONSTRAINT PK_Items1 PRIMARY KEY NONCLUSTERED
(
Id
)
)
A pr... more >>
Stored procedures and database in the table
Posted by Bhupesh Saini at 7/6/2003 11:42:56 AM
I have read somewhere before that if the data in the table
changes due to inserts and updates, it is beneficial to
recompile the stored procedures accessing those tables.
this would help a a new query plan being generated for the
stored procedures and help in perfomance.
However, I would ... more >>
Removing Duplicates from a table..
Posted by Anthony at 7/6/2003 11:37:29 AM
Simple question here..
I want to a query to remove the duplicates from a table and leave only 1 of
them.. The entire record is duplicated so there is no primary/unique key.
Do I have to select distinct and then delete the table and finally insert
the results back into the table?
Or is ther... more >>
Recursive query
Posted by Roberto C at 7/6/2003 10:47:33 AM
Hi.
My problem is:
I have build an "hierarquical" query that selects from a
EMPLOYEES table and, for every manager, lists his/her name
and in the subsequent lines lists his/her subordinated
employees, and so on. Notice that a subordinated employee
may also have subordinated employees.
The... more >>
Null > ''
Posted by Jason Davis at 7/6/2003 10:15:51 AM
In terms of database size, does a million records of NULL are more then
million records of '' (empty string).
Just wondering :-)
... more >>
Entity Relationship Diagram - database design problem
Posted by Solar at 7/6/2003 2:46:19 AM
Hi,
Thanking you in advance for your time and effort.
Here's the high-level view:
3 main categories: Electronics, Entertainment and Sports.
Electronic has 2 sub-categories: Walkman and MP3.
Entertainment has 2 sub-categories: DVD and VHS.
Sports has 2 sub-categories: Soccer and Basketb... more >>
|