all groups > sql server programming > october 2005 > threads for sunday october 30
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
Need assistance
Posted by Cupid Shan at 10/30/2005 11:50:17 PM
Am a newbie to SQL QUERIES (reporting) - Please assist
Scenario:
I have a simple table where I have columns like
empno
empname
latedate
reasonlate
justification
This table contains mulitple data for a single empno as you can see the
structure
for eg:
empno empname latedate ... more >>
Problem with HOST_NAME Function with Linked View
Posted by Neil at 10/30/2005 8:55:45 PM
I have an Access 2000 MDB file with a SQL 7 back end. I have a main table
with 50,000 records; and I have a selections table with 50,000 records for
each machine that uses the database (about 25-50). This allows each user to
have their own set of selections.
The selections table has three f... more >>
Identifying row with duplicate column entry with different Primary
Posted by Ramez at 10/30/2005 8:42:01 PM
I have a table of users similar to this:
ID, NAME, EMAIL
1, Name1, john@yahoo.com
2, Name2, mike@yahoo.com
3, Name3, john@hotmail.com
4, Name4, john@yahoo.com
5, Name5, mike@yahoo.com
What I want to do is to idenify all the rows in which the email address is
the same. To get a result li... more >>
remove duplicate row
Posted by Howard at 10/30/2005 6:18:42 PM
how do i write a query that will remove duplicate rows (rows with the same
"username" field) and keep the one with lower ID
ID USERNAME
1 john
2 john2
3 john
after executing this query this should become
ID USERNAME
1 john
2 john2
Thanks,
Howard
... more >>
Date/Time formatting
Posted by ryan.mclean NO[at]SPAM gmail.com at 10/30/2005 3:34:35 PM
Hi all, I'm hoping this is an easy solution . . .
How can I format the system date: getdate() as mm/dd/yyyy hh:mi am?
Am I missing something? I am fairly new to sql server . . .
I would use datepart, but I cannot find a way to display the time like
I have shown.
Your help is appreciate... more >>
Where to get Query Analyzer SP3
Posted by Mr. Smith at 10/30/2005 3:19:01 PM
Hello,
I have an eariler version of Query analyzer and were I'm working has
recently upgraded their SQL Server 2000 systems to SP4. I have discovered
that I need to upgrade my Query analyzer otherwise the Debugger doesn't work.
But for the life of me I can't locate where to download... more >>
Trbasaction in trigger?
Posted by ReTF at 10/30/2005 2:09:30 PM
Hi all,
I have one Transaction in one Update trigger, this trigger insert and update
data in a lot of other tables, if this Transactin fail, how I know, how I
chek if this transaction have rollback, how I can report this to my cliente
application?
Thanks
... more >>
Aggregate Problem
Posted by Scott at 10/30/2005 1:30:09 PM
When I run the my code in Northwind, the ExtendedPrice is wrong because
UnitPrice is averaged. I have AVG([Order Details].UnitPrice) AS UnitPrice in
my statement because I couldn't figure out a better aggregate function to
use.
My goal is to simply get a GROUP by Orders.OrderDate and SUM th... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Improving Joins
Posted by Roy Goldhammer at 10/30/2005 1:14:40 PM
Hello there
I have table with primary key Clustered and 100 Records
I have also table with foreign key to the first table. and it is indexed
The second table has 100000 records.
And when i do simple select on both table i get hash join and it shouldnt
happen.
What can cause this problem?... more >>
Format number with 2 decimal places
Posted by Sonny Sablan at 10/30/2005 1:11:00 PM
I am having trouble formatting a DATEDIFF with 2 decimal places.=20
Can anyone help?
tbVisitLog
VisitID | ChildID | DateTimeIn | DateTimeOut | etc...
tbChild
ChildID | ChildLastName=20
When calculating duration of stay...=20
SELECT c.ChildFirstName + ' ' + c.ChildLastName AS ChildNa... more >>
Check constraints
Posted by Niclas at 10/30/2005 1:01:33 PM
Hi,
If I have three columns called 'userid' 'event' and 'result' and only allow
one result row per event and userID. I.e. each user can only have one result
per event.
How would a constraint expression look like for this ?
Nic
... more >>
set @var = (exec stored proc)
Posted by Test Test at 10/30/2005 11:27:46 AM
Is that possible to execute a stored procedure and store result to a
local variable? The stored proc 'up_get_result' returns a single value
and I am trying to store it in a variable.
declare @result
set @result = (exec up_file_path)
It is not working. What I ended up doing is this:
cre... more >>
Connection Broken
Posted by Tor Inge Rislaa at 10/30/2005 10:52:54 AM
I am updating records in my database with the procedure below. The data is
updated as it should but the Enterprise Manager (SQL Query Analyzer) gives
the error:
[Microsoft][ODBC SQL Server Driver][Shared Memory]ConnectionCheckForData
(CheckforData()).
Server: Msg 11, Level 16, State ... more >>
Computed field with a maximum
Posted by ehsan.akhgari NO[at]SPAM gmail.com at 10/30/2005 1:17:24 AM
Hi all,
I have a table with some fields, and I'm builiding a query upon it
which should have a computed field based upon the values in each row.
For example:
CREATE TABLE mytable(
-- ...
price decimal NOT NULL,
number decimal NOT NULL
);
The computed field should be the product of ... more >>
Trigger rule problem
Posted by Agnes at 10/30/2005 12:00:00 AM
I would like to get what changes after save, So, I use trigger to do .
I can detect whether there is change. however, it is fail to put it in the
description.
DECLARE @d nvarchar(100)
IF UPDATE(postsw)
BEGIN
SET @d = 'POST STATUS CHANGE -'+STR(postsw) <-- error
INSERT HISTORY(desc... more >>
Percentage calculation in SQL Server
Posted by ReTF at 10/30/2005 12:00:00 AM
Hi all,
Anyone knows if have same math function to do Percentage calculation in SQL
Server
I have 988 and I need get 97.32 Percent of this, how I can do this in SQL.
Thanks
... more >>
|