all groups > sql server programming > august 2003 > threads for friday august 15
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
TRANSACTION LOG
Posted by MANOJ at 8/15/2003 10:30:30 PM
Hi...
might be simple enough for u but tough enough for me.
Well how to see transaction log with or without help of
enterprise manager.
Please, any help is regarded heartly.
Thanks
Manoj... more >>
Tricky Update
Posted by Steve at 8/15/2003 10:08:16 PM
Hi All,
I have the following SQL
SELECT A.Sedol,A.StartDate,A.EndDate, A.SPrice, A.SFactor, AVG(B.[SFactor])
AS PAVGFactor, SUM(B. SFactor]) AS PSUMFactor
FROM tblFundFactFile_ME A LEFT OUTER JOIN tblFundFactFile_ME B ON
B.[StartDate] <= A.[StartDate] AND A.Sedol = B.Sedol
GROUP BY A.ID, A... more >>
Primary Key. Is it really always necessary?
Posted by Dan at 8/15/2003 9:45:26 PM
Hello SQL Gurus out there!
I've read many posts here that stress again and again the necessity of a
primary key for every table.
I'm wondering if this is always the case.
Let's take for example the [order details] table in northwind.
It's primary key is a composite key on orderid and producti... more >>
Join Tables Real Quick - I cant get the syntax rigth.
Posted by A Apodaca at 8/15/2003 5:44:33 PM
FROM Armast JOIN Aritem ON (UPPER(Armast.fcinvoice) =
UPPER(Aritem.fcinvoice)),
Aritem JOIN Inmast ON (Aritem.fpartno=Inmast.fpartno AND
Aritem.frev=Inmast.frev),
Inmast JOIN Inprod ON (Inmast.fprodcl=Inprod.fpc_number)
Please help. AA... more >>
How build this query better ???
Posted by lubiel at 8/15/2003 4:18:57 PM
Hello, someone knows o could help me
with this query please:
I have this tables:
Table_Settings
---------
IDCust-InCity-OutCity-Prefix-InMask-OutMask
-------------------------------------------
41-Boston-Vancouver-NULL-Usa-Ca
41-Mty-Bgt-0528-Mex-Col
41-Mty-Bgt-0525-Mex-Ecu
41-Houston-... more >>
Quizzical Query
Posted by Stephen J Bement at 8/15/2003 4:10:40 PM
I am trying to get a count of how often something happens per hour of the
day then data looks similar to:
StartTime Duration
2003-07-23 00:00:00.000 2
2003-07-20 00:00:00.000 3
2003-07-24 00:00:00.000 3
2003-07-26 00:30:00.000 5
2003-07-2... more >>
How to make the Database avalible at home?
Posted by Kyle Klaus at 8/15/2003 3:02:19 PM
I'm fairly new to SQL Server. I'm using SQL Server 7.0 Developer Edition.
The Server is running onsite at work, and I am using it as my back-end for a
couple applications I'm developing. However, I have times that I want to
work from home on my application, and I need access to that tables in the... more >>
subcontraction
Posted by Derek Ruesch at 8/15/2003 2:20:07 PM
I have the following table
tbl1
ID Amount
1 10
2 5
I want to write a query the returns the following result
set:
Amount_Difference
5
How do I do this?
I would greatly appreciate the help!
Thanks.
Derek... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
sql2k computed columns
Posted by RP at 8/15/2003 2:08:47 PM
Hello all, I havent been able to find much info on computed columns in the
sql2k docs, but here is what I would like to do:-
Can I have a computed column that basically gets its value by calling a
user-defined function passing it another column in the table? something
like:
MyCompColumn AS ... more >>
nvarchar to bit implicit conversion
Posted by Isaak at 8/15/2003 1:41:04 PM
If a stored procedure argument declared as "bit" is
assigned a nvarchar value, SQL Server automatically
converts the nvarchar data type to bit data type. It
appears that "false" is then converted to 0 and "true"
converted to 1. Is this intentional or a mere coincidence?
Can I expect that nv... more >>
Question?
Posted by Leon Shaw at 8/15/2003 1:33:39 PM
If I built a database with sql server evalution edition and it time out, how
do I get my database information back?
... more >>
Query to find the starting of new contact
Posted by Shafeek Khalidh at 8/15/2003 1:28:24 PM
Hi I've a table called Contract
id------start_date--------end_date
========================
1------1/1/2000---------12/31/2000
1------2/1/2001---------7/1/20001
1------7/2/2001---------12/31/2002
1------1/1/2003---------4/5/2003
1------4/6/2003---------NULL
Here start_date & end_date are... more >>
running total
Posted by Derek Ruesch at 8/15/2003 1:18:25 PM
I have the following table
tbl
ID (int-PK) Name Amount
1 Steve 10
2 Steve 20
3 Steve 30
4 Mark 5
5 Mark 10
6 Ryan 15
I want to write a query that will return the fol... more >>
Trouble with DateAdd Function
Posted by Tom Lewis at 8/15/2003 1:12:47 PM
I want to use the DateAdd function:
DATEADD(datepart, number, date)
to calculate dates where the values for both
the "datepart" and the "number" are taken from columns
included in the SQL statement. My SQL statement is as
follows:
SELECT FC.FacilityID,
FC.ContractDate,
... more >>
xp_cmdShell and xp_SendMail
Posted by Clive at 8/15/2003 1:04:19 PM
Hi all,
Iam executing a procedure to write results into a file which exists in a
Network drive.
1.Following is the procedure
-----
Create procedure proc_name1
as
/*Assume all the declarations are declared and results are retrieved*/
set @cmd = 'Echo ' + @ret_string + ' >> @filename
Exec... more >>
results in text
Posted by Andre at 8/15/2003 1:00:45 PM
I'd like to force query analyzer to return the results of a sproc as
"Results in text", rather than "Results in grid". Is there a way to do
this? I haven't found any SET command, or any other way to do this.
Thanks, Andre
... more >>
Want to insert a column in a table at a specified position. How ?
Posted by Nikolay Anestev at 8/15/2003 12:23:52 PM
Hi all. I want to insert a column in a table at a specified position. Using
ALTER TABLE ADD COLUMN construction appends the new column after the last
column of the table, so it not works for me. Please advise. Thank you in
advance.
Best regards.
Nikolay Anestev
... more >>
Query
Posted by marwan hefnawy at 8/15/2003 12:12:17 PM
Dear fellows,
My question is about a query that I don't know how to make it.
I have two columns ( value , date) the date is in dd/mm/yyyy format
I want the sum of values and the count of days in each month in each year in
my data as follows
month year count_of_days Sum_of_value
1... more >>
how do i properly delete the last column??
Posted by Trint Smith at 8/15/2003 11:34:10 AM
it is not being used and it gives me 'distinct' problems.
how do i properly delete it?
thanks,
Trint
.Net programmer
trintsmith@hotmail.com
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!... more >>
Does SQL Server 2000 Import Data feature ever work?
Posted by Sam at 8/15/2003 10:36:50 AM
Hi,
I was trying to copy some tables, stored procedures and relationships from
an MSDE database to SQL Server 2000 database. As usual the Import failed.
I've never seen this thing work... ever.
Is there a trick to it or is it there to look pretty but do nothing?
Sam
... more >>
Msg 8163: image data type cannot be selected as DISTINCT
Posted by Trint Smith at 8/15/2003 9:54:37 AM
I have an 'image' data type column at the end of this table
'TBL_Seller'. It is not even being mentioned as one of the primary keys
(cuz its not) in this query:
insert [Mink].[dbo].[TBL_Seller] select distinct * from
[Mink].[dbo].[TBL_Seller_stage] s where not exists(select * from
[Mink].[db... more >>
Linked server insert problem.
Posted by Matt Lemon at 8/15/2003 9:03:39 AM
Hi,=20
I have a trigger that is to update a table on a linked server from data =
in the 'inserted' table, as follows :
create trigger trg_NewMatter
on dbo.matter for insert
as
insert into SQL.legal.dbo.test_matter (client_id, matter_id, =
matter_name, mclosedt)
select =20
inserted... more >>
Insert icrement with leading letter and zero
Posted by Mike at 8/15/2003 8:54:03 AM
Hi!
I have a table with about 1000 rows. I created a varchar
(5) column. I would like to put a value in that
increments but has a letter before it like,
T00001
T00002
T00011
T00153
etc.
I know how to just put in 1,2, 3, etc.
Thanks,
Mike... more >>
NEED QUERY HELP
Posted by John at 8/15/2003 8:37:50 AM
I have an orders table, an order_details table and a
customers table.
In the orders table, I have the orderID (primary key) and
customer_id
(foreign key).
In the order_details table, I have the orderDetailID
(primary key), the
orderID (foreign Key) and the itemsreturned field, which
refl... more >>
manipulating the result sets from a stored procedure
Posted by Dave C at 8/15/2003 8:35:41 AM
Hello,
Can someone tell me the syntax for manipulating the result sets of
stored procedures in SQL? I can't seem to find a code example. For
instance, the sp_datatype_info, returns lots of columns; can someone
tell me how to select only select columns from that result set. Also can
someone sh... more >>
Does anyone outsource DBA?
Posted by Dean at 8/15/2003 8:29:23 AM
Hello All,
We have outsourced much or our IT department to a large service provider who
is managing our NT/Netware environment and our network infrastructure
(routers, switches, etc.). They are using an enterprise management system
to gather snmp traps and alerts and other info in order to id... more >>
Date data type
Posted by James Rasmussen at 8/15/2003 8:28:47 AM
When a date is stored in a db, it is represented with date/time. How can I
get just the date to be stored with no time?
TIA
Jim
... more >>
Union
Posted by denis at 8/15/2003 7:48:17 AM
I have union.
How do I select data into new table from this union?
select *
from NormalizedData n join Hardwaiver.dbo.MaxDate m
on n.ID= m.ID
union
select *
from NormalizedData n join Hardwaiver.dbo.MaxDate m
on n.ID= m.SN ... more >>
create YTD and YEAR totals from months
Posted by jerome at 8/15/2003 7:18:47 AM
Hi,
I've a table with products and months like:
PRODUCT (k), MONTH(k), QTY, QTY_YTD, QTY_YEAR
100 022001 10 0 0
100 042001 15 0 0
100 022002 20 0 0
200 012000 25 0 0
- Is ... more >>
every column is a primary key...what would this syntax be??
Posted by Trint Smith at 8/15/2003 7:04:04 AM
ok, on all tables i only have one primary key so that makes this
procedure easier:
sqlstr = "insert [Mink].[dbo].[TBL_Catalog] select distinct * from
[Mink].[dbo].[TBL_Catalog_stage] s where not exists(select * from
[Mink].[dbo].[TBL_Catalog] c where c.[CatID]=s.[CatID])"
BUT, these are all... more >>
how do you see which column is the primary key??
Posted by Trint Smith at 8/15/2003 6:33:54 AM
anyone,
i would like to use query analyzer to see it, but i don't know if that's
the right program since i can't find the view of which column is the
primary key...i can just see on the browser that the table has a primary
key..
Thanks,
Trint
.Net programmer
trintsmith@hotmail.com
*** S... more >>
Help on output display
Posted by ben at 8/15/2003 6:20:19 AM
Hi,
SQL Server 2000 Personal SP2 on Windows 2000 Pro...
I have a table [TABLE_DUH] With 10 Fields
FIELD TYPE VALUES
[instance] dateTime 8/15/2003
[aStart] int 10
[aMiddle] int 15
[aEnd] int 20
[bStart] int 12
[bMiddle] int 22
[bEnd] int ... more >>
Stored procedure quits executing
Posted by Venkat at 8/15/2003 5:19:31 AM
Hi
We have done an application using Visual Basic 6.0 and Sql
Server 7.0.
In which we call a stored procedure ("Main Procedure" )
with Groupid (integer value) as the argument. This
procedure calls 3 more procedures for all customers that
belong to the groupid using a cursor.
But whe... more >>
|