all groups > sql server programming > april 2007 > threads for friday april 27
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
DELETE trigger does not work on this particular table
Posted by Joseph I. Ceasar at 4/27/2007 3:52:42 PM
I have a very strange table on which I cannot create a delete trigger. I am
using SQL Server 2005. The INSERT trigger does work on this table. The
UPDATE does not work either. I have created the same table on two databases
on two separate servers!
Here is the table:
CREATE TABLE [dbo... more >>
insert question
Posted by GotDotNet? at 4/27/2007 3:39:46 PM
I have to do an insert on a table were 1 column needs to comes from tableA
other columns need to come from tableB.
so I have table A
Downloaded
Location
Table B
Name
Address
City
State
ZipCode
now the table I need to insert needs the following
Name
Address
City
state
ZipCode... more >>
How can I avoid using a UDF that takes 10 args (from column values) ?
Posted by placidite1 NO[at]SPAM yahoo.com at 4/27/2007 3:24:43 PM
SQL 2000 Question:What can I do if I need to 10 column values and do
logical processing on these columns to update a final column.
1-Since I cannot pass a Table to a UDF, I thought about using a UDF
that is passed all these 10 values and return the processed value and
that is a slow brutal way.
... more >>
Using READPAST locking hint in an UPDATE statement
Posted by mscott NO[at]SPAM eskimo.com at 4/27/2007 2:48:44 PM
I am executing an update statement similar to the following, which
includes a READPAST hint:
UPDATE t
SET processed = 1
FROM TxData t WITH ( ROWLOCK, UPDLOCK, READPAST )
WHERE processed = 0;
This statement does execute and skips locked rows as expected (which
is what I want)... more >>
Create Temp Table with Variable Name?
Posted by lucius at 4/27/2007 2:46:42 PM
I have a stored procedure that must create a result set with a
variable number of columns in the output. All I can think of is
creating a global temp table and doing all of the ALTER TABLE
statements I need to get the columns and then work on the table after
that. However, multiple users will ... more >>
MIN/MAX usage
Posted by Greg Collins [Microsoft MVP] at 4/27/2007 2:44:17 PM
I have a temp table that I create to build some statistics, the results =
of which I copy back to a live table.
My question is in regards to MIN/MAX and other such functions...
Do these get re-evaluated for every row, or is SQL smart enough to store =
the value for the next iteration? Becaus... more >>
joining on same table multiple times on different values
Posted by gv at 4/27/2007 2:42:44 PM
Hi all,
Having perfomance problems with this query (returning to many rows and
takening to long), related I think
to joining on the DomainDetail table 3 times.
Is there a better way to do this?
SELECT SO.SystemOrderID AS Order_ID,
SO.SystemOrderTypeID AS Order_TypeID,
SO.OrderStatusID... more >>
SQL Select Statement - posting again
Posted by RickSean at 4/27/2007 1:54:02 PM
I have posted this previously but didn't get the answer.
I am looking for a better solution with existing schema.
CREATE TABLE [dbo].[Category](
[CatID] [varchar](5),
[Cat1] [varchar](5) NULL,
[Cat1a] [varchar](5) NULL,
[Cat2] [varchar](5) NULL,
[CatA1] [varchar](5) NULL,
[Cat1b] [va... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
To expr or not to expr?
Posted by student at 4/27/2007 1:52:01 PM
I recently learned that I dont always have to use Expr in my select
statements. But whenever I remove them while inside of query editor and run
the query, the editor puts them back. How do I not use Expr in my sql select
queries and not get errors or have them put back?
--
Student... more >>
Help with a Stored Procedure
Posted by ISSB Programmer at 4/27/2007 1:50:04 PM
I'm having a problem with a Stored Procedure that uses an If Else statement.
When I take out the Else statement the SP works fine. As soon as I ad the
Else statement it displays the rows with no columns. Here is the complete SP:
ALTER PROCEDURE dbo.procTroubleTickets
(
@intTechAssigned int,... more >>
Returning success in sp
Posted by David C at 4/27/2007 1:34:59 PM
I have a new stored procedure (see below) that I want to be able to know if
it succeeds or fails but I'm not sure how to do that. Can someone help?
Thanks.
David
CREATE PROCEDURE [dbo].[fd_updMergeFiles]
(
@FileNumberFrom int,
@FileNumberTo int
)
AS
BEGIN TRAN T1
UPDATE... more >>
getdate()
Posted by gracie at 4/27/2007 1:30:00 PM
I'm trying to load a stored proc that contains the following:
INSERT dbo.rqst_rec_item_comment
VALUES (
@rec_item_id,
@rqst_date,
@serv_rqst_seq_nbr,
'DH',
@seq,
@comment_text,
getdate())
... more >>
Get Remote SQL Server Datetime
Posted by Ram at 4/27/2007 12:24:02 PM
Hi All,
I have 3 sql servers located at different time zones. Say, CST,PST,EST.
Now how can I get current time at EST,PST from the SQL server located
at CST? Is there any query to do that?
I have a stored proc located in SQL server at CST zone where I need to
query for the current date/time... more >>
possible to select rows where all chars in a col are uppercase cri
Posted by Rich at 4/27/2007 11:58:01 AM
Greetings,
I need to select rows from a table Where all characters in a
colum are uppercase. Don't get rows where any character is lowercase - only
want rows where all characters are uppercase. Can this be done with Tsql?
How to do this?
Pseudocode:
select * from tbl1 Where NameID is ... more >>
percent of total?
Posted by Chris G. at 4/27/2007 11:02:07 AM
I'm trying to calculate the percentage of totalAmount of a certain range of
fields.
i.e.
Vendor Qtr1 Qtr2 Qtr3 Qtr4 Total %ofGrandTotal
vendorA 10 10 20 10 50 31.25%
vendorB 15 15 15 15 60 37.50%
:
vend... more >>
Where is Management Studio?
Posted by Stephen F. Smith at 4/27/2007 9:36:02 AM
Developer in training, brand new to SQL Server 2005. Have full install of
SQL Server 2005 Pro installed under Win XP. I seem to have the tools, but
cannot locate Management Studio, or Books online. What am I missing?
Have tried to sign up in Forums, but signup won't take over there for so... more >>
Global Variables in DTS
Posted by Dream at 4/27/2007 9:06:33 AM
Hi all
in my DTS i have an Execute SQL Task that contain this :
Delete From MyTable where Num_Table = @MyGlobalVariable
my question is that can i use "Global Variables" in this excute Sql
Thanks
... more >>
Attach/Detach
Posted by Looch at 4/27/2007 7:31:42 AM
Hi All,
I'm trying to copy a database from one instance to another on a
different server. I detached the original, copied the .mdf and .ldf
files and attached in the new instance. The problem is all of my
stored procedures aren't showing in the new instance and I suspect
there are other probl... more >>
Help with a SQL Replace statement,
Posted by TheDude5B at 4/27/2007 3:51:36 AM
Hi,
I am wanting to write an SQL query which will find all references to a
name and then replace that name with another name.
eg.
Update tblDocuments SET '"Scottish Building" = "Scottish Building
Federation"
but as far as that goes I am at a loss how to do it.
Thanks,
... more >>
Performance difference in sproc vs table-valued function?
Posted by DWalker at 4/27/2007 12:35:09 AM
I'll guess the answer is either "No" or "It depends", but...
Is there generally any performance difference between a stored procedure
that takes an argument or two, and does a Select and a couple of joins,
versus a table-valued function that takes the same arguments and does the
same thing?... more >>
Sum(Avg(blabla)) doesn't work
Posted by Magnus at 4/27/2007 12:00:00 AM
Hello!
I'm trying to find an easy way to summarize a field where I first meassure
the average.
I got the query
select avg([13a]) from incidents where [13a]>0 and projectid like '61%'
group by ProjectID
that does work. This query returns several rows with averages for each
projectID. Th... more >>
Linked Servers ON SQL Server 2005, Access 2007
Posted by Andy Couch at 4/27/2007 12:00:00 AM
I am having a problem with linked servers, using SQL Server 2005 (SP2),
Access 2007 (New accdb file format) using Microsoft.ACE.OLEDB.12.0 on Vista.
I can create the linked server, running the test gives OK, the tree expands
to the Tables level, but then gives an Error.
Cannot fetch a row ... more >>
SQL Design Question - Exclusive Subcategories?
Posted by Rich at 4/27/2007 12:00:00 AM
I'm designing an SQL database and have the need to implement what was
referred to by one of the Wrox press books as "Exclusive Subcategories".
Basically I have a table with a column that need to be a foreign key from
more than one table.
Not sure if I can describe this very well, but it's ... more >>
|