all groups > sql server mseq > june 2005
Code for Scripts
Posted by Chad at 6/30/2005 10:37:07 AM
I'm looking for code that will create a script of a stored procedure vs.
going through the gui. Can anyone help?... more >>
select most common value
Posted by Leo at 6/28/2005 2:24:06 AM
I am trying to create a list of the top 5 values in a column where I can
select which top value I want. For example with values
1,1,2,3,3,3
I can select the 2nd most common value (which is 1).... more >>
Return Part of a text field
Posted by tdom at 6/23/2005 9:10:01 AM
I have a table with a field named "swNotes". The field type is ntext. The
field can contain a variety of data. What I need to do is pull out just one
particular piece. Here is an example of 4 different rows of data in the
"swNotes" field:
--> Color = Green <-- --> Number = 1 <-- --> N... more >>
Insert non duplicate data
Posted by Leo at 6/22/2005 9:12:04 AM
I'm trying to construct an insert statement which will only insert data if it
hasn't been inserted before in the same table, i.e. insert x,y into table
where not exists (select x,y from table), or some such statement. Is there an
easy way of doing this - maybe an if statement that selects x,y ... more >>
prompt for parameter in a view
Posted by Tyler at 6/22/2005 8:17:04 AM
I would like to create a view that will prompt the user for a parameter.
Much the same way a user can provide the paramenter for a query in Access.
Seems like it should be simple, but I don't know how to do it.
Any ideas?
Thanks
--
Tyler... more >>
SQL and Grouping
Posted by gerryo at 6/22/2005 7:27:06 AM
This should be simple but I just can't get it. Please Help!
I have a table that contains hourly records, with a begin time and end time,
and a value field. I need to group these so they are not hourly anymore.
For example:
TABLE BEFORE
NAME BEGIN END ... more >>
Is Stored Procedure and 'in' broken in MSDE 2000/SQL 2000 SP4?
Posted by Tuner Fich at 6/21/2005 8:36:05 AM
This is not the command that im running but demonstrates the problem just
fine, basically 'in' using statored procedures seems to be performing as 'in'
or 'is' where as sending a query direct (identical) only performs 'in' as
expected
Example
Use msdb
Select * From Sysalerts Where datab... more >>
Records Duplicating after a Join
Posted by Wez at 6/17/2005 10:07:07 AM
I have two tables as follows:
Orders (ORDERID, CODE, ORDERQTY)
and
STOCK (CODE, LOCATION, STOCKQTY).
I am running a query that will display all the records in the Orders table,
and also a valid location for that code i.e. Fields returned are:
ORDERID, CODE, ORDERQTY, LOCATION
I am ... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Query ... Distinct rows
Posted by Wez at 6/17/2005 3:30:02 AM
I have a table as follows
ORDER_ID CODE STATUS
1000 XA3 5
1000 XA1 4
1000 XA7 5
1001 X35 5
1001 XA3 5
I want to run a query that will re... more >>
Stored Procedure - Obtaining Output
Posted by Wes at 6/14/2005 8:04:01 AM
Hi,
I would like to set up a stored procedure that does the following...
- Check does a record exist in a table
- Return the result (as True or False)
My query is simply
SELECT * FROM TABLE WHERE CODE = '123'
How to I trap the output of this query (as a True or False)!
Thanks,
Wez... more >>
using distinct on specific columns
Posted by TC at 6/8/2005 7:45:02 AM
Is it possible to use the DISTINCT on specific columns? For instance: a
table has ColA,ColB,ColC and I want my SELECT DISTINCT to focus on ColA and
ColB but also return ColC. However, ColC is not part of the DISTINCT clause.
Thanks... more >>
extreme help with query of 2 tables into 1 long table
Posted by BIGLU at 6/7/2005 10:26:02 AM
2 tables user id is key
Table (A) 05_Users
user_id | first_name |last_name|title|dept
64|John|Doe|director|cis
65|Jane|Doe|ceo|fina
and
Table(B) 05_Users_Details
user_id | detail_cd | group_cd | detail_value
64|06|awdM0|null
64|07|awdD0|null
64|2005|awdY0|null
64|FreeText|awdTxt0|I en... more >>
Identity or Sequence column in non-table SELECT ?
Posted by GlennM at 6/2/2005 12:44:02 PM
I'm looking for a way to specify a column in a SELECT statement
that is a sequence number related to the record number in the result set.
Ideally, just a number from 1 to N.
Example:
Select <???> as Sequence, column1, column2 from table1
The Identity function can do this, but only for SELECT ... more >>
Wildcard with Update
Posted by Donn at 6/1/2005 12:47:21 PM
SQL 7.0
Need to replace all
AB 2005-XXX
with
C 2005-YYY
Thinking about the following...but, the '%' is taken as a literal in 'C%-YYY'.
update table
set f1 = 'C%-YYY'
where f1 like 'AB%-XXX'
Thanks,
Don
... more >>
|