all groups > sql server programming > july 2003 > threads for monday july 28
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
DISTINCT and ORDER BY
Posted by anders at 7/28/2003 11:49:16 PM
Hi
I got this error mes. when i tried to sort som data:
ORDER BY items must appear in the select list if SELECT
DISTINCT is specified.
I dont understand what that means. I cant make any more
subquerys because i have alot of parameters in and out.
Thankes for any help
/Anders... more >>
Don't delete an employee from emp table if he has a foreign key in any table
Posted by Cyberspider at 7/28/2003 8:52:19 PM
I don't know if anyone of you have done this:
I'd like to have a lock in place that will keep an employee from being
deleted from the employee directory if their employee.id is in any tables
(loan table for example). The employee.id can have a FK in any number of
tables at anytime and I w... more >>
tinyit or varchar(5)
Posted by Jason Davis at 7/28/2003 8:47:35 PM
Hi all,
I have a mssql2k table with 10 million rows and an index on a varchar(5)
column.
there are 5 possible values in that index ("hardw", "soft", "inter", "perh"
and "misc")
Will I gain any noticeble advantage if I switch the index to use tinyint
(1-5) values?
Thanks!
... more >>
RegExp library files
Posted by Avrril at 7/28/2003 7:12:42 PM
I would like to ask for assistance regarding server
librabry files. I have recently uploaded my ASP files into
the server. Initially I was using the PWS to run the files
where everything runs as programmed. But this error pop up
when accessing the files from the server.
Microsoft.VBScript... more >>
query contains concatenated inner results
Posted by fredg1232003 NO[at]SPAM yahoo.com at 7/28/2003 6:14:14 PM
I have a table item(id, item_name, item_added_date, item_price).
The second table is item_viewedby(id, item_id, userid).
The second table holds the users who are viewing a certain item.
So data in first table item is like:
id item_name item_added_date item_price
1 toothbrush 01/01/2003... more >>
Script Error! Why?
Posted by Anderson Haertel Rodrigues at 7/28/2003 5:28:01 PM
Hello All,
This Scripts show error. Any Friend help me?
set xact_abort on
begin transaction
create table tb_teste (aaa int)
alter table tb_teste add bbb int
insert into tb_teste values (1, 1)
insert into tb_teste values (1, 2)
insert into tb_teste values (2, 2)
insert into tb_teste valu... more >>
Can't Find Temp Table
Posted by Ellis Yu at 7/28/2003 4:55:19 PM
Hi All here,
I'm writing a store procedure to create a temp table. After executing
the store proc, I try to retrieve the data from the temp table in same
session. A message "Invalid object" is shown. Would anyone tell me what's
wrong with that? Thks
Rdgs.
Ellis
... more >>
Need some help with an Extended Stored Procedure
Posted by Fred D at 7/28/2003 4:41:42 PM
Hi,
I am writing my first Extended Stored procedure and a need a little help
getting the Name and instance of the server. Reading the documentation on
Srv_pfieldex I can get the Instance of the SQL box I'm connecting to , this
is fine. But I can seem to find how to get the server name itself..... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
How to generate SQL script in diffrent formating ?
Posted by John Smith at 7/28/2003 4:24:01 PM
All,
Can I tell to Enterprise Manager to generate sql script as following:
Generate the CREATE <object> command for each object that DOES NOT EXIST.
I know that I can DROP and generate a new object ( under the formatting
tab). But what I need is to generate if the object does not exist ( I... more >>
Kill all connections to sql server
Posted by Michael at 7/28/2003 4:19:52 PM
Hello,
Is there a command I can issue to SQL server to drop all open connections to
certain databases, and lock them out until I can issue a "RESTORE" command,
to restore a backup of a database, I want to make sure SQL server doesn't
give me the ever popular error "database could not be locked... more >>
Unpacking a column
Posted by Anthony Zessin at 7/28/2003 4:17:16 PM
I have an import table coming from an external source, and I wish to unpack
the words in the description column. For instance I have
id Description
-- --------
1 Paco
2 Hello world
3 This is fun
4 Are you happy Mr. Superman?
I wish to have a t... more >>
SQL Server Agent can't see environment variables
Posted by Nick Djurovich at 7/28/2003 3:55:28 PM
Hi,
It seems stop/starting the service is not enough to have SQL Server Agent
use any newly set Environment Variables. We have to reboot the machine
in order for the Environment Variables to be 'seen'.
Is there a less drastic way to get SQL Server Agent to update it's
Environment Variables ... more >>
Query Analyser - what do icon modifier mean in "Display Execution Plan"?
Posted by Stephen Howe at 7/28/2003 3:43:07 PM
For Query Analyser that comes with SQL Server 7.0, if I do "Display
Execution Plan", sometiems some of the icons have a small yellow circle with
3 arrows pointing to the left on top of an icon. For eaxmple I can see it on
top of the Icon for "Clustered Index Scan" and "Hash Match Inner Join". But... more >>
Primary key failure on identity field
Posted by Fred Flintstone at 7/28/2003 3:16:22 PM
I have an ASP application that's been working fine for ages.
Suddenly, when trying to add a record to a table, I get:
Violation of PRIMARY KEY contraint: 'PK_Responses': Attempt to insert
duplicate key in object 'responses'.
So there is a table called 'responses'. It has a field (among oth... more >>
Error in connectionstring
Posted by Gustavo at 7/28/2003 2:56:51 PM
Hi,=20
I install SQLServer 2000 it=B4s working but when try to=20
connect whit my application send this error [Microsoft]
[ODBC SQL Server Driver][DBNETLIB]Invalid connection.
My string is
..ConnectionString =3D "driver=3D{SQL=20
Server};server=3D192.168.0.36;uid=3Dsa;pwd=3Dpasstest;databa... more >>
Cannot index the view. It contains one or more disallowed constructs
Posted by Andrew John at 7/28/2003 2:42:12 PM
Dear All,
Inspired by the idea of enforcing non-nulls to be unique but allowing multiple nulls -
I have been attempting to enforce uniqueness in a primary key column across 2
separate tables with an indexed view, but failing miserably.
I do not have control over the data in PartNumber, so ca... more >>
How to read text file into a text field
Posted by Jignesh at 7/28/2003 2:09:01 PM
Hi
How do I read data from a text file into a text field in a
table? Any other method than Bulk insert?
Thanks
Jignesh... more >>
how to do inserts with circular fk constraints?
Posted by Andreas Leitner at 7/28/2003 1:57:07 PM
Hi,
I have two tables that each have a fk contraint to the other table.
How do I do an insert in such a situation?
The problem is that I cannot seem to find a way to tell the db that two
inserts are 'atomic', as in the
constraints (invariant) must not be checked between the inserts.
Here ... more >>
sqldmo.dll problem
Posted by mbrooks at 7/28/2003 1:49:09 PM
I am using the BulkCopy operation in VB6 to push data to a
Sql database (SQL Server 2000). The problem is that
sometimes my customers receive this error:
Number: -2147221504
Description: "Method '~' of object '~' failed"
It happens on both Windows XP and 2000 machines. The
sqldmo.dll regi... more >>
Grouping and Order By
Posted by andrew NO[at]SPAM mindchill.com at 7/28/2003 1:46:07 PM
Hi
I need some help with grouping and ordering of a sql statement. The
table I have is detailed below:-
Id
Date
Sales_Total
I need to be execute a query which will return the aggregate sum of
the sales total for each month for the last 12 months. I can manage
to do this by using the ... more >>
SQL data type
Posted by Junaili Lie at 7/28/2003 1:41:55 PM
Hi guys,
I have the following query:
Select count(*) as total, count(*)/(select count(*) from tbl2) as percentage
from tbl1
the resulf of the count(*)/(select count(*) from tbl2) always give 0,
because it will consider percentage as int, so any value less than 0 will
give 0.
Anybody know ho... more >>
Read-Only Database
Posted by Maher K. Al-Jendasi at 7/28/2003 12:46:24 PM
Hello All,
How could make SQL Server database read-only, through T-SQL, is there ant
SET command or something like that???
Thanks in advance
Maher K. Al-Jendasi
maher@fr.fm
... more >>
Passing a text variable to a stored procedure
Posted by Jignesh at 7/28/2003 12:33:46 PM
Hi,
How do i pass a text datatype variable to a stored
procedure.
If it is impossible is there any way you can tell me how
to read a text file into a text field of a table through
stored procedure or a query?
Thanks
Jignesh... more >>
DB Optimization
Posted by Shamim at 7/28/2003 12:22:21 PM
SQL 7.0
I scheduled a Optimization job to run weekly once and its taking around 5
hrs .During this time users are getting locked.
What are all the best options to handle this ??
We are not able to get a continuous 5 hrs down time for application ??
Thx
Sh
... more >>
Triggers and Ref. Integrity
Posted by Eric at 7/28/2003 11:57:18 AM
Hi,
I created a trigger that works correctly on tables that
have no other tables dependant on them. Once the tables
have tables dependant on them (Ref int. with cascade del
and update), I get errors when the trigger runs. More
specifically, the error only occurs when I delete a
record. ... more >>
DTS execute question
Posted by Jennifer Smith at 7/28/2003 11:17:59 AM
I am using SQL 7
I created a DTS package, and when I execute it through enterprise
manager it runs with no errors. But when I try to run it through query
analyzer using a stored procedure it does not work.
Any clue where I can start to debug this issue?
Thanks.... more >>
Multi Table SQL
Posted by Brad V at 7/28/2003 11:04:55 AM
4 tables
CREATE TABLE computers(
comp_id INTEGER IDENTITY,
name VARCHAR(32) NOT NULL,
more_fields VARCHAR(100)
)
CREATE TABLE computer_aliases(
comp_id INTEGER,
name VARCHAR(32) NOT NULL
)
CREATE TABLE op_systems(
os_id INTEGER IDENTITY,
comp_id INTEGER NOT ... more >>
Selecting all children of a self-referencing table
Posted by Mario Vargas at 7/28/2003 11:03:27 AM
Hi,
I have a self-referencing table called Categories and another table called
Products. I want to be able to select all products for a given category. If
the category has child categories (sub-categories) then all products
associated with these should be included in the result set as well. Th... more >>
Query Analyzer and Client Server
Posted by Robert Taylor at 7/28/2003 10:49:23 AM
I encountered some unexpected speed issues over the weekend running some
scripts in Query Analyzer on a remote server via dial up and TCP
sockets. After 3 hours of my script running, I finally cancelled it and
logged into the server via Terminal Services.
When running the script from Terminal... more >>
Tools like DB Artisan and others
Posted by michael at 7/28/2003 10:33:30 AM
At my work place they wont give developers Enterprise manager, for
security purpose's Does anyone have any input to any shareware
programs that would serve the same purpose... more >>
Trigger between two databases
Posted by Yaron Nahum at 7/28/2003 9:44:22 AM
Hello,
can I set a trigger on one table and the statement will change data on other
database (on the same server) ?
can you give me an example for such a trigger
thanks for your time
Yaron.
--
éøåï ðçåí
"îéëåðéí"
... more >>
Copying Data into a SQL table with primary key
Posted by lostboy10438 NO[at]SPAM yahoo.com at 7/28/2003 9:27:45 AM
I get the following error message :
Server: Msg 2627, Level 14, State 1, Line 2
What I am trying to do though is IMO fairly easy. I have a table of
records (Example1) that I am trying to "copy" into (Example2) with
Example2 having a primary key on "Phone" I know 100% that there are
an ab... more >>
Query SQL (SHAPE)
Posted by Frank Dulk at 7/28/2003 9:04:39 AM
Does anybody can me to explain how consultation it is it works? If I place
the line " AND L.Status = ' Coletar' " in the consultation of the lot
(str_cmp) not back the correct data.
str_sel = "SHAPE {SELECT RFCQA.* " _
& "FROM Rec_Ficha as RFCQA LEFT JOIN Lotes as L" _
& " ON RFCQA.NR_F... more >>
How to define a constraint for a field based on another field in the same table?
Posted by Ricky at 7/28/2003 8:47:43 AM
How to define a constraint for a field based on another
field in the same table?
In my Table I have fields Id, IdFK, Plant, TagIdentifier...
I define a constraint using Table properties tab and check
constrains on Plant field as
Plant In ('Met', 'Sen', 'Blu'....)
I want to define an... more >>
SQL Server Architecture
Posted by robertbrown1971 NO[at]SPAM yahoo.com at 7/28/2003 8:19:59 AM
Could someone recommend a book on SQL Server Architecture for a
developer with a lot of Oracle experience and good knowledge of RDBMS
concepts? In other words I don't want a book that explains how to
write SQL queries or basic OS concepts but gets to the point right
away. It should be focused ... more >>
Is there any other function to take the date part out...
Posted by Ricky at 7/28/2003 7:47:17 AM
I have a field with hourly and minutely values. E.g.
Field1 (Hourly time) Field2 (Minutely time)
2003-07-01 00:00:00 2003-07-01 00:00:00
2003-07-01 01:00:00 2003-07-01 00:01:00
2003-07-01 02:00:00 2003-07-01 00:02:00
.. .
.. ... more >>
create view from stored procedure
Posted by Leon at 7/28/2003 7:44:44 AM
Can a view be created via stored procedure? I was hoping
to pass date range to stored precedure to create view.... more >>
What is wrong with this statement.
Posted by William Reyes at 7/28/2003 7:26:25 AM
I am trying to see if the item is PastDue.
first I check to see if an item exists in csh10002, if one does not then
past due is definetly false(0). otherwise i need to check another table for
the minimum due date
if the due date is greater the today then pastdue should equal 1 else it
should eq... more >>
Suppressing Recordset from SPROC
Posted by Andreas Heid at 7/28/2003 7:25:00 AM
Hi all,
I have a problem with calling a SPROC from another SPROC.
I call SPROC B from within SPROC A to create some entries
in a table. Unfortunately SPROC B returns 2 IDs of the
records it created. However I don't want this recordset in
my SPROC A as it disrupts my error handling in the V... more >>
Oracle connection
Posted by Carlos at 7/28/2003 6:28:31 AM
Hi
I have a linked server oracle and i receive this message
when execute any query with it.
"OLE DB provider 'MSDAORA' reported an error.
[OLE/DB provider returned message: Oracle error occurred,
but error message could not be retrieved from Oracle.]
OLE DB error trace [OLE/DB Provider '... more >>
Mail
Posted by sardinka at 7/28/2003 6:06:50 AM
What is incorrect in my sp? Attached file is not working?
CREATE PROCEDURE CDO_SendMail_test(
@From varchar(255) = 's@yahoo.com',
@To varchar(255),
@Cc varchar(255) = '',
@Bcc varchar(255) = '',
@Subject varchar(255),
@MessageFormat int = 0, -- default to HTML, 1 = text, 0
... more >>
900 size limit on text and varchar fields
Posted by Adam at 7/28/2003 5:55:09 AM
Hello. I am using a stored procedure to insert records
into a SQL Server database. I am inserting the records
using a SQLConnection and SQLCommand object from C# code.
Everything seems to work fine except when the value of one
of the fields is over 900 in length, nothing gets inserted
f... more >>
RUNNING a stor. proc. in SQL SERVER through DATA ENVIRONMENT
Posted by polytimi8 NO[at]SPAM yahoo.com at 7/28/2003 5:30:42 AM
Hello,
When I run a stored procedure in Sql server through DataEnviroment in
VB6 (using the OLE DB Provider for Sql Server for the connection) I
take only updates in the table of my database but no results of my
stored procedudure's variables appear. How Can I make this variables
appear as o... more >>
Executing COM object methods via T-SQL
Posted by brett NO[at]SPAM wintechnologies.net at 7/28/2003 4:37:44 AM
Hiya
I am trying to execute a COM objects method from T-SQL. I am using
sp_OAcreate to create an instance - which is not producing an error.
The Method expects 3 variables, int, string, string. and returns a 1
or 0.
I am referencing it as below..
EXEC @hr = sp_OAMethod @object, 'OLogon... more >>
Complex Query - cont
Posted by Peter Newman at 7/28/2003 4:20:12 AM
I have been trying to get a results from a third Party
accounts system. From all the help given i the past i
have managed to get this far.
if exists (select * from dbo.sysobjects where id =
object_id(N'[dbo].[Tmpnomdat]') and OBJECTPROPERTY(id,
N'IsUserTable') = 1)
drop table [dbo].[Tmp... more >>
SQL Mail Configuration
Posted by Satish at 7/28/2003 4:09:46 AM
Hi,
I am not pretty sure in which category should I
post this question. So I posted it in sqlserver.tools
group and now I am re-posting it in here.
I am able to configure SQL Mail and send mails using
the available external sp's. But the only problem with
this is that I need t... more >>
Please Help me to decide
Posted by Suriya Narayanan at 7/28/2003 3:44:44 AM
we have developed a project in MS VB6.0 with SQL Server7.0
as back end, we have both the application and SQL server
running in the same machine, where our application itself
consumes an average of 94% of CPU, we had sql server
getting terminated saying some exceptions. in this
situation is... more >>
Insert current Date in Procedure
Posted by Chris at 7/28/2003 2:53:15 AM
Hi out there,
can someone tell me how I get the current(server-)date in
a Procedure(UPDATE-clause)?
Something like:
.....
.....
SET @MyDate=CURRENT_DATE
INSERT INTO [MyDB].[MyTable]
( [DateCreation])
VALUES
( @MyDate)
....
....
just won't work...
Thanks a lot for your ... more >>
SQL Query Problem
Posted by Peter Tewkesbury at 7/28/2003 2:37:12 AM
Hi, Can anyone please help!
I want to store some data as follows
Table A,
ResultID - int (Primary Key, Identity)
Date -Datetime
Data- {1,1/1/2003}, { 2,2/2/2003}
Table B,
Data_id - int (Primary Key, Indenty)
ResultID - int
Name - string
Value - Double
Data - {1,1,"Files",200.0},... more >>
Save the picture in SQL or Not?
Posted by Jehan at 7/28/2003 1:45:16 AM
Is it better to save directly the pictures (thumbnails)
in the sql database or to use a text path to the
thumbnail location folder like I did with "Access".
I am creating a picture gallery for my
website "www.legac.net" and wonder what is the best way?... more >>
|