all groups > sql server programming > august 2004 > threads for monday august 2
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
INSERT INTO with ORDER BY clause in the SELECT
Posted by User at 8/2/2004 11:54:43 PM
Is there any significance or reliability in putting an ORDER BY clause in
the "derived table" of an INSERT INTO statement?
In the example below:
#A is a table with an identity column representing the order in which
entries were made into table #A
If these records are copied to #B with a INSER... more >>
Running multiple instances
Posted by brian at 8/2/2004 11:33:01 PM
What are the recommendations for running multiple instances of SQL Server on a production server? Is the general view that you should avoid this setup? ... more >>
START WITH
Posted by Frank Dulk at 8/2/2004 11:04:49 PM
I have a structure organization in tree form, for that I set up the
following tables:
T_ELEMENTOS
IdElemento Nome
01 MJ
02 SNJ
03 SNSP
T_HO
IdHO IdElemento IdHOPai
01 01 NULL
02 02 01
03 03 01
In Oracle for me to see the tree I pass the following instruction SQL:
SELECT * ... more >>
DMO or perfprov
Posted by tram_e NO[at]SPAM hotmail.com at 8/2/2004 8:33:46 PM
I am writing scripts to monitor sql server. Microsoft supplied WMI
scripts with sql 2000 CD which uses DMO objects. It is easy to write
MOF using perfprov. Which method is less overhead for the server?... more >>
Update date field
Posted by Frank at 8/2/2004 6:08:27 PM
Hi,
I am trying to update a field in my table after update -
this field is a datetime field and I want to capture the
datetime that the record was updated.
Please help,
Frank... more >>
Question about null values in Transact SQL case statement
Posted by Kevin Davidson at 8/2/2004 5:47:42 PM
I wrote some SQL for SQL Server 2000:
select case A_Number
when NULL then 9999
else A_Number
end ...
When A_Number is NULL, case returns NULL. I thought it would substitute
9999. Why didn't it?
(And yes I know about ISNULL.)
Kevin... more >>
copying rows
Posted by Darren Woodbrey at 8/2/2004 5:00:04 PM
I have a work order system with 6 tables. When the first asp form is
submitted it creates a record that has an identity field in the maintable.
it also inserts a record into the other 5 tables putting the identity field
in each table as the PK. The user then submits an asp form for each table
... more >>
Alter Table Question
Posted by Kevin Cochran at 8/2/2004 4:33:08 PM
Greetings,
How do I insert a column on a table into a certain order? I have seen this question a few times in my searching the web, and a few people have answered something to the effect of "just add it to the end and use a view to change the column order". I don't mean to be offensive, but that'... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
error while using bcp...
Posted by John P at 8/2/2004 4:33:08 PM
Hello,
Im getting the following when trying to bcp out a query w/ a lot of fields
Starting copy...
SQLState = S1000, NativeError = 0
Error = [Microsoft][ODBC SQL Server Driver][SQL Server]Warning: Server data (3046 bytes) exceeds host-file field length (0 bytes) for field (1). Use prefix le... more >>
Update query
Posted by Zed Gorski at 8/2/2004 4:13:08 PM
Hi,
I have simple table with information
Col1 Col2 Col3 Col4
1 1 1
1 1 2 ABC
1 1 3
1 1 4
2 7 3
2 7 4
2 7 8 ... more >>
timeout expired connecting to database
Posted by enrico rossi at 8/2/2004 3:58:39 PM
Hello there!
I stopped a DTS package, by selecting the "cancel" button,
after that I closed the window, and now I cannot connect
again to the database, it gives me a "Connection Timeout
Expired"
Is there any other sql command should i run, in order to
stopped completely any processes th... more >>
Getting most recent record of a company
Posted by Micromanaged at 8/2/2004 3:12:32 PM
Running the SQL statement below returns multiple rows for each company.
I need it to return the most recent row based on the column
"DatePulled".
Select total=Sum(PipelineData.Amount), DatePulled,
[Schedule].[StatusCode], [Schedule].[PurchaseType] AS [EQUIPMENT TYPE],
Customers.[Company N... more >>
Comprable technique to Yukon's "WITH", in 2000?
Posted by Ian Boyd at 8/2/2004 3:09:36 PM
i really really really could use ideas for how to perform a recursive
self-join, or emulate one, or it's effects; without having to resort to
thousands of cursor operations.
Is there any way?
... more >>
Could not create object name "microsoft.sqlserver.notificationserv
Posted by michaelri at 8/2/2004 2:59:12 PM
I am trying to use VBScript to automate some SQL NS operations. I receive the following error on my machine on which I have installed and re-installed SQL NS multiple times.
Could not create object named "Microsoft.SqlServer.NotificationServices.NSInstance"
Seems like the assembly is not regis... more >>
Selects base on second column in multi-colum PK
Posted by Scott Townsend at 8/2/2004 2:54:37 PM
I'm working with a customer's Application that seems to be having some
issues with Locks on a table.
The table that has a PK of Column_1, Column_2, non clustered.
The Select Statement is based on column_2
When the query is done the Server process for the query fills up the
locks/objects w... more >>
DTS Schedule
Posted by Vincent at 8/2/2004 2:33:05 PM
I've create a DTS package.
It will import a text file to sql server.
The file is located in a computer on the network.
When I execute the pakage, it works.
However, when I scheduled the package, the following error reported.
Can anyone help me?
DTSRun: Loading...
DTSRun: Executing...
... more >>
Get last working day (weekday) of the month
Posted by Raterus at 8/2/2004 2:21:15 PM
Hi,
Anyone have some ideas about this one, I'd like to calculate the last =
working day/weekday in the month for a given date. I'm trying to work =
it into a user-defined function
Select @lastday =3D getLastDay(@inputDate)
Thank for any help!
--Michael... more >>
Calculate Month-End?
Posted by Raterus at 8/2/2004 12:31:31 PM
Hello,
Perhaps someone could offer me a better way to accomplish this, I need =
to calculate a month-end date. For my purposes though, this date =
doesn't necessarily reflect the last day of the month, but rather the =
last weekday of the month that doesn't fall on a holiday. (I'm not =
try... more >>
Join hints
Posted by Ami Levin at 8/2/2004 12:23:02 PM
Hi all,
Is it possible to provide a join hint when using the 'old' comma syntax for
the join?
Thanks,
Ami
... more >>
datediff(y, startdate, enddate) WRONG
Posted by Sandy Ryan at 8/2/2004 12:11:02 PM
ok - i must be doing something wrong - or microsoft would have fixed this bug...
to calculate age.
first check
If datediff(y, dateofbirth, getdate()) < 1
set age = datediff(yyyy, dateofbirth, getdate()) - 1
Else
Set Age = datediff(yyyy, dateofbirth, getdate())
the problem is that the ... more >>
Returning output parameters from stored procedures
Posted by Dave Naylor at 8/2/2004 12:09:54 PM
Hi, I am trying to return a varchar to my calling application (VB.NET).
Basically i am looping through a set of databases whos names are derived
from a comma seperated list passed into the procedure. I am checking if the
username i send to the procedure exits. If it does i want to add a '1' to
t... more >>
Converting a nvarchar to a date
Posted by William Gower at 8/2/2004 11:53:05 AM
I have a nvarchar field of 8 digits that represents a date. ex. 20040701.
How do I convert that to a date? ex. 07/01/2004
... more >>
Finding records that do not have a particular value in another table
Posted by youngeagle at 8/2/2004 11:46:40 AM
How can I query TableA.RecordID and find all RecordID's that may exist in
TableB but doesn't have a particular value? Would I need a stored procedure
and cursor through, or can it be done in a query or two?
For example:
Table A: Table B
RecordID 1 Name: ab... more >>
Insert into Table vs View
Posted by Arsen V. at 8/2/2004 11:21:58 AM
Hello,
Is there much performance difference between an INSERT that addresses the
table directly, and an INSERT that addresses a view which is mapped to the
same table.
For example:
Table1
View1 = SELECT * FROM Table1
What is faster or are they the same?
1) INSERT INTO Table1
or
2... more >>
Small Date time from char
Posted by mamun_ah NO[at]SPAM hotmail.com at 8/2/2004 11:15:33 AM
Hi All,
First of all, I am facing problem for not following the expert's
advice to store datetime as YYYYMMDD format.
I plan of modifying my client programs later as I will have to fix
many programs.
I get data from a different database (in the same server. That
database works as tra... more >>
Checking number of records
Posted by youngeagle at 8/2/2004 10:31:31 AM
How can I write a query that would give me a record number of every record
that does not have x amount of entries. For instance, I have a table that
needs to have 4 entries for every record that exists in another table.
Table A: Table B
RecordID 1 Name: abc... more >>
SQL Mail
Posted by Amin Sobati at 8/2/2004 9:53:02 AM
Hi,
I'm using sql mail and sql agent mail with outlook xp. When sql server needs
to send email(via xp_sendmail or a job), the email is delivered to outlook
and it is not send until I manually press send/receive button in outlook.
How can I automate this? I mean I don't want to manually send emai... more >>
Return result sets from stored procedure
Posted by LR at 8/2/2004 9:47:27 AM
I can return variables from stored procedures but can I return a result set?
ie I would like to return all the rows from select * from table
Thank you
... more >>
Error 1203
Posted by Emad Sarraj at 8/2/2004 9:03:02 AM
I've been getting this error from running a stored procedure that has an "Update" statement. Everything I've read about this error so far advises to install SP1 to resolve it, but I'm at SP3.
DESCRIPTION: Error: 1203, Severity: 20, State: 1
Process ID 55 attempting to unlock unowned resource PA... more >>
Disabling Triggers via code
Posted by Caroline at 8/2/2004 8:10:48 AM
Is there anyway that I can prevent a trigger from being
called from within a stored procedure for just the values
being entered in the stored procedure.
I know that you can alter table and disable the trigger
but in this instance I nned the trigger to be active for
records inserted/altere... more >>
User Session Start and End times from W3CSVC extended log
Posted by Arul at 8/2/2004 8:10:14 AM
Hi,
I am trying to find the user sessions from the IIS Log
file. I am using the W3CSVC Extended Log Format. I load
the log file on to a SQL Table and filter data for the
User Session.
I am using the following query
Select Distinct UserView.[User_Name], (
Select Max(UVMax.Access_Date... more >>
HTML Embedded
Posted by Joe Horton at 8/2/2004 7:50:30 AM
We are using a product called CinCom to print official documents for =
mailing. The product retrieves DB info from SQL Server and CinCom =
formats the document from an Intranet application and it creates a Word =
..DOC file that then can be printed. =20
We are having problems with sometimes t... more >>
Help with designing a trigger
Posted by R Weston at 8/2/2004 7:23:02 AM
I'm tryig to select just the order number, customer name and one date field from an Order Header table where an update just occured on the Hold Field.
When an order's hold status changes, wanted just those 3 column data copied into another table for that particular order, but i'm really just begi... more >>
query help
Posted by Ivan Debono at 8/2/2004 7:15:11 AM
Hi all,
This should be easy for most of you !!
I have to tables A and B. A is the master and B is the details. A contains a
date column. B contains a date column and a bit column which denotes wheter
a record has been completed or not.
Now I would like to use a query to update the date in... more >>
Stored Procedures
Posted by Danielle Roach at 8/2/2004 6:51:24 AM
Hi,
My SQL Server is Win2K SP4, SQL 2000 standard SP3.
When I run the code that is a stored procedure in Query
Analyzer it takes 22 secs but If I executed the stored
procedure it takes 24 mins?
Does anyone know why this would be?
Thanks in advance
Danielle... more >>
Number of table limitation
Posted by Stanley at 8/2/2004 5:39:01 AM
Hi,
I want to know if there is a maximum number of tables that can be created in one database.
Thnx.
Stan... more >>
Accessing items in a collection using sp_OAGetProperty
Posted by Grahame Horner at 8/2/2004 4:15:02 AM
Can any one advise or help me on accessing items contained in a collection object using T-SQL... more >>
IP address of CDONTS?
Posted by veerleverbr NO[at]SPAM hotmail.com at 8/2/2004 1:07:16 AM
Hi,
For sending email from within a stored procedure, I now use the stored
procedure sp sendSMTPmail (Source code:
http://www.databasejournal.com/img/sp sendSMTPmail.sql)
I would like to switch to using xp_smtp_sendmail (Download:
http://sqldev.net/xp/xpsmtp.htm) because it seems to be a lo... more >>
Does SQL Server support XML Functions
Posted by addverma NO[at]SPAM netscape.net at 8/2/2004 12:53:09 AM
Do any versions of SQL Server support the following functions, as
they appear in the Oracle Database:-
1) XMLElement
2) XMLAttributes
3) XMLForest
Thanks in Advance for your reply
s... more >>
Where is de Diagraming tool? - SQL 2005 - Beta 2
Posted by Ruben Zevallos Jr. at 8/2/2004 12:15:32 AM
Hi All,
I just installed the SQL 2005 Beta 2 and I couldn't find the Diagrams that
is have in SQL 2000.
Can some one tell me where it is? Or... if it exist at SQL 2005?
--
Abraços,
Ruben Zevallos Jr. [ruben@zevallos.com]
+55 98 8117-2509
-------------------------------------------
... more >>
|