all groups > sql server programming > august 2004 > threads for tuesday august 3
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
Call a Macro Excell from DTS
Posted by Cesar Altamirano at 8/3/2004 11:49:57 PM
Hi,
I have a DTS that generates a Excel file, all it is OK, but now we
want to format the Excel file, let's say to create combo box, format
cloumns headers and so on, we had recorded the macro excel,
but how Do I call the macro form the the DTS?
Please send me some example.
Regards,
Cesar A... more >>
Deleting duplicates
Posted by Enric at 8/3/2004 11:15:03 PM
Dear all,
I need to delete duplicates in one table:
Desc Product
item 1 200 mg 33456
item 1 2 33456
item 1 200 mg box 2 33456
item 1 200 mg box 2 ind 1 33456
The way for to do that is the follo... more >>
Query problems
Posted by Moe Sizlak at 8/3/2004 10:16:28 PM
Hi There,
I am trying to make this query work, I can get it work but when I add the
clause & "AND status <> 'Inactive' " _ the query does not work. Have a I
missed a comma or something?
Moe
strSQLQuery = "SELECT model, listprice, manufacturer,location,listeddate,
username, status " _
... more >>
cross subnet transfer of data
Posted by Andy Gilman at 8/3/2004 10:10:04 PM
security concerns aside can someone help me with the following
Trying to get a stored proc. to move data from one server to another. There
is no defined suitable primary key so a column has been added to specify
whether or not the data has already been moved over. The following was used
by my ... more >>
Accumulative totals
Posted by j at 8/3/2004 9:29:59 PM
Hello,
Does anyone know of an efficient way to run accumulative
totals for records per month? When the previous days
amount is 0 or null then current date = last accumulated
amount. I am currently CASEing 31 days in a trigger. I
would be most grateful for any input! :D
Thanks!!
... more >>
HttpUtility.URLEncode from TSQL?
Posted by Dick Bridges at 8/3/2004 9:15:55 PM
Without waiting for the next, greatest, SQL Server - is there any way to
invoke [any] URLEncode from within a stored procedure?
--
"Anyone who considers arithmetical methods of producing random digits is, of
course, in a state of sin." John von Neumann (1951)
... more >>
Unable to update records
Posted by Henry at 8/3/2004 7:57:38 PM
I would like to compare the values of one record with another record for the
previous year, for example to calculate growth. I can extract and calculate
these values using the SQL below however I am unable to update the records
as I am told the recordset is not updatable in MS Access.
Create t... more >>
create 'list' of string matches for "LIKE" criteria
Posted by ben h at 8/3/2004 6:56:42 PM
Currently i do this:
SET @varchar_code = 'ADCFA'
SET @cntr = LEN(@varchar_code)
WHILE @cntr > 0
BEGIN
INSERT INTO #tmpCodes (code)
SELECT SUBSTRING(@varchar_code, 1, @cntr)
SET @cntr = @cntr - 1
END
to create a list like:
ADCFA
ADCF
ADC
AD
A
there must be ... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
size of errorlog
Posted by ed at 8/3/2004 6:48:49 PM
i am wrtiting a procedure to check the server errorlog for
messages by loading the log into a #table with
xp_readerrorlog.
to check that the load doesn't fill the database/disk i
want to check the size of the log before loading?
does anybody know how to do this? ... more >>
Stored Procedure takes a stupidly long time
Posted by Steven Scaife at 8/3/2004 6:28:45 PM
Hi, I have just started a new job and my first task is to test the viability
of placing the database, currently 80 gig, and holding 3.5 million customers
onto the intranet. The current system that they use to update search etc
the details, is via a C++ front end and a typical search for example ... more >>
Select Statement Help on count
Posted by Lontae Jones at 8/3/2004 5:31:01 PM
Hello,
I have columns ToyDate, ToyTime, PreviousManufacturer, Toystatus. I need a count of all the PreviousManufacturer and a list of each where Toystatus equals 'yes' and also I need the Toydate and Toytime as well in the result set. Also a way to do the dame thing using the Distinct counts of... more >>
finding the cause of blocking
Posted by Josh Golden at 8/3/2004 5:05:25 PM
Hello gurus,
We have a software package (ERP software) and a SQL Server backend. On
occasion, some users will be blocked from doing things in their program and
when i run SP_LOCK2 i see another user and the ERP program they are in
listed usually many times. So that says to me that this program... more >>
Learning MS SQL Server 2000
Posted by Matt Stanley at 8/3/2004 5:04:00 PM
Hello all,
I have taken over the management of a web site developed using ASP 3.0 and
SQL Server 2000... I have been tasked with gaining a firm handle on our
database to understand its structure so that I can demonstrate in-depth
knowledge of how it's put together. The end result my boss is ex... more >>
retieve data in upper case
Posted by rajani at 8/3/2004 4:35:02 PM
Hi friends
I have a table (one column staffid) with data like following
staffid
------
AA
Ben
Bev
BW
Carri
CHRIS
i want staffids that r in uppercase only.
my query should return AA,BW,CHRIS staffids only
--
cheers... more >>
Stored procedure script problem
Posted by Kristoffer Persson at 8/3/2004 4:21:04 PM
Hi!
I'm trying to create a stored procedure called spTest. It should be
different depending on the existance of a column in a table. However, the
following code gives me the error "Incorrect syntax near the keyword
'procedure'.".
What am I doing wrong?
if (col_length(N'MyTable', N'MyColu... more >>
SQL Server 2000 maintainence plan....
Posted by Jim at 8/3/2004 3:10:37 PM
I have a SQL Server 2000 databse that is expect to handle about 2.5 Million
row deletes & 5.0 Million row insertions everyday into the same table.
I am developing a scheduled maintainence plan and have already setup the
database to use 'DBCC INDEXDEFRAG' every 6 hours.
What I am unsure about... more >>
Information schema and comments
Posted by Microsoft at 8/3/2004 1:31:09 PM
Can a comment be added to a table or a column in a table ? If so, where in
the SQL server information schema can I retrieve table and column comments ?
... more >>
Summing columns but with a hitch
Posted by EManning at 8/3/2004 1:24:40 PM
I've got a very simple SQL2K table with columns SSN, ProcedureID, and
TotalDone. (will post DDL if requested). I want to sum TotalDone for each
ProcedureID within an SSN, which is simple enough to do. However, if the
ProcedureID is equal to 5, 6, or 7, then I want to sum those up together to
... more >>
Alternative for TOP
Posted by student at 8/3/2004 1:23:41 PM
Hi,
Is there any alternative for TOP clause apart from Cursors. I mean suppose i
want to list down the top three values from a resultset, how do i do without
TOP Clause.
Thanks
... more >>
Query Excel
Posted by Mark at 8/3/2004 1:06:17 PM
I am trying to query Excel data like this:
SELECT *
FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
'Data Source="c:\SupportRotation.xls";
Extended properties=Excel 8.0')...[ Sheet1$ ]
All I get is the folowing:
erver: Msg 7314, Level 16, State 1, Line 1
OLE DB provider 'Microsoft.Jet... more >>
Summing while updating
Posted by nimai_malle NO[at]SPAM yahoo.com at 8/3/2004 12:54:19 PM
I'd like to combine these two into one statement:
set @CurrentTimestamp = current_timestamp
-- Update a bunch of rows
update MyTable
set Field1 = @CurrentTimestamp
where *something*
-- Get the total for the rows just updated
select @Total = sum(Field2)
fro... more >>
Failing of Stored Procedure
Posted by Sanath at 8/3/2004 12:54:05 PM
i have a outer inner join in the cursor defined.
when I run the SP, i get this error
[Microsoft][ODBC SQL Server Driver][DBNETLIB]
ConnectionRead (WrapperRead()).
Server: Msg 11, Level 16, State 1, Line 0
General network error. Check your network documentation.
Connection Broken
Is ther... more >>
Query Analyzer Question1
Posted by Doug at 8/3/2004 12:45:02 PM
In QueryAnalyzer - when viewing the object browser, one can right-click a
stored procedure name; then from the pop-up menu, select "Edit" to open the
stored procedure for editing. Whenever I do this, the stored procedure, plus
some additional text - both before and after the stored procedure defi... more >>
collation question
Posted by jeffery.kabir NO[at]SPAM gmail.com at 8/3/2004 11:59:15 AM
quick question, what type of collation should i use to have my dbase
sort my database by numbers first then letters. thanks... more >>
where do I find qualified people
Posted by ChrisR at 8/3/2004 11:46:30 AM
My company has been trying for some time now to find both
a Data Miner and a Data Analyst. We are using both Dice
and Monster plus using 4 consultants. We keep winding up
with people that claim to be pros but cant pass a simple
interview. Can someone recommend a sight/ stategy for this
dil... more >>
Code Review
Posted by Mike Labosh at 8/3/2004 11:45:29 AM
Below, the stored procedure must log a record in the "SampleSource" table
indicating that an import batch happened. Then get the @@identity of that
record for use as the foreign key to SampleSourceArchive after bulk
inserting into SampleSourceArchive (which contains all the imported data)
My ... more >>
Performance issue...
Posted by Greg at 8/3/2004 11:25:35 AM
I've run into a major performance issue with a current SQL Statement and
have been unable to resolve it yet. Basically, I have two tables, one
called "urllist" and the other called "urltemp". urllist contains full URLs
with domain and any paths they may have. urltemp contains only the domain.
... more >>
query across databases/servers
Posted by google.com NO[at]SPAM mcrae.ca at 8/3/2004 11:21:22 AM
Hi all:
I'm attempting to write a query against two tables which reside on
different servers. Do I have the syntax basically correct here? I
looked in BOl for it but didn't see anything in the SELECT examples.
SELECT *
FROM SQL04..db_ABC.tbl_ABC a
JOIN SQL04..db_ABC.tbl_DEF b ON a.c... more >>
Q: Replace Function
Posted by Richard J at 8/3/2004 11:19:39 AM
Hi group,
SQL Server 2000 has a REPLACE function; what, if any, is the equivalent function in SQL Server 6.5?
Thanks.
Richard... more >>
LEFT JOIN
Posted by Joe Horton at 8/3/2004 10:52:03 AM
Is there a difference between LEFT JOIN and LEFT OUTER JOIN?... more >>
Can Variables be used in SQL Server Views?
Posted by PA John at 8/3/2004 10:41:40 AM
Does anyone know how to declare use a variable in a SQL
Server View?
In trying to insert a variable name into the 'WHERE'
statement of a query (VIEW), i.e. '@StartDate'
and/or '@EndDate' which is to be used as a parameter
range, I am getting an error stating you must first
DECLARE the v... more >>
Deadlock problem / tablock
Posted by jrg11201 NO[at]SPAM newsgroup.nospam at 8/3/2004 10:37:01 AM
I am getting deadlocks, and I'm baffled. One of the programs that is deadlocking is a background job that runs about once a minute. This is the only one that I have the ability to change. The job runs very quickly, less than 100ms, so I thought that I could stop the deadlocking problem by getting... more >>
Sum If
Posted by Claude Hebert at 8/3/2004 10:24:14 AM
im trying to do a sum of a value if the date is withing a range
my current code is:
sum(
if DB.dbo.table.date >= @date1
and DB.dbo.table.date <= @date2
DB.dbo.table.qty
else
0
) as wtdship
i have tried this several ways.
... more >>
View latency?
Posted by Vern Rabe at 8/3/2004 10:07:55 AM
SQLServer 2000 Standard Edition, SP3a, Win2K SP4.
I am getting behavior from a view where the results are
stale (incorrect) unless there is a small delay before
querying the view. I have included two scripts, the first
creates objects and populates tables. The second
demonstrates the issu... more >>
Performing a set of set operations on a set of sets
Posted by Scott Simons at 8/3/2004 9:03:02 AM
I was wondering if there is an easy way to run some sql commands against a set of databases defined in another database. We have a database that keeps track of the databases we have and there will be times when we want to run a certain command against all of the databses.... more >>
set a trigger on a field
Posted by grummy at 8/3/2004 7:45:27 AM
can i set a trigger for an update of one specific feild
only ?
this is so that i can xp_sendmail if someone changes a
date in a date feild.
cheers... more >>
need help with nested subquery
Posted by JPMac at 8/3/2004 7:15:02 AM
hi,
I have a recordset like so,
DT VEHICLEID NSEW
03/08/2004 08:30:16 169 IGNITION ON
03/08/2004 08:35:33 169 IDLE
03/08/2004 08:40:17 169 IDLE
03/08/2004 08:45:51 169 IDLE
03/08/2004 08:50:23 169 IDLE
03/08/2004 08:55:29 169 IDLE
03/08/2004 09:00:16 169 IGNITION OFF
0... more >>
Help with kind of a tree question to be improved or substituted
Posted by Kim at 8/3/2004 7:02:53 AM
I've got a table that has the columns below (and others)
I'm supplied with a PROJ_ID and IF that proj_id has got a FAS_ID that IS
NULL I have to find the first of PARENT_ID that has a FAS_ID that IS NOT
NULL
ID (int) PROJ_ID(int) FAS_ID(varchar) PARENT_ID(int)
3434 422 NULL 2730
3436 450... more >>
Create Triggers in stored procs which has DML commands:
Posted by sameer at 8/3/2004 6:21:03 AM
SQL SERVER 2000 SERVICE PACK 3A OR THE LATEST
i have this stored proc which does Inserts\ Delete in a lot of table. An Insert trigger on one of these tables causes Inserts to fail. I wanted to intilitally disable this trigger while the stored procs are running but later found out that Sql server do... more >>
Tuning Tips Needed for the Code
Posted by Harcharan Jassal at 8/3/2004 4:22:35 AM
Can Anyone please provide the tuning tips for the following code.
Thanking in anticipation
========================================================
CREATE PROCEDURE dbo.spFixHtml @uiDocumentId uniqueidentifier
/***********************************************************************
******... more >>
Stopping a SQL Query
Posted by Peter Newman at 8/3/2004 3:31:01 AM
Im running a query to look up a clients licence number from partial data. The table i am querying has 150000 + records and there may be several hundred records retruned matching the search criteris.
I know that there will only be 1 licence number for the search criteria, so how can i stop the que... more >>
Nested Sets and custom sorting
Posted by mpluijmaekers NO[at]SPAM yahoo.com at 8/3/2004 3:09:34 AM
Hello everyone,
I'm having a problem with Joe Celko's nested set model for hierarchies
combined with custom sorting. My ultimate goal is to generate a dhtml
navigation menu based on a table in a sql server 2000 database. The
main columns of this table are:
CREATE TABLE [dbo].[Contents] (
... more >>
Newbie question - Deleting records from a view
Posted by Paul in Harrow at 8/3/2004 2:55:03 AM
Hi there,
I've created a view using most of the columns from one table (tblADCStudents), half a dozen Case statments and one column from another table (tblCoursesADC.CourseTitle) using a join:
FROM [dbo].[tblADCStudents] INNER JOIN [dbo].[tblCoursesADC]
ON [dbo].[tblADCStudents].[CourseCode] =... more >>
Passing a value from a trigger to a stored procedure
Posted by David Wakeford at 8/3/2004 1:30:41 AM
I have a trigger which is based on a single column of a
table. When that column value is updated, the trigger
executes a stored procedure which has to copy data from
the updated record to another database within SQL
Server. The problem is that the trigger must pass the
record's primary k... more >>
PARSING A TEXT DATA TYPE
Posted by Anuradha at 8/3/2004 12:39:03 AM
Hey,
i have a string that comes to the SP as a text data type...i need to parse this..
but none of the string funtions support the text data type...any idea as to how i can parse it..
thnks and rgds,
anu
... more >>
Appending text to existing value in table column
Posted by Amit at 8/3/2004 12:08:04 AM
Hi to all sql gurus,
I have got a table "Table2" having a column
as "Instruction" with data type as varchar(512) NULL.
In this column i am storing information/error messages. My
requirement: Every time an error occurs i want to append
that error message to already existing text in this
c... more >>
|