all groups > sql server programming > october 2003 > threads for friday october 3
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
MS QueryAnalyzer Intellisense like Add-On
Posted by yaniv NO[at]SPAM key-hole.com at 10/3/2003 11:26:10 PM
http://www.key-hole.com/EZSql... more >>
Delete Duplicates
Posted by Vlad at 10/3/2003 10:03:03 PM
I have 2 existing tables containing which I need reorganize
First table CheckLog contains records representing Company Checks sent to
Suppliers. The second table Payments contains records representing Payments
for Particular orders. This tables related by CheckID (primary key in Check
table and ... more >>
Stored Procedures
Posted by Teo at 10/3/2003 7:50:13 PM
Hi! I'm using MSDE in Visual Studio .NET to do all the DB stuff.
Now, my question is. Can I do a Select statment inside the stored procedure
and based on that select to send a message to the user that the record
exists or if it doesn't exist, to add it to the table?
Thanks,
Teo
... more >>
Stored proc as RecordSource for an Access 2000 subform
Posted by Ragnar Midtskogen at 10/3/2003 7:32:47 PM
Hello,
I have an Access 2000 subform that right now has a regular SELECT query as
that RecordSource and selects records by being linked to the main form by
Master field/Child field.
This is not very efficient as far as network traffic is concerned, so I have
written a stored procedure to sele... more >>
Can I customize the Error Message ?
Posted by tristant at 10/3/2003 6:48:02 PM
Hi SQL Gurus,
When my Front End data entries break any Constraint when Updating the Table,
user will get a user 'unfriendly' message like :
"UPDATE statement conflicted with TABLE CHECK constraint 'CK_T60STDOC1'. The
conflict occurred in database 'AirindoNew', table 'T60SALH'. "
Is there an... more >>
Using VB6 and SQL
Posted by rictonline NO[at]SPAM yahoo.com at 10/3/2003 5:38:34 PM
Hi all,
I'm quite confused on polling the data from SQL Server. Should I
maintain a public connection and use it everytime i call a recordset?
or should i create a new connection object for the recordset and
disconnect it after polling the records?
Hope you could help me... thanks!!!
Ri... more >>
What is a test matrix?
Posted by Josh K. at 10/3/2003 5:23:06 PM
I know this is probably the wrong group to post this, but can anyone point
me to information about developing a test matrix? I haven't a clue on what
this is.
... more >>
e-mail results from SQL server query
Posted by Dave Benton at 10/3/2003 5:20:36 PM
I want to send a report from SQL to someone via e-mail. I have the query and
I was going to setup a job to run it (as an SP) at the end of each month.
How do I get the query results into an e-mail to someone??
Thanks for any help
... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
New to tSQL
Posted by Eager2Learn at 10/3/2003 4:35:03 PM
Can anyone recommend links to get started with tSQL and
SQL programming?
Thanks very much in advance.... more >>
Is there a better way to write this query?
Posted by fabriZio at 10/3/2003 4:30:18 PM
I have to SELECT some values filtering a Datetime column (DateContact) in
this way:
"select all records that have DateContact value of today..."
I wrote this:
======================
select
*
from
t1
where
DAY(DateContact) = DAY(GETDATE())
and
MONTH(DateContact) = MONTH(GETDATE(... more >>
xp_sendmail with multiple attachments
Posted by Sherilyn at 10/3/2003 4:30:13 PM
I would like to send multiple attachments in one email. I
know that the files are separated by semicolons. But I also
need to use @variables in my filenames, and can't figure
out how to make it work.
This does not work:
SET @XlsAttach1 = @DirectoryOnline + 'EXCWP' +
@JulianDay + '... more >>
The table 'tbXyz' has been created but its maximum row size ...
Posted by Albrecht Reimann at 10/3/2003 4:29:44 PM
I have a db upgrade script, which adds columns etc., depending on previous
db patches:
IF 'V_1_03' = (SELECT prVal FROM tbProps WHERE prTag = 'Version') BEGIN
ALTER TABLE tbXyx ADD
[xyzNewCol_1] [nvarchar](2047) NOT NULL DEFAULT('???')
UPDATE tbProps SET prVal = 'V_1_04' WH... more >>
SQL HELP
Posted by SQL User at 10/3/2003 4:21:57 PM
Table, emp_move
empid, movedate, movetype, seq_no
----------------------------------------------------------------------
500 09/01/2003 ENT 1
500 09/02/2003 MED 1
500 09/03/2003 MOD 1
500 09/03/2003 EXT ... more >>
Replacing record by another
Posted by Roy Goldhammer at 10/3/2003 4:20:42 PM
Hello there
I have table on sql server of companies
To work with with the table on the application i have another table
frmCompany that has the same structure exapt the User field who added to the
new table.
As part of the application i add one of the records on the Companies table
to fr... more >>
Blobs and instead of trigger
Posted by Mike at 10/3/2003 4:19:23 PM
I'm getting a strange error when attempting to create an
audit record with a text datatype field.
Working in SQL Query Analyzer, the error message is
[Microsoft][ODBC SQL Server Driver][TCP/IP Sockets]
ConnectionCheckForData (CheckforData()).
Server: Msg 11, Level 16, State 1, Line 0
Genera... more >>
creating a view that displays category with two levels side by side
Posted by Jonas Åkermark at 10/3/2003 4:17:13 PM
Hi!
I'm having problem figuring out how to create a query that shows two
category levels side by side.
I have two tables:
CATEGORY
ID Name
== =====
1 Photo
2 Hifi
3 Camera
4 Reciever
5 Speaker
6 Digital camera
7 ... more >>
SP query
Posted by Gary at 10/3/2003 3:22:10 PM
I am running into a situation that is driving me right around the corner..
:)
We have an Orders table, which has OrderID as a primary key, along with
relational fields to store who the order is billed to (BillToCode) and who
the order is shipped to (ShipToCode).
The BillToCode relates to a ... more >>
Function to remove non numeric characters
Posted by Adrian at 10/3/2003 2:22:15 PM
Using SQL Server 2000.
I would welcome help with writing a function to remove all non-numeric
characters in a string.
Below is one that works for us in VBA, but I need one that will run in SQL
Server.
----------------------------------------------------------------------------
-------
P... more >>
w32.swen virus
Posted by po1ari5 NO[at]SPAM hotmail.com at 10/3/2003 1:42:36 PM
Did anyone else get bombarded with the w32.swen virus in their e-mail
after they started their google groups account? I've gotten about 16
bogus e-mails containing swen. Fortunately, Norton caught it before
any damage was done.... more >>
Grouped stored procedures in SQL 2000?
Posted by dmcheng1 NO[at]SPAM yahoo.com at 10/3/2003 1:36:17 PM
Hi. I am curious about creating a group of stored procedures - if I
do that, can I execute the entire stored procedure group at once, or
do I have to execute each command one by one using the ";number"
option? I've created a grouped stored procedure and when I run the sp
without any params, it... more >>
Consolidate keys
Posted by Kari Laine at 10/3/2003 1:25:42 PM
Hi Support,
I just ordered the Graphics Tools Pro and DOS Tools pro. I am an existing
customer of SQL Tools pro. So could you consolidate the keys? My existing
key for SQL Tools is 1200EA4F
Best Regards
Kari Laine
kari.laine@dnainternet.net
... more >>
What's wrong with this trigger
Posted by Venkat Venkataramanan at 10/3/2003 1:02:36 PM
Hello:
I am trying to create a trigger on a table owned
by 'TranRules_sa'; I am logged in as sa:
CREATE TRIGGER insElem_Group ON [TranRules_sa].
[ELEM_GROUP]
FOR INSERT
AS
DECLARE
@iParentElemID Int,
@iElemID Int
IF INSERTED.Parent_Elem_ID_N IS NOT NULL
IF INSERTED.Par... more >>
Select first row over a time span
Posted by Chris Aitchison at 10/3/2003 12:59:41 PM
Hello,
I am attempting to select the first row over a period of time. It is hard
to explain this in words so please use the tables below:
1 01/01/2003 6:00 AM
2 01/01/2003 6:10 AM
3 01/01/2003 6:35 AM
4 01/01/2003 7:00 AM
5 01/01/2003 7:10 AM
6 01/01/2003 7:15 AM
Th... more >>
Executing a DTS package from within a stored procedure
Posted by tguillor NO[at]SPAM ems.jsc.nasa.gov at 10/3/2003 12:57:01 PM
SS2000
How do I execute a DTS package from with a stored procedure?
Thanks... more >>
is there a TSQL function to pad a string?
Posted by K. Shier at 10/3/2003 12:43:38 PM
i have a selecte something like this:
SELECT OrgNum + ' (' + OrgName + ')' As OrgNumAndName FROM orgs
what i want to do is add leading spaces to any OrgNum whose length is less
than that of the longest OrgNum - this way, when the records are returned in
a list in plain text format, the colum... more >>
declare cursor
Posted by Holly Li at 10/3/2003 12:38:21 PM
Hi,
I have a stored procedure that uses cursor. One line in it
that declares a cursor is:
DECLARE curs CURSOR static
FOR SELECT AffiliateCode, balance FROM RCS_Affiliates
WHERE AffiliateCode in (@cons)
@cons is a string like 'user1', 'user2'. So together I
hope this line would be: ... more >>
Subtract two queries
Posted by Sunil T at 10/3/2003 12:09:19 PM
i want to substract two queries.like following
how can i do it in a proper syntax
QUERY1 = (select CORKEY,HSTTYP, MICRO from corhst A)
QUERY2 = (select distinct CORKEY,HSTTYP, MICRO from corhst)
i want to perform QUERY1 - QUERY2
Please help
Thanks
Sunil
... more >>
Compare 2 tables
Posted by Jay at 10/3/2003 11:58:21 AM
I need to select/delete data from table2 where the same
data (based only on 3 columns) is in table1. Eg.
Table1
a,b,c,d,e,f,g
--------------
3,5,8,2,7,8,9
1,3,5,7,9,2,4
4,4,6,7,8,3,2
6,7,6,7,6,7,6,
Table2
a,b,c,d,e,f,g
--------------
3,5,8,2,7,8,9
2,2,2,3,4,5,6
5,6,5,5,4,3,2
... more >>
Identity
Posted by sardinka at 10/3/2003 11:41:49 AM
I have following query:
Insert table2(field2,field3,field4)
select field2,field3,field4 from table1
My field1 is identity. I wanted to insert data and
increment identity by 1 for spesific field2 value.
I was able to do if I inserted by 1 record:
SET IDENTITY_INSERT field1 ON
DECLARE @rID... more >>
non-SQL Trigger
Posted by Oliver Hoch at 10/3/2003 11:37:18 AM
Hi,
is it possible to use (instead of SQL) a programming language (C, C++, Java)
for writing Triggers within SQL-Server?
Thanks,
Oliver
... more >>
Limit use of processor to a SP
Posted by Pericles Sevegnani at 10/3/2003 11:22:35 AM
Hi folks!
I was wondering if I could limit the use of the processor in a Stored
Procedure execute.
I have this SP that requires a lot of processing and it takes the network
and the rest of the queries/processes too slow.
This SP runs once, sometimes twice a day, and it takes about 10-15 m... more >>
How do I make SQL server Case Sensitive!
Posted by Santosh at 10/3/2003 11:06:30 AM
I want to make SQL server 2000 to run Case Sensitive queries.
Any help is appreciated.
TIA,
--
Santosh
... more >>
A Simple Question
Posted by Johnsun at 10/3/2003 11:00:50 AM
Can I create a view from the following table:
GROUP MNTH REV
AAA 2 100
BBB 3 200
AAA 5 200
AAA 7 50
BBB 9 50
View results£º
GROUP MNTH REV myID
AAA 7 50 1
AAA 2 100 2
AAA 5 200 3
BBB 9 50 1
BBB 3 200 2
That ... more >>
identity field error
Posted by cct at 10/3/2003 10:57:27 AM
Dear all,
select IDENTITY(int, 1,1), * INTO #TEST from orders
encounter error:-
Cannot add identity column, using the SELECT INTO statement, to table
'#TEST', which already has column 'OrderID' that inherits the identity
property.
Do anyone know how to solve this.
Thanks.
... more >>
Database Design Pattern Question
Posted by Scott Good at 10/3/2003 10:40:08 AM
So this is my problem. I originally designed the
following table: (The real table is significantly longer.
I shortened the table for this discussion)
TABLE
---------
TableId
Ticker
Quantity
Currency
Price
MarketValue
Exchange
MarketCap
Beta
example data:
TABLE
-------... more >>
object owner
Posted by Falik Sher at 10/3/2003 10:37:11 AM
Please help me with following situation:
I restored a database from an old backup.
after restore, I found many objects have their own user name i.e.
user1.table1
Now I have created 'user1' in the security, but when I'm trying to give the
database access to that user, an error is popup that us... more >>
for each row check and then do something
Posted by Rick at 10/3/2003 10:35:59 AM
I have two tables that need to combined. Table#1 needs to
be processed row by row and for each row in Table#1 I
need to check Table#2 to see if that value exists. If it
doesn't then insert that row from Table#1 into Table#2.
How can I do this in TSQL?
thanks... more >>
Insert Rec's. Fires both (U/I) Triggers
Posted by Mickey at 10/3/2003 10:34:47 AM
I tried to create a trigger that will insert the user_name
and date for a inserted record. Another trigger that will
insert the user_name and date for a updated record.
Listed below are both triggers. When a record is inserted
into the database both the Update and Insert triggers are
fire... more >>
Finding Next Minimum
Posted by Ricardo Forde at 10/3/2003 10:30:15 AM
Hi. I have a table with ID's 1,2,3,4,...n. I have a while loop and for
every iteration through loop I am trying to select the next minimum id.
So if I start at 1 then the next one would be 2 and the next one would
be 3...etc
The problem I am having is that I get the first printed out and then ... more >>
how can i get column to write to text file?
Posted by Trint Smith at 10/3/2003 10:30:01 AM
I need to get sql server 2000 to send an entire column only from a table
to a text file from within a vb.net program...what is the command
please?
thanks,
Trint
..Net programmer
trintsmith@hotmail.com
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in U... more >>
substring syntax
Posted by cshow at 10/3/2003 10:10:07 AM
I have a table with sample data
Contame Address
Jim Smith 194 Main St.
Alice Jones 223 Center St.
How do i get a result set to look like this
First Name LastName Address
Jim Smith 194 Main St.
Alice Jones ... more >>
Overview of Readonly recordset
Posted by Lars Grøtteland at 10/3/2003 10:08:07 AM
I was wondering if there are any overview of when SQL EM sets the recordset
to read only.
Ex: SELECT DISTINCT TblName FROM TABLE1.
If I run this in EM, I''m not able to edit the fields, but when I''m not
using the distinct - I can edit the fields. Are there any overview when a
recordset is rea... more >>
Textcopy
Posted by KT at 10/3/2003 9:58:46 AM
Need some help, I have a table I was with three columns in it (It came
preloaded with .jpg images)
IDOWNER (INTEGER) IMAGETYPE (INTEGER) and IMGDATA (IMAGE).
the 2 records have
12 0 <binary>
13 0 <binary>
using textcopy I can pull and insert the JPG image from these rows. If ... more >>
can anyone find the problem with this SP??
Posted by Davef at 10/3/2003 9:56:01 AM
I don't get an error when it runs, but it does not seem to do what it is
suppoded to do,it does nothing.
CREATE Procedure UpdateQuoteInfoStockNo
(
@singleSTOCK_NO nvarchar(50),
@QuoteCookie nvarchar(50)
)
As
DECLARE @CountItems int, @id int
DECLARE @CountItems1 int, @id1 int
DECLA... more >>
Notifying operator when a record is added
Posted by CJM at 10/3/2003 9:52:22 AM
I have built a feedback feature on our intranet so that users can report
comments/suggestions/faults.
It's a very sinple ASP that writes their details/comments to a table.
I would like to set up a mechanism that emails me or one of the other
registered operators when a new record is added.
... more >>
Unknown error 778383 from INSERT statement
Posted by unsolicit NO[at]SPAM hotmail.com at 10/3/2003 9:51:35 AM
I am getting an error when the following INSERT query is run in either
a DTS package on SQL 2000, or query analyser.
INSERT
DestinationTable
(
TextId
, String
, Digit
)
SELECT
A.NewTextId
, A.NewString
, A.NewDigit
FROM
SourceTable A LEFT OUTER JOIN DestinationTable B
ON
... more >>
Equivalent of Oracle VARRAY
Posted by abhishes NO[at]SPAM hotmail.com at 10/3/2003 9:51:11 AM
Hello All,
I am writing a stored procedure where I need to pass an array of
values to the SP.
I know that in Oracle I can declare a parameter of type VARRAY for the
SP which can take an array.
How do I do the same thing in SQL server?
I will be very gratefull for your help.
regards,
... more >>
... not in ... vs ... not exists ... with NULL values in sub query result set
Posted by darren NO[at]SPAM mcmiller.com at 10/3/2003 9:48:28 AM
We are experiencing some peculiarities when using select … not in …
that seems to be due to the SUBTABLE query returning a result set with
NULL values. When this is the case the query always returns an empty
result set. But, if we use … not exists … or explicitly restrict the
SUBTABLE query, the... more >>
Obtain key info for newly inserted record
Posted by Randy at 10/3/2003 9:33:17 AM
I have a table with a primary key field of integer type
set to increment, auto-assigning the key value. Using VB
and ASP.NET, how do I insert a record and obtain the
value of the primary key such that I can perform
additional processing using that value?... more >>
Stored Procedure, Query and Acces Plan
Posted by Stéphane_DELAVAL at 10/3/2003 9:21:25 AM
Hello,
I have a big pb with my query,
If I run this directly, SqlServer create a good access
plan.
But if create a stored procedure, the plan is very bad.
And run very slowly
I tried to force the plan and the run of my stored
procedure is good. although the Request Analyser show me
tha... more >>
API Calls - What are these??
Posted by Sender at 10/3/2003 9:17:40 AM
What is a SQL Server API Call?
... more >>
BLOB T-SQL
Posted by Microsoft News at 10/3/2003 9:09:49 AM
I need to send parameters to my component.
It is blob type and you can't declare image,ntext,text as local variables in
T-sql.
How I can split Image in varbinarys(8000).????????
... more >>
Timestamp datatype
Posted by Leandro Loureiro dos Santos at 10/3/2003 8:58:08 AM
Friends,
I' d like an example of using datatype timestamp in MS SQL 2K.
Would anybody help?
Thanks
Leandro Loureiro dos Santos
... more >>
variable substitution in error handling
Posted by mdenis at 10/3/2003 8:52:36 AM
Hi:
I need your help in order to know how to record the
complete error message without variables names.
I am using a procedure to load data in a table and I am
recording in a log table the errors produced and load
statistics.
Mi procedure is simmilar to:
insert f_compro values (@var1,@va... more >>
Numeric/Decimal - Check Constraint Problem
Posted by psarnowski NO[at]SPAM mgasystems.com at 10/3/2003 8:45:32 AM
Is there any reason I wouldn't be able to create a check constraint on
a numeric/decimal column in SQL Server 2000? If I change the datatype
of the column to money or float my check constraint saves without a
problem. As numeric/decimal, it will not validate the constraint.
I have verified t... more >>
@@error is UNRELIABLE ??
Posted by tania at 10/3/2003 8:28:55 AM
Hi
sql server 2000 sp3 environment.
In my stored procedure I handle all errors I get.
E.g. , after any sql I say:
set @err_save=@@error
if isnull(@err_save,0) <> 0 goto: SoftErr
This catches normal sql errors raised by sql server.
HOWEVER, I have custom triggers as well that raise ... more >>
AlterColumn
Posted by jb at 10/3/2003 7:48:41 AM
I have a column in a table that I need to set the default to 0. I tried
Alter table inventory alter column qty default (0);
This doesn' t work. Can I set the default if there is data already in
the column?
TIA
... more >>
CUSTOM trigger errors NOT handled
Posted by tania at 10/3/2003 7:15:47 AM
Hi
In my stored procedure I handle all errors I get.
E.g. , after any sql I say:
set @err_save=@@error
if isnull(@err_save,0) <> 0 goto: SoftErr
This catches normal sql errors raised by sql server.
HOWEVER, I have custom triggers as well that raise errors
and my error handling does ... more >>
if exists + dynamic sql
Posted by lali at 10/3/2003 6:35:31 AM
Hi
I need to make sure that a table exists in another
database:
How can I do the following ? (I know the below is wrong)
if exists execute ('select name
from '+@dst+'.dbo.sysobjects where type=''U'' and
name=''archive'' ')
begin
....
end
Thanks a million !!
Lali... more >>
SELECT *
Posted by armin at 10/3/2003 5:10:23 AM
Hi,
I've heard somewhere that usage of "select * from
tablename where condition" is not quite good, it is better
to enter all field names instead of " * ". Can anybody
please give me some link or something else where I can
read about that?
Best regards,
Armin... more >>
|