all groups > sql server (alternate) > march 2005 > threads for march 1 - 7, 2005
Filter by week: 1 2 3 4 5
slow performance on specific query
Posted by Not Me at 3/7/2005 5:36:55 PM
Hi,
Can't post specifics at the moment but if this seems like a common
problem any help would be appreciated.
When querying with ~6 tables, using mostly left outer joins, I get
standard performance with the where clause
where XXX is not null
however, if I try the clause
where XXX ... more >>
SQL Statement Help
Posted by cwwilly NO[at]SPAM gmail.com at 3/7/2005 3:16:40 PM
Hello,
Thanks for taking the time to help me out with this. I've been pulling
my hair out trying to figure this out.
SERVER: Microsoft SQL Server 2000
TABLE STRUCTURE:
terms_no varchar 10
note_no int 4
note_text varchar 60
SAMPLE DATA:
terms_no | note_no | note_text
2 ... more >>
Speed cost for using "or" clause and functions on join statement
Posted by Phillip at 3/7/2005 12:20:15 PM
Select member
from NameList
Inner join Members
on (Left(Namelist.NameID,5) = Members.ID
OR (left(namelist.SSN,9) = Members.ssn
OR (Left(namelist.CustID,9) + '*01' = Members.CustID)
where
namelist.name <> ''
How do I speed up a process like this? Can I create indexes on the
memb... more >>
Design question: Nested views and functions?
Posted by Matt at 3/7/2005 11:45:44 AM
I am working in a project where the business model is complex enough
that many common retrieval functions become difficult to develop and
maintain in single query statements or functions.
I have found the logic is easier to implement (and later modify when
the code is no longer freshly remembe... more >>
various working with dates issues
Posted by wireless200 NO[at]SPAM yahoo.com at 3/7/2005 11:09:35 AM
I've got a table with some datetime fields in it.
One field (call it field 1) is of the form mm/dd/yyyy and the other two
(fields 2 and 3) are in the form of hh:mm:ss:xx where xx is hundreths
of a second.
I'm getting the difference between field 2 and 3 using (datediff(ms,
access_time, rele... more >>
Update query
Posted by sqlgoogle at 3/7/2005 10:30:43 AM
Hi I'm having update problem.
Here is the senario
I have to different db server (SQL Server) linked with each other
In DB Server 1 I have 2 tables &
In DB Server 2 I have 3 tables.
I have joined tables with each other first & then between the servers
When I run select on DB Server1 with bo... more >>
curious result
Posted by William Kossack at 3/7/2005 10:19:17 AM
How can I write a query to return non distinct results?... more >>
Lock:Timeout events
Posted by john.livermore NO[at]SPAM inginix.com at 3/7/2005 9:42:01 AM
I am tracing a SQL Server 2000 production server that gets a query
about every second. The Event I chose to watch was "Lock:Timeout". To
my surprise I see many of these come through the trace. Is this normal
behavior? What is "Lock:Timeout" showing me?
Thanks,
John
... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Help, im new to MSSQL
Posted by xunling NO[at]SPAM gmail.com at 3/7/2005 6:36:31 AM
-- =============================================
-- Create table with IDENTITY column
-- =============================================
create table logviewer
(
idLog smallint IDENTITY(1, 1),
timeLog, Char(14) NOT NULL,
dateLog, Char(14) NOT NULL,
typeLog, Char(14) NOT NULL,
adressLog, Ch... more >>
Asking Email Address Up David Portas and Erland Sommarskog
Posted by Michael Teja via SQLMonster.com at 3/7/2005 5:19:26 AM
Dear Mr Portas and Mr Sommarskog,
Cause I am a newbie in sql, can I ask for your email address?
My email Address is mike@ptmb.com
Thanx
Best Regards
Michael
--
Message posted via http://www.sqlmonster.com... more >>
Newbie
Posted by Michael Teja via SQLMonster.com at 3/7/2005 5:10:30 AM
Friends,
I am a newbie in sql programming, I don't know much about the programming.
I 've tried to make a trigger but it failed.
Where can I learn about it and rather free for payments. ( Sorry about that
statement, cause it rather expensive for my revenue)
--
Message posted via http://... more >>
Is there a way to autoincrement a field with mixture of alpahbetic characters and numbers?
Posted by Jared Evans at 3/6/2005 3:16:02 PM
I have a feeling I'll be forced to use a script and a trigger for this
type of field format but I'm wondering if any of your wizards could
point at a simple way I could do something like this:
For example, if I want to be able to keep track of new orders following
this incrementing convention:... more >>
Stored Procedure Not Returning Recordset in ASP
Posted by rhungund NO[at]SPAM gmail.com at 3/6/2005 8:43:20 AM
Hi All. My question is this. I have a complex stored procedure in SQL
Server which works fine when I run it in Query Analyzer. However, when
I call it within my ASP script, it returns nothing, and sometimes locks
up. If I change my script to call other existing stored procedures it
works fin... more >>
Newbie Needs Help
Posted by TheTamdino at 3/6/2005 1:12:43 AM
I have experience with MS Access, but I am an absolute newbie when it
comes to MySQL. I was looking over the site, mysql.com and found the
following downloads:
MySQL Database Server
Generally Available (GA) 4.1.10
Alpha 5.0.2
Documentation
MaxDB=99 by MySQL
Generally A... more >>
SQL Server on chared hosting with client connections
Posted by Jo Davis at 3/5/2005 1:52:39 PM
www.shanje.com
does sql server hosting, on shared servers, at a reasonable price. It seems.
They also allow client connections. Just playing around I've managed to
connect an Access Data Project to a SQL Server database, and to access the
database from Enterprise Manager (running locally).
... more >>
Column calculations
Posted by Stevie D at 3/4/2005 9:47:13 PM
Hi,
I have a select query that returns three integer fields from a table the
values range from 0 to 5. On each row I would like to calculate the average
value in the three fields however, the difficulty is that only the rows
where the value is greater than 0 should be included in the calcula... more >>
Database performance degrading (again)
Posted by teedilo NO[at]SPAM hotmail.com at 3/4/2005 11:35:59 AM
We have an application with a SQL Server 2000 back end that is fairly
database intensive -- lots of fairly frequent queries, inserts, updates
-- the gamut. The application does not make use of performance hogs
like cursors, but I know there are lots of ways the application could
be made more ef... more >>
Permutate rows based on table
Posted by rcamarda at 3/4/2005 11:01:53 AM
Hi,
I wish to create new rows of data based on a source table. Example: I
have a file that contains a SESSION (time roughly a calendar quarter
for a University), START_DT, END_DT.
I want to create rows that would be for each session and each day, so
for session 200102 that starts 09/10/2000 and... more >>
BCP Issue w/Right Truncation
Posted by hharry at 3/4/2005 10:24:05 AM
Hello All,
I am attempting a bulk load of fixed position flat file data via bcp
and I have noticed that I get a Right Truncation error when trying to
load a row where the last column value is NULL.
For example:
Flat file row:
0000016M
FMT file:
7.0
3
1 SQLCHAR 0 7 "" 1 RECORD_KEY
... more >>
Get the field value after INSERT
Posted by ygorelik20 NO[at]SPAM hotmail.com at 3/4/2005 9:07:40 AM
Hi,
Problem:
I need to get the value of auto-incremented field from just inserted
record
In Oracle this is INSERT .. RETURNING command.
In SQL Server there are @@IDENTITY, IDENT_CURRENT, SCOPE_IDENTITY
- @@IDENTITY returns the value from the very LAST insert on any table
involving ... more >>
Question on aggregate statement
Posted by mike at 3/4/2005 7:47:35 AM
I have a location table that contains all North American zip codes, the
city, county, state etc.. each record has a GUID. My problem is that
several places in the US you will have a single city and zip code that
crosses a county line. So if you need to match this table to another
in a select ... more >>
Query/Report Help needed
Posted by surenm NO[at]SPAM gmail.com at 3/4/2005 6:50:25 AM
Hello all,
I need to do the following task repeatedly. I have been doing it
manually until now and I am thinking if there is any way I could
automate the whole process.
Here is the task:
For a selected group of tables, I need to create an Excel file with one
worksheet per table. The worksh... more >>
Stand alone client tools installation
Posted by lundd NO[at]SPAM fihrst.com at 3/4/2005 3:40:01 AM
Hi,
I'm looking for stand alone installation for SQL server Client tools,
or the files required for creating such an installation. I would like
to include this installation as part of the setup for my own
SQL-dependant app. Any assistance would be greatly appreciated.
... more >>
Mystery Database IDs in Profiler
Posted by Phil at 3/4/2005 2:26:35 AM
I'm currently running Profiler sessions to track down Lock Timeout
problems.
My Profiler view contains (amongst others) the dbid column.
Much of the time, this displays familiar dbids, such as 2 (tempdb) and
5 (my main user db). However, it also regularly displays IDs of 0 and
132.
Usin... more >>
Login Confusion
Posted by Stevie D at 3/3/2005 10:21:30 PM
Hi,
I am Just beginning to get to grips with SQL Server v 7 security on a stand
alone win 98 PC.
I have created a login which only has access to the pubs database and when I
try and connect to any other database (while using this login) I am
correctly told that I don't have access. However,... more >>
Query - check for a string in stored procedure
Posted by jungewum NO[at]SPAM yahoo.com.au at 3/3/2005 9:36:13 PM
Hi,
I would like to check if a string value exist in a string in sql
server stored procedure, e.g.
set @testString = 'this is my test document.'
if (@testString contains 'test')
begin
.....
end
How do I do this in sql server stored procedure?
Thanks,
June...... more >>
Concurrency issues with "Tree" structures.
Posted by Robin Tucker at 3/3/2005 6:12:40 PM
Hi,
I'm currently implementing a database with a tree structure in a table. The
nodes in the tree are stored as records with a column called "Parent". The
root of the tree has a "NULL" parent. The path to each node is stored in
the column "Path" and is of the form "\000001\000002\000003\... more >>
Report Containing Sequential Dates (removing date gaps)
Posted by christopher.secord NO[at]SPAM gmail.com at 3/3/2005 3:06:40 PM
I have a table containing typed log entries. One log entry is supposed
to be created every twelve hours, but sometimes there are gaps. I need
to create a report showing the time of entry, and the actual log entry.
I can't just list the contents of the log table, because if I do that
there wil... more >>
Update Time Out?
Posted by mbailey at 3/3/2005 3:04:26 PM
I am using ASP to insert/delete/update rows into a very simple SQL
Server database (2000).
When a certain amount of text (as little as 1000 chars) is inserted to
the table (the insert works fine) ANY update call to that row will time
out.
I can set the time out for 5 minutes and it still times ... more >>
Null & String Ops Again
Posted by BlueDragon at 3/3/2005 2:40:18 PM
I don't know enough math to demonstrate that any numerical operation
with a null should yield a null; although I would guess that it's true.
I just don't buy it, however, when dealing with strings and nulls. In a
simple table with first, middle and last name columns, I would infer
that a null va... more >>
MS SQL Server - User Rights
Posted by code2live at 3/3/2005 2:31:46 PM
Does anyone know if it possible to make a specific table invisible to a
user when they are in Enterprise Manager?
... more >>
SQL Query - Aggregate data
Posted by eheard NO[at]SPAM gmail.com at 3/3/2005 11:49:03 AM
I'm working on a fairly complex query, and to avoid exploding my brain
any further, I'm going to keep this simple with an example of what I'm
trying to do...
Let's say you had a table of customers and a table of orders
And you had data that looked like this:
Customers
CustID CustN... more >>
Script to lock down a regular user?
Posted by John Dalberg at 3/3/2005 10:58:04 AM
I don't like the fact that any user I create has access to system tables in
the Master databases and the ability to issue 'sp_who' plus God knows what
other system stored procs.
Is there a white paper or a script to lock down a user so that they do not
have this broad access without break... more >>
get the description of a column
Posted by Dan Gidman at 3/3/2005 7:57:20 AM
Okay guys heres the senario.
I have written a kick butt asp application that allows me to test sql
statements and manage/display all my databases from the web but I have
a feature I want to include that I can't figure out how. In Enterprise
Manager, one of the column editable properties is th... more >>
Problem backing up Database and Transaction Log due to disk space limitations
Posted by war_wheelan NO[at]SPAM yahoo.com at 3/3/2005 7:39:19 AM
I am having a problem backing up my database and TLog files due to a
lack of local diskspace. The db file is about 30GB and the TLog is
about 20GB each on a different hard disk. Each disk doesn't have
enough available space to accomadate a backup. I also can't shrink the
files because part of... more >>
TSQL: I want to use a SELECT statement with COUNT(*) AS 'name' and ORDER BY 'name'
Posted by war_wheelan NO[at]SPAM yahoo.com at 3/3/2005 7:15:19 AM
I am very new to Transact-SQL programming and don't have a programming
background and was hoping that someone could point me in the right
direction. I have a SELECT statement SELECT FIXID, COUNT(*) AS IOIs
and want to ORDER BY 'IOI's'. I have been combing through the BOL, but
I don't even know... more >>
Complex query help needed....
Posted by steven.fafel NO[at]SPAM gmail.com at 3/3/2005 6:52:43 AM
I have been working with SQL for a while...but I am stumped. I can not
seem to get my arms around this query....can anyone help...
Here it is:
Table = 12 rows, 4 columns (id, name, amount, date)
row1 = 771, "steve", $50.00, "01/01/2005"
row2 = 772, "steve", $100.00, "01/11/2005"
row3 ... more >>
DTS Package and ASP.NET
Posted by Tony at 3/3/2005 5:47:10 AM
Hi all,
I need to export tables out of a Pervasive DB and into SQL Server 2K. I
have set up a DTS Package to do this when a user visits a web page
(which will then allow them to view a up to date report using MS
Reporting Services).
Currently my DTS package checks to see if the table exists... more >>
Urgent deliverable
Posted by kalikoi NO[at]SPAM gmail.com at 3/2/2005 11:20:07 PM
Hi
I have a query as follows
select * from
( select CompanyID , TickerSymbol , CompanyName,
dbo.FormatNumber(LatestClosingPrice,2) as 'CurrentPrice' from
backscreeningdata3
where dailydate= '12/31/04' and (LatestClosingPrice>100) ) as m0,
( select CompanyID , TickerSymbol , CompanyName,
... more >>
Update Query
Posted by Dishan Fernando at 3/2/2005 10:49:49 PM
Hi Gurus...
CREATE TABLE [Table1] (
[Col1] [int] NOT NULL ,
[Col2] [int] NOT NULL ,
[Sequence] [tinyint] NOT NULL ,
CONSTRAINT [PK_Table1] PRIMARY KEY CLUSTERED
(
[Col1],
[Col2]
) ON [PRIMARY] ,
CONSTRAINT [IX_Table1] UNIQUE NONCLUSTERED
(
[Col1],
[Sequence]
) ON... more >>
How to remember last record read
Posted by francisds NO[at]SPAM hotmail.com at 3/2/2005 10:36:48 PM
Hi,
Can you guys see if there's a solution to this problem?
I have a database from which I have to read each record and process
that record. New records are being added all the time, so I need to go
back and check for new records and process them.
However:
-- there is no 'identity... more >>
Select first type problem...
Posted by Mike R at 3/2/2005 4:27:11 PM
Hi,
I have a table called opportunity, included within this table are a opclosed
(date) , a companyid (integer) and some other columns.
There are many opportunity records per companyid . I am only interested in
closed opportunities i.e select * from opportunity where opclosed is not
nul... more >>
ASP to SQL Connection Prob, Same Server, IIS
Posted by Chad Richardson at 3/2/2005 4:09:16 PM
Yes, it should be easy....
I have a single box hosing IIS and SQL Server 2000. In my ASP script I've
tried using the following connection strings to attempt to connect to no
avail:
"Provider=SQLOLEDB;Server=servername\instancename,1433;Database=TEST;network=DBMSSOCN;uid=TEST;pwd=TEST"
"Pr... more >>
multiple foreign keys on same field, based on other field
Posted by pb648174 at 3/2/2005 3:29:16 PM
I have a table called BidItem which has another table called
BidAddendum related to it by foreign key. I have another table called
BidFolder which is related to both BidItem and BidAddendum, based on a
column called RefId and one called Type, i.e. type 1 is a relationship
to BidItem and type 2 i... more >>
How to Backup Read-Only databases
Posted by tgru at 3/2/2005 2:24:58 PM
Hello,
Can anyone tell me how to backup read-only databases? I want to backup
the secondary databases in my log shipping pairs.
Thanks,
TGru
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!... more >>
Using select results in a stored procedure
Posted by oopaevah NO[at]SPAM yahoo.co.uk at 3/2/2005 1:36:56 PM
I'm sure this is an obvious question but much of SQL is new to me.
I have a stored procedure and I want to use the results of a select
statement elsewhere in the stored prcedure. The select statement will
return at most one record and only one column, here's an example :
select top 1 Sequ... more >>
simple division problem
Posted by Go1369 NO[at]SPAM Yahoo.Com at 3/2/2005 12:56:28 PM
I am trying to divide one number by another and I can't get it to
return the right value....
in general I want to see how many fruits I have, then get the number of
apples and divide the apples by that total to get the percentage of
apples
I have
Declare @Val decimal(6,2)
Set @Val=
(... more >>
Cannot Drop Database
Posted by tgru at 3/2/2005 11:49:56 AM
I am trying to drop a database, but keep getting the following error.
"cannot drop database 'blah' because it is currently being used for
replication".
This db is not currently being replicated, but once was. It is the
subscriber side of an old replication pair.
Can anyone tell what I h... more >>
Database design question
Posted by Tim Mavers at 3/2/2005 8:52:56 AM
I have a series of database objects that represent things such as people,
accounts, etc. I have a set of options (boolean) that I need to add to
these objects. Normally I would just create a bit field for each one and be
done with it. The challenge however is that there could be hundreds o... more >>
'NETWORKDAYS(start_date,end_date,holidays)' in SQL ?
Posted by Ryan at 3/2/2005 8:02:27 AM
Is there an equivalent function in SQL to the
'NETWORKDAYS(start_date,end_date,holidays)' function in Excel ?
NetworkDays in Excel returns the number of whole working days between
start_date and end_date. Working days exclude weekends and any dates
identified in holidays. This part isn't vital... more >>
A Query-Transpose of Data
Posted by Sameer at 3/1/2005 11:52:10 PM
I am supplying you with Sample Data:-
Initial Classcode SampleSize Average
------- ---------- -------------------------------
ADK SSC 22 3.6800000000000002
ADK TSC 17 2.7599999999999998
ADK TSM 5 3.5499999999999998
ANB FCA ... more >>
Some Queries
Posted by Sameer at 3/1/2005 10:49:45 PM
1.
In SQL Server 2000, even after using round function upto 2 decimals,
the operation over a float field gives results upto 16 decimal places.
How can we avaoid this? Is it possible to display such results upto 2
decimal places in Query Analyzer? What are the related settings and
where to do it... more >>
Format result of sp_helpdb
Posted by [BuKoX] at 3/1/2005 9:23:50 PM
Hello.
How to format field "create" (Jan 12 2005) in sp_helpdb
procedure to sth like yyyy-mm-dd (2005-01-12) in SQL?
bye...
--
__ __
|__\\ | || |_// / \\ \_// FreeBSD: The Power To Serve
|__// |__|| | \\ \__// / \\ +------------------------------+
+[ http://buko... more >>
Delete data, but file size increase
Posted by Peter CCH at 3/1/2005 6:49:25 PM
I encounter one weird problem, I have a database with around 7 GB ...
when I delete a bunch of data from it, it suppose to reduce the
database file size, but weirdly, the file size increase to 8 GB.
Wondering why. Is it suppose to be like that?
Is it the architecture is designed to work like t... more >>
Log all commands executed in QA
Posted by google NO[at]SPAM joriz.is-a-geek.net at 3/1/2005 3:55:54 PM
Hi All,
Is there way that commands executed in the query analyzer get logged
automatically?
TIA
Joriz
... more >>
Profiler not reporting reads accurately
Posted by patrickshroads NO[at]SPAM hotmail.com at 3/1/2005 2:27:35 PM
I am running a profiler trace against a database and noticed that the
reads column always shows 0. When running the same trace against
another machine I get back values in the reads column. I took a query
that profiler reported as having 0 reads and ran in in query analyzer
wtih STATISTICS IO on... more >>
SQLServer Redirector Port 1434
Posted by bdealhoy NO[at]SPAM sympatico.ca at 3/1/2005 1:02:11 PM
I'm doing some vulnerability assessments of MS SQLServer installations
using AppDetective.
On doing the "discovery" proble (to find the instances), I find that I
get two "hits" -- port 1433 shows the MS SQALServer instance, but port
1434 comes up with MS SQL Server Redirector.
The online bo... more >>
Get list of files in directory using a SP
Posted by jpasqua NO[at]SPAM gmail.com at 3/1/2005 12:51:05 PM
Is there an XP/SP out there that will return a list of files residing
in a specified directory?
I'm looking for something simlar to
Execute master..xp_subdirs N'C:\'
But instead of it returning a list of subdirs I want it to return a
list of files in that directory.
Jeff
... more >>
SQL Monitoring
Posted by dalst36 at 3/1/2005 11:53:14 AM
I have been asked to monitor SQL to tell me when we are performing
better than others. Can anyone tell me what kinds of scheduled jobs or
scripts they utilize?
... more >>
Conversion between Date Formats
Posted by vilenm NO[at]SPAM gmail.com at 3/1/2005 6:49:09 AM
Hi. I have a DB in which we store dates in yyyy/mm/dd. However when we
want to display this date via a web frontend, it needs to be in
dd/mm/yyyy. I've declared a function (shown below) which converts
between these date formats and returns a varchar(20). This works fine
however now I need to hav... more >>
Conditional JOIN
Posted by chandy NO[at]SPAM totalise.co.uk at 3/1/2005 5:51:23 AM
Hi,
I am trying to change an SP from dynamic SQL to proper SQL but I can't
figure a way to conditionally add extra parts to the statement. How
can I do the equivalent of the following?
DECLARE @arg NVARCHAR(10)
SELECT a.i, a.x
FROM aTable a
IF LEN(@arg)
BEGIN
INNER JOIN bTable b ON a... more >>
|