all groups > sql server programming > august 2005 > threads for saturday august 13
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
CONDITIONAL 'WHERE'
Posted by Aleks at 8/13/2005 11:40:13 PM
THIS IS MY QUERY:
SELECT *
FROM users a
WHERE a.usertype = 'contact' AND ISNULL (a.FirstNm,'') LIKE 'MMColParam5%'
and ISNULL (a.LastNm,'') LIKE 'MMColParam6%'
AND STATUS IN (MMCOLPARAM7)
ORDER BY d.Attorney
-------
THE LINE WHERE IT SAYS "AND STATUS IN (MMCOLPARM7), I WANT TO... more >>
problem with # sign
Posted by Laura K at 8/13/2005 11:34:42 PM
I have a stored proc that takes a parameter and finds the correct row.
Simple and easy. Unfortunately the data contains various symbols such as #
and -. When I run the proc and try to pass a value that contains a symbol I
get an error. The sp works fine when there are no symbols. Any
sug... more >>
Not using relations
Posted by Bob at 8/13/2005 10:30:29 PM
Looked at some of the table structures of some commercial packages, even
some popular CRM stuff and business solutions stuff (not naming names, don't
wanna get sued :-) ). Found that lots of them did not have any PK FK
relationships defined in the databases at all.
That means that all referen... more >>
Constants in TSQL
Posted by Frank Rizzo at 8/13/2005 7:36:16 PM
Hello,
Is there such a thing as constants in TSQL (similar to constants in
other languages)? I've looked in books online and can't find any
references to them.
Thanks... more >>
Websites for Triggers!
Posted by Arpan at 8/13/2005 4:16:46 PM
Can someone suggest a few websites (other than Microsoft) which explain
Triggers in SQL Server especially multi-row UPDATE Triggers?
Thanks,
Arpan
... more >>
IDENTITY Column!
Posted by Arpan at 8/13/2005 2:36:07 PM
A table named Products1 containing 20 records has the following
columns:
PID int IDENTITY (1,1)
PCode varchar(50)
PName varchar(50)
PDesc varchar(500)
Price money
Qty int
I created another table named Products2 whose design is exactly the
same as the design of the table named ... more >>
Grouping records - HOW TO
Posted by Phil at 8/13/2005 2:02:04 PM
Hi,
Is there a way that I can get the same sort of output as when you create a
relationship between two tables, but with only one table?
With a dataset containing two (or more) tables that has a data relation
added, you get a resultant output (say a datagrid) that groups by the column
de... more >>
Query Access & MS SQL
Posted by John at 8/13/2005 1:31:11 PM
Are syntax of queries same in MS Access and MS SQL 2005?
I am asking because I have lot of queries in Access database. Do I have to
change every query when I move to MS SQL 2005?
Thanks!!!
... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Cannot enter data into database
Posted by Karolus at 8/13/2005 11:19:01 AM
I'm a SQL newbie and am totally perplexed. I have tried to enter the
following data and I get the subsequent message.
INSERT INTO t_Answer ( AnswerID, AssessmentID, QuestionID, EvaluationValue,
AnswerText, CreationUser_ID, RevisionUser_ID )
VALUES ( 457 , 130, 4, '14', 'testing what I want... more >>
Single 5 mil row update or many 1000 row updates?
Posted by Richard C at 8/13/2005 8:49:30 AM
Hi,
I'm looking for some feedback as to which of these two approaches to a
problem is better. We're dealing with 5 million records of 100 million to be
updated, and both plans come up as clustered primary key scanning. On the one
hand, a DBA has come up with:
(the primary key of sourcet... more >>
Error when updating
Posted by Job at 8/13/2005 8:36:48 AM
I get the following error when I execute the statement below. 'Invalid
length parameter passed to the substring function'
Update Tbl_Txn_UT
Set Fxd_Units =
CASE
WHEN TxnUnitsBase is Null and (TxnUnits like '%,%' or TxnUnits like
'%M%' and TxnUnitsDur like '%M%')
THEN Cast(left(Txn... more >>
string search
Posted by Rama via SQLMonster.com at 8/13/2005 7:16:37 AM
from a string like - [text].[text].[text].&[1]&[4], I need to extract the
numbers alone.
Can someone help me with a function that searches and returns the numbers
within the "&[ ]" pattern?
thank you!
--
Message posted via http://www.sqlmonster.com... more >>
Query
Posted by Smitha at 8/13/2005 5:50:03 AM
i have written a SP to select multiple columns from a table.now how do i
display the same in the corresponding text boxes that i have in my form...... more >>
Help! CUBE? ROLLUP? or COMPUTE BY?
Posted by OKLover at 8/13/2005 5:10:03 AM
Help! CUBE? ROLLUP? or COMPUTE BY?
Giving a table's content as below...
Date Area Product Amount
------------------------------------------------------------------------------
2005/07/23 CA Book 150
2005/07/29 NY Pen 70
2005/08/03 CA Pen 500
2005/08/04 CA Book 200
2005/08/05 NY B... more >>
The SUM question
Posted by OKLover at 8/13/2005 4:55:14 AM
I have one table as below:
item_id amount inout
----------------------------------------------------------------
1 13 1
1 20 1
1 7 0
1 24 1
2 10 0
2 20 1
How to use the SELECT command to SUM the amounts according the inout (when 1
is +, 0 is -) and item_id field?
For ... more >>
Problems with GROUP BY
Posted by Marco Napoli at 8/13/2005 12:00:34 AM
I have the below SELECT statement and I am having a problem:
SELECT status, SUM(NoItems) * Price AS NewRevenue
FROM orders
GROUP BY status, Price
The problem is because I need to place the Price field in the GROUP BY I
receive multiple rows. I need the result to be on one row. Any ideas o... more >>
sql query
Posted by ichor at 8/13/2005 12:00:00 AM
hi i can get the result mentioned below using a cursor but want to have a
single query to do it. can any one help.
drop table #cost1
create table #cost1
(
prod_id int ,
cost decimal(9)
)
insert into #cost1 values (1,10000)
insert into #cost1 values (2,10000)
select * From #cost1
d... more >>
Query help please
Posted by Andrew Jocelyn at 8/13/2005 12:00:00 AM
Hi
I have a results set which is contains IDs where the word column matches
some search criteria. Here is a simplified example. I can get the results as
if it was an 'OR' search but I need to make it like an 'AND' search. Please
see below.
create table #results (rID int, word varchar(50)... more >>
Questions
Posted by Bpk. Adi Wira Kusuma at 8/13/2005 12:00:00 AM
my question is:
"Is there different speed of process? or Which Statement owning quickest
performance speed in Process?"
DELETE FROM TB1 WHERE NOID LIKE 'A%' and FAge<=10
or
DELETE FROM TB1 WHERE FAge<=10 and NOID LIKE 'A%'
You need to know that the field NOID have the index, While Fage ... more >>
Alert from addition to table
Posted by tony wong at 8/13/2005 12:00:00 AM
The SMS provider will update my SQL server when there is incoming SMS
message.
apart from regular manual check on table
how can i know there is incoming new SMS message?
alert by email? any guidance?
Thanks.
Tony
... more >>
PowerBuilder connect to Access(get an error SQLSTATE = 01S01 )
Posted by guo-feng lui via SQLMonster.com at 8/13/2005 12:00:00 AM
I am trying to connect Microsoft Access Database from PowerBuilder(ODBC),
when execute a select clause, get an error SQLSTATE = 01S01(Row errors), but
trying open the database from Microsoft Access 2000 tools , the row is very
good. I am puzzled this error. Someone help me to this problem, ... more >>
|