all groups > sql server programming > september 2003 > threads for wednesday september 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
Software to update roduction server schema?
Posted by Brian Bischof at 9/3/2003 7:43:40 PM
Hi All,
A few weeks ago I came across a vendor's site that sold tools for working
with SQL Server and I lost the link. One tool updated the production
server's tables with the table schema from the development server. The other
tool did the same for replicating data (which we don't really care... more >>
Select Column Depending on Val in Other Column
Posted by Jay at 9/3/2003 6:50:16 PM
In Table1 I have 3 column:
ProdID varchar
Price1 money
Price2 money
Data like so:
123, $50, $75
456, $8, $0
789, $67, $56
345, $32, $0
....
I need to select ProdID and Price(1 or 2) depending on if Price2 is $0. If
Price2 is $0 then I need to return Price1. So the result would ... more >>
comparing tables
Posted by Sandra at 9/3/2003 6:23:25 PM
What is the best way to compare column by column in a
table for every single row? This is how I'm doing.
select ta.*, tb.*
from ta full outer join tb
one ta.col1=tb.col2
where (ta.col2 <> tb.col2 or
ta.col3<> tb.col3 or
ta.col4<> tb.col4);
Any better way to do this. My table has 30 colu... more >>
phone number format
Posted by Sandra at 9/3/2003 6:11:41 PM
How do I format the phone number column in a table?
ex. 650-324-1566 I want to have 6503241566
thanks in advance for any help... more >>
atomicity of update statement with implicit select
Posted by Thane Peterson at 9/3/2003 6:11:02 PM
I execute this update statement:
Update tablex
set LastTimeTaskPerformed = getdate ()
where datediff (minute, LastTimeTaskPerformed, getdate ()) > 5
Implicit in the statement is a read of the current value of
LastTimeTaskPerformed for the where clause. Can I assume that the read and
th... more >>
Join problem...
Posted by Vitamin at 9/3/2003 6:09:29 PM
Hi all professor,
I have great problem in join table, let me explain first:
tblComp
CompanyID (PK)
Company_Name (varchar)
tblSupp
CompanyID (PK)
Ranking_ID
Supplementary_info (varchar)
Description
-- a company can have multiple record
tblKeyword
CompanyID
Keywords
-- a company ... more >>
Global Constants In SQL Server
Posted by Darren at 9/3/2003 5:58:11 PM
Is there a way to set up global constants when writing a
whole collection of stored procedures in SQL Server?... more >>
Heres a sub-query brain teaser for you!
Posted by sfrattura at 9/3/2003 5:38:13 PM
---Table One Data (5 rows):
id (int)
value (char(4)
123 Alph
123 Brav
123 Char
234 Delt
234 Echo
----Table Two Data (5 rows):
id (int)
value (char(4)
123 Mets
123 Reds
234 Sox
345 Yank
345 Dodg
Basically, I want in one statement to return th... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Help with a function?
Posted by Jason Davis at 9/3/2003 5:15:20 PM
Hi there,
I'm seeking for a sql2k function that will allow me to pass 2 variables:
original_string and keywords and to get back a string with the keywords
"highlighted".
i.e- if I run this: Highlight('hello, the world is great','hello,world')
... more >>
query Count(*)
Posted by jonathan at 9/3/2003 4:57:26 PM
Sorry if this is a double post, i did;nt think it posted the first time
Hi, i finally got a query to work how i want,
I have 2 tables with a 1 to many relationship using TaskID.
Table structures are
tblTask
TaskID
tasked_for
what_task
Task_created
Task_completed
tblGroupTask subform)
... more >>
Re: Heres a sub-query brain teaser for you!
Posted by Isaac Blank at 9/3/2003 4:48:26 PM
Oops.. hit the "send" button too early...
I wanted to sign "deep in Oracle and knee high in DB2"
Isaac
"Isaac Blank" <izblank@yahoo.com> wrote in message news:...
> I thought you were only allowed to post RAC solutions...
>
> deep
> "oj" <nospam_ojngo@home.com> wrote in message
> news:u8... more >>
varbinary data in extended stored procedure
Posted by Ronald Ruijs at 9/3/2003 4:37:04 PM
Hello,
Anyone who wasnable to pass varbinary data to an esp? In my case, the
srv_paraminfo function gives me a length of 1.
Any ideas are welcome.
Best regards, Ronald
... more >>
Script using CASE clause
Posted by Julio Gonzalez at 9/3/2003 4:32:02 PM
Hi all!!!
I have the following script using case clause...but its not working.. Please
tell me if you see something wrong
SELECT a.Site, case a.Customer when null then b.salescustomer end as
customer, b.SalesCustomer
FROM vw_summary_parts2020 a
full OUTER JOIN vw_summary_sales2020 b ... more >>
Declaring USER_NAME() as SQL Variable
Posted by Jon Maz at 9/3/2003 4:04:03 PM
Hi,
I have a User-defined function "Concatenate_NoteTexts" which I use in a
query (SQL Server 2000). On my local development machine it is called like
this:
SELECT
dbo.Concatenate_NoteTexts(Introducers.IntroducerID) as NoteTexts
FROM tblIntroducers
I want to run the same code on ... more >>
Scheduling Reports
Posted by Kirby at 9/3/2003 3:41:54 PM
I am trying to create a simple report scheduler...
I am using the SQL Server Jobs Scheduler to run a VB program,=20
that then runs an Access Function=20
That creates a report and emails to a group of people.
The process works great when I run the VB executable from the Start =
Button, but whe... more >>
Update Problem
Posted by Brian at 9/3/2003 3:37:53 PM
I'm having trouble updating multiple rows in a single statement, I keep
getting the following error
'Subquery returned more than 1 value. This is not permitted when the
subquery follows =, !=, <, <= , >, >= or when the subquery is used as an
expression.
The statement has been terminated.'
... more >>
can someone help with complicated query...
Posted by michael gois at 9/3/2003 1:55:21 PM
Hi
Can someone please help me on this, here is the setup:
(this is a simplified version of what im working with)
A table of orders - tb_Orders
- intOrderNumber
- intQuantity (quantity ordered)
A table of reservations - tb_Reservations
- intOrderNumber
- intBatchNumber
- intReservedQuan... more >>
batch commands in query window
Posted by m bixby at 9/3/2003 1:48:44 PM
Hope someone can clear this up for me:
when I run the following operations individually,
everything is fine, when I structure a batch of commands
as so:
GO
DROP TABLE tableA FROM backupDB
GO
SELECT *
INTO backupDB.tableA
FROM mainDB.tableA
GO
DROP TABLE tableB FROM backupDB
GO
SELEC... more >>
Another Distinct Question!
Posted by DBZ at 9/3/2003 1:47:38 PM
I have a query that I have to retrieve specific results from in another
query.
The current query looks like this:
SELECT CustomerEmail, CustomerID
FROM dbo.CustomerSurvey
It generates this result:
CustomerEmail CustomerID
you@you.com 1
me@me.com 2
me@me.com 3... more >>
clear buffer pages.
Posted by Dinesh Priyankara at 9/3/2003 1:34:19 PM
Hi all,
Hope you all can answer this question immedietly.
As you all know, we can clear the procedure cache by running DBCC
FREEPROCCACHE. Can anyone tell me the way to clear the Buffer cache(pages)?
As per my knowledge, once freed the buffer pages, logical reads for a query
should be 0. ... more >>
Mail Profile
Posted by brian at 9/3/2003 1:32:29 PM
I can't configure SQL server 2000 mail profile. I had
the SQL agent mail configured and working awhile back and
now it just stopped working. When you go into the
properties of the sql agent the mail profile selection
box is grayed out.
Does anyone have any ideas on how to be able to sel... more >>
What's the difference
Posted by Ale K. at 9/3/2003 1:26:21 PM
Silly question....
What's the difference between a JOIN an INNER JOIN, let's say something like
Select * from Clients INNER JOIN Invoices on Invoices.ClientID =
Clients.ClientID
and
Select * from Clients JOIN Invoices on Invoices.ClientID = Clients.ClientID
Thanks.
Alex.
... more >>
Relational design requires ......
Posted by sparko at 9/3/2003 1:21:46 PM
...... the existance of table check constraints, which in
turn should allow sub queries, such as;
check exists(select * from othertable where
othertable.column = column)
MS SQL Server does not like this??
How to enforce referential integrity in MS SQL Server??
trigger?
best wishes... more >>
Insert Trigger causing loss of hair!!!!!!!!!!!!!
Posted by caeriel1 NO[at]SPAM earthlink.net at 9/3/2003 1:09:53 PM
Hi:
I'm really new to this business of triggers and this is my first attempt. Here's the problem: I need to update several
fields in a table in a different database when the value of this field is inserted. The problem is that when I initiate
the Fetch from within the cursor_update_status cu... more >>
Help with my query ?? Please?
Posted by Ale K. at 9/3/2003 12:11:00 PM
Hi, i'm just wondering how can i do the following query
I GOT 2 TABLES ( Examples Table No Based on my DB )
Clients Invoices InvoiceItems
ClientID ---I InvoiceID--1--- ItemID
Name I----ClientID I ... more >>
Arithmetic overflow error
Posted by Mark Frank at 9/3/2003 12:09:15 PM
Hi all,
Not sure what this error is as it seems to be self-
contradicting. Should I set Arithignore ON?
Arithmetic overflow error converting numeric to data type
numeric.
Warning: Null value is eliminated by an aggregate or other
SET operation.
Thanks in advance,
Mark... more >>
sql agent proxy account
Posted by Patrick at 9/3/2003 12:03:37 PM
Hi Friends,
How can I assign an local ( sql server authenication ) account as proxy
account for sql agent?
It is always asking for domain?
And also how can I remove the already assignmed proxy account ?
Thanks in advance,
Pat
... more >>
Alter table
Posted by William Orova at 9/3/2003 11:33:41 AM
Yes:
Is there any way to alter all of the columns in a table to be set to
accept nulls, and then reverse this procedure? Without 200 alter table
statements?
Bill Orova
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!... more >>
error message help
Posted by Steve Chatham at 9/3/2003 11:16:24 AM
Server: Msg 8115, Level 16, State 2, Line 3
Arithmetic overflow error converting expression to data type int.
Server: Msg 8115, Level 16, State 2, Line 4
Arithmetic overflow error converting expression to data type int.
I'm getting this error message on 4 of the fields I have on a table on my
... more >>
Creating identity field that restarts when other field changes
Posted by Thiago Almeida at 9/3/2003 10:55:40 AM
if I have a table with a field of type int and another field of type
varchar, how can I do an insert that will have the int field behave sort of
like an identity field but that restarts when the varchar one changes. For
example, the result would be like this:
IntField VarCharFiel... more >>
Regular expression in T-SQL
Posted by Ray at 9/3/2003 10:52:18 AM
Hi all,
Is it possible to run something like this?
Replace('abc123def', [1-9], '')
so result be like: 'abcdef'
Thanks in advance
Ray... more >>
Query Issue.....
Posted by wibble at 9/3/2003 10:43:57 AM
I have two tables.
Messages and Blocked.
Messages Contains
FromID
ToID
Message
Blocked Contains
BlockID
BlockingMemID
BlockedMemID
I need to list messages only for a given member where the sender (FromID) is
not on the members blocked list.
Issues:-
Not all members will hav... more >>
Data Transformation Service
Posted by Patrick at 9/3/2003 10:37:32 AM
Hi Freinds,
Under Data Transformation Service there are 3 options to choose:
-Local Packages
-Meta Data Services Package
-Meta Data
What are the basic difference between them?
Thanks in advance,
Pat
... more >>
How to pass ORDER BY paramter into an SP with the DESC keyword
Posted by Carl Imthurn at 9/3/2003 9:48:15 AM
Hello everyone –
Looking at posts in this newsgroup, I was able to figure out how to pass an “order by” parameter into a stored procedure (as follows):
CREATE PROCEDURE s_TestSortOrder @SortOrder int
AS
SET NOCOUNT ON
SELECT * FROM PatientBillerAssignments
ORDER BY
CASE @SortOrder WHEN... more >>
SQL XML
Posted by Gedas Gudenas at 9/3/2003 9:32:55 AM
I am getting this error:
"The column prefix 'x' does not match with a table name or alias name used
in the query."
Anybody knows how to fix it. I am sure it's something simple I just can't
see it
update parentProducts
set
parentProducts.categoryID = x.categoryID,
parentProducts... more >>
Query with Identity
Posted by sardinka at 9/3/2003 9:31:50 AM
SET IDENTITY_INSERT type ON
DECLARE @RID int
SELECT @RID = max(R_type_id) + 1 from r_type where s_id = 3
INSERT r_type(@RID,r_type,s_id,a_id)
SELECT DISTINCT Null,r_type,s_id,a_id
FROM main WHERE r_type
NOT IN (SELECT r_type FROM r_type where s_id=3)
and s_id=3
SET IDENTITY_INSERT type OFF... more >>
Development Question 2
Posted by Tim at 9/3/2003 9:25:49 AM
I would like to create a hierarchy structure such as Figure 2 given the data
from Figure 1.
(Figure 1)
ID Type Description
------ -------- ------------
1 Contract Practice
2 Contract Recruit
3 Contract Development
4 ... more >>
built -in SQL server functions
Posted by Joe at 9/3/2003 9:20:14 AM
I would like to use SQL server suppied functions in my
querie's SQL statements from an Access 2000 application
that uses ODBC connection. Is this possible and what is
good web site for a list of SQL Server supplied functions.
The Admin will not allow stored procedures.
Any help will be ap... more >>
Data truncation problem
Posted by Ken at 9/3/2003 8:45:03 AM
I am working on a program that will insert hundreds of
rows into a summary table. The input data is oftentimes
not very clean and in some case we only want to keep
portions of it. For example, a field that is defined as
varchar(200) in the parent table might only be varchar(50)
in the summ... more >>
Development Question
Posted by Tim at 9/3/2003 8:18:12 AM
I have the following: Last Name and First Name are exactly alike(see figure
1). I want to group them and increment the counter as seen on Figure 2.
Can someone help me write the T-SQL for this? Thanks in advance.
Regards,
Tim
(Figure 1)
ID Last Name First Name Co... more >>
cascade on update
Posted by warren at 9/3/2003 7:37:53 AM
Just wondering if anyone knew the systable(s) where i
could alter 'cascade on updated' for all fkey
relationships in a table?
thanks in advance,
Warren... more >>
I/O
Posted by William Orova at 9/3/2003 7:29:57 AM
Does the (alter table, alter col for null or not nulls)
use a i/o operation or is it just altering the master or
sys tables to allow or disallow nulls?? If it does is
there a way to change the null factor with out a i/o cost?
Bill... more >>
Job in Chicago
Posted by John Smith at 9/3/2003 5:11:22 AM
I don't know if this is bad forum to list a "Help Wanted" sign in this news
group, but here goes...
We have an opening for a SQL, VB programmer. Pay rate is DOE. Can start
ASAP. Benifits included. Location is in Hoffman Estates, IL.
Sorry I'm not a headhunter or programer, so I didn't dre... more >>
query??
Posted by u50415039 NO[at]SPAM spawnkill.ip-mobilphone.net at 9/3/2003 4:36:02 AM
#temptable (studentID,p/f,examid,examname):
1 p
2 f 100 bio
2 f 101 mTH
2 f 102 CHM
2 f 103 spts
2 f 104 LIT
2 f 107 geo
2 f 109 phys
2 f 110 eng
2 f 111 hist
3 p
4 f 100 bio
4 f 102 chm
4 f 109 phys
4 f ... more >>
Ident_Current problem because of a constraint
Posted by Glen at 9/3/2003 4:24:52 AM
Hi,
I have a table that has a unique index defined on it.
If an INSERT is attempted that violates that constraint, an error message is
returned and the row is not inserted.
However, the row was actually inserted, then removed again. The
Ident_Current returns the identity value of the row... more >>
Calling function from procedure
Posted by girishpal NO[at]SPAM hotmail.com at 9/3/2003 3:35:56 AM
I have a databse named db, I have created a function fn in it.
I want to call the function fn from procedure pr but the procedure on
execution givees the error Invalid object name, The database was
created by and I ahve all the privilges on it. The procedure and
function are both in same databas... more >>
sql problem
Posted by Acubed at 9/3/2003 3:28:27 AM
I have 2 tables the first table custAddress contains the fields recordNum,
first name, last name, address, city, state, zip, phone
the second table called corrected_info and contains recordNum, first name,
last name, address, city, state, zip but no phone
how would I update custAddress with the ... more >>
Store Special characters in VarChar Field
Posted by James at 9/3/2003 3:01:03 AM
I have an application that contains a text field the user
can past an URL addess in. This text field will then be
stored in a database table. I have written a Stored
Pocedure to store this value in the table as a VarChar
type.
When attempting to save an address that containt the '&'
te... more >>
Terminology confusion : Column or Field
Posted by Ajit Singh at 9/3/2003 12:37:27 AM
In a RDBMS database terminology, can I use Column or Field interchangeably?
if no, could you please tell the difference.
Thanks,
Ajit.
... more >>
|