all groups > sql server programming > december 2004 > threads for monday december 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 31
Dealing with Triggers
Posted by Leila at 12/27/2004 9:32:04 PM
Hi,
My delete trigger on a table assumes that one record is being deleted each
time. But there may be situations that many rows be affected by a delete
statement.
How can I process these records individually in Deleted table? Should I
necessarily use cursors or..?
Any help would be greatly app... more >>
Documenting a Database
Posted by Leila at 12/27/2004 9:29:28 PM
Hi,
I have designed and developed a database. Now I want to prepare some
documentation so that other developers can continue working on that.
How can I do this? Are there any standard ways to describe the entities and
procedures using some tools or etc.
Thanks in advance,
Leila
... more >>
Date of last index
Posted by John Geddes at 12/27/2004 8:34:40 PM
How can I find the date when a table was last indexed?
... more >>
Debugging SPs
Posted by Rajani Kanth at 12/27/2004 8:11:58 PM
Dear Sir,
We are working with VB6 and Sql server 2000. We do most of the
functionalities in SP and few of them grow more than 1000 lines. We need a
good tool to debug the Stored procedures. Can you suggest me any good tool.
Regards
Rajanikanth
... more >>
text field concatenation
Posted by Arun at 12/27/2004 7:06:43 PM
Hi,
Can anybody please tell me how do I concatenate a constant string with an
existing text field?
Actually my requirement is that I need to construct and give an xml output
within a stored procedure. Since the varchar/nvarchar datatypes has the size
limitation, I'm planning to have a temp ... more >>
change decimal attribute to numeric
Posted by shank at 12/27/2004 7:01:30 PM
I used DTS to transfer a bunch of tables.
All the [ID] field attributes changed from numeric to decimal.
Is there some fast way I can get them all back to...
numeric, Identity yes, identity seed 1, identity increment 1
It's real slow opening 30 tables in EM and editing.
thanks
... more >>
Select the avaible times and rooms
Posted by simon at 12/27/2004 6:46:48 PM
I have table with terms.
trmID startDate endDate
-----------------------------------------------------------------
1 20041228 6:15:00 20041228 8:45:00
2 20041228 9:00:00 20041228 12:30:00
... more >>
What the execution plan really means
Posted by John Geddes at 12/27/2004 6:39:33 PM
I have been using SQL for a while, but I am now needing to make a few
queries run faster.
I have a few that are pretty monstrous that take around 3 to 4 minutes
to run. I have run the execution plan, but I am not real sure what all
of these things mean.
The query in question is 300 line... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Adhoc Search...indexing optimization help please.
Posted by W. Jordan at 12/27/2004 5:42:02 PM
Hello All,
[Summary: Proper indexes are not used when querying with
parameters.]
I have a table which looks like
CREATE Table Clients (
itemID int primary key,
clientName nvarchar (32),
clientAddr nvarchar (90)
)
go
CREATE INDEX IX_clientName ON Clients... more >>
Determining what type of trigger...
Posted by Matthew Wells at 12/27/2004 5:32:39 PM
I have stored pros that are defined as insert, update and delete. What is
the best way to determine which event is firing? I already have
If exists (select top 1 * from inserted)
If exists (select top 1 * from deleted
Set @ChangeType = 'U'
Else
Set @ChangeType = 'I'... more >>
system sp's changed to user?
Posted by Matthew Wells at 12/27/2004 5:21:21 PM
For some reason, all my system stored procedures got changed to user. How
does that happen and how do I change them back??
Thanks.
Matthew Wells
MWells@FirstByte.net
... more >>
Recommend a tool for viewing XML generated by a sp
Posted by Pedro Valenzuela at 12/27/2004 5:08:46 PM
What tool can I use to view the XML generated by a stored procedure?
I have this very long XML that gets generated by a procedure and I need to
read it. Any recommendations for a tool?
thanks
Pedro
... more >>
Query Result Order
Posted by Carl G at 12/27/2004 4:58:15 PM
Greetings,
I have a table with index values like 1, 2, 3, ..., 99, 100. I am
interesting in processing the rows from the inside out so they are ordered
something like 50, 51, 49, 52, 48, 53, ..., 1, 100.
Does anyone have a suggestions on how that can be done? What is the best
approach?... more >>
UPDATE statement does not work in closing tree's gap
Posted by Joel at 12/27/2004 4:58:06 PM
I'm trying to close gap for a nested tree structure.
SQL Server keep on throwing exception:
Server: Msg 2627, Level 14, State 1, Procedure
uspDownsizeTree, Line 7
Violation of PRIMARY KEY constraint 'PK_OrgChart'. Cannot
insert duplicate key in object 'OrgChart'.
The statement has been ter... more >>
Error handling into SP
Posted by Chris V. at 12/27/2004 4:36:07 PM
Hi,
I'm writing some SP to automate some backup and restore.
In the restore SP, the SP scan an incoming folder, and restore one by one
the files present,
All works well until problem occurs one files.
In that case, the log I write become strange, the SP process some files but
not all witho... more >>
DATEADD strange results
Posted by Chris White at 12/27/2004 2:34:36 PM
This is some code I've ripped from a stored procedure. I want the first and
last possible datetime given a Month and Year. Please explain what is going
on in @edate and @edate2.
I was expecting @edate = '2004-09-30 23:59:59.999'
-----------------
DECLARE
@MTDYTD varchar(3),
@Month var... more >>
Update through View, Repost detailed
Posted by Jonh Smith at 12/27/2004 2:34:00 PM
I'd like explain situation detailed:
Definition:
We got application myApp which is going call myView of myTable, through
ODBC.
-----------------------------------------------------------
CREATE TABLE [dbo].[myTable] (
[myRecordID] [int] IDENTITY (1, 1) NOT NULL ,
[... more >>
T-SQL in BNF format
Posted by Ivan Arjentinski at 12/27/2004 2:07:37 PM
Hi all,
I need to find the grammar of T-SQL 2000 in BNF format. If someone could
give me any direction I would be thankfull.
I remember a post on the subject from Tibor Karaszi some time ago pointing
to SQL Resource Kit. I downloaded it, but I couldn't find the grammar. Maybe
I'm blind o... more >>
Date, VBA vs MS-SQL
Posted by Morten Snedker at 12/27/2004 12:52:32 PM
I have records with the date 01/01/2005
Here in Denmark Janurary 1. has week 53.
Select * From Book_Tmp Where Datepart(week,Dato)=53
returns 0 records, hence BOL:
January 1 of any year defines the starting number for the week
datepart, for example: DATEPART(wk, 'Jan 1, xxxx') = 1, whe... more >>
About xp_CmdShell
Posted by objectref at 12/27/2004 12:47:30 PM
Hi to all and many wishes for the new year.
i am building an application that one of it's parts is that SQL Server will
have to call either
a dll function or an external app with some arguments.
(either option it will perform an http request).
i surely would like to use the first option an... more >>
Canceling Transaction
Posted by Roy Goldhammer at 12/27/2004 12:35:53 PM
Hello there
On one of the triggers a transaction was begin and not end
In the same trigger i use SET XACT ABORT ON so on any error the trigger is
rolling back
This should do the job so the BEGIN TRAN on the same trigger is probebly
stuck the system
what should i do to release the transac... more >>
Update through view.
Posted by Jonh Smith at 12/27/2004 12:34:39 PM
Hello, Folks
Does somebody accomplish VIEW with Update statement?
... more >>
DB shrinking
Posted by Helen Stein at 12/27/2004 12:12:52 PM
Hello everyone,
1. What is the downside of having Autoshrink option set to true?
2. If I choose to do it manually, will it affect database performance?
Thanks,
Helen
... more >>
display all data in a long text column
Posted by Wendy Elizabeth at 12/27/2004 12:11:05 PM
On a SQL Server 2000 database that is on a remote server, I can not display
or obtain a copy of the data in a column that I defined as LONG TEXT using
Query Analyzer or the Enterprise Service Manager. They both seem to stop at a
point. (I need an extremely large column like this since I need t... more >>
sql or oracle
Posted by mahdavi at 12/27/2004 10:44:21 AM
Hi there,
I need to use a database.
But I don't know which database I must to use?
My database must have about 200,000 records.
My question is: what are criterias to choose a database?
How can I know which is more suitable for me?
Thanks a lot
... more >>
how can i make this query run faster
Posted by alvis at 12/27/2004 10:19:04 AM
Hi i have a query that normally takes 2 min to run on a developement server.
today i added one more feild and now the query takes over six mins to run.
i dare not put this on a production server could you please help me?
here the sql
?sql
SELECT convert(char(10),tbl_ldf_loaninit.init_s... more >>
sub query and loop through records question
Posted by Han at 12/27/2004 10:15:03 AM
Hi,
I want to write an update query that include sub query to retun max record
count number, then increase 1 every time update another table
This is my query:
UPDATE #CMRItem
SET CMRItemID = (SELECT max(CMRItemID) FROM CMRItem) + 1
I got this to work the way I wanted, but it update all r... more >>
How to set up a multiple SQL Server instances correctly?
Posted by === Steve L === at 12/27/2004 9:51:59 AM
I'd like to use the best practice of setting up multiple SQL Server
Instances.
I plan to do it on a w2k3 box with sql2k.
My goal is to set up 2 server instances on the same w2k3 box for a test
and QA environment. (Production database will be on a different box.)
I need some advices for th... more >>
DTS and File Exists
Posted by Joshua Campbell at 12/27/2004 9:35:47 AM
I have a DTS package that imports data from a text file into a SQL database.
The DTS works great, except that it fails whenever the file doesn't exist.
I don't want it to fail in that case. I wanted to know what others think I
should do. Should I create an ActiveX script in the DTS that checks ... more >>
SUM with SELECT
Posted by Darin at 12/27/2004 8:28:17 AM
This is what I want to do:
SELECT @last2=SUM((SELECT TOP 2 DATEDIFF(dd, h.phst_date, r.phrc_date)
FROM POHistoryReceipt AS r
INNER JOIN POHistory AS h ON r.phrc_order=h.phst_order
WHERE r.phrc_item='POASS8X1'
GROUP BY phrc_item, phst_date, phrc_date
ORDER BY r.phrc_date DESC))
I want t... more >>
Linked Server - Query
Posted by Ram at 12/27/2004 7:09:04 AM
Hi folks,
Server_a and Server_b are sql server 2000.
I have a linked server set up on Server_a to point to Server_b.
I can run select queries from server_a on tables in Server_b.
For example: SELECT * FROM server_b.userdb.dbo.table_a. This works Fine.
When I do a Update statement like:
UP... more >>
Filtering a voter?
Posted by Jon at 12/27/2004 5:49:02 AM
Hello,
I have three Tables tblUsers tblPictures and tblPictureRating
On my site the photographers can rate other photographers work, what I'm
trying to to do is filter out the photographs that a user may have voted on,
but for the life of me I'm struggling can you help here is the SQL that... more >>
BEST PLACEMENT of DB FILES
Posted by Tania at 12/27/2004 4:53:28 AM
HI
I have 5 hard drives on my sql server server.
No hardware or software raid.
I will be using filegroups to distribute data over hard
drives.
(our development databases: 90% query, 10% dml, avg. size
10 gigs)
Question 1:
What is the best placement for ?
tempdb, transaction logs ... more >>
How to delete related records using CASCADE on delete option
Posted by AKG at 12/27/2004 12:15:01 AM
Hi everyone,
I have a table as follows:
CREATE TABLE [dbo].[Objects] (
[ObjectID] [int] IDENTITY (1, 1) NOT NULL ,
[ObjectTitle] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[ObjectDesc] [varchar] (250) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
, [ObjectCreatedBy] [varcha... more >>
|