all groups > sql server programming > september 2004 > threads for tuesday september 21
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
save/retrieve word document contents in image data type column
Posted by juststarter at 9/21/2004 11:05:01 PM
hi,
i have a word document. .
In the db , there is a table with a image column and i am trying to save the
contents of the clipboard into that column.
I have tried something like :
EXEC sp_dboption 'databaseName', 'select into/bulkcopy', 'true'
GO
DECLARE @ptrval binary(16)
SELECT @ptrval... more >>
Desperately comparing time and date separately.
Posted by kinderjoy04 at 9/21/2004 10:41:01 PM
Your help is greatly appreciated.
I have a table in SQL 2000 db with a datetime column and another columnA of
datatype real. If the value of columnA is -99, I need to:
(1) change the value of columnA to 100 when the time portion is between
6:15AM and 9:00PM
(2) change the value of column... more >>
union operator with sp's
Posted by Ishan Bhalla at 9/21/2004 10:39:01 PM
Union operator
I want to use a union operator across sp’s!!!
Take the following example:
I can say
select * from authors
where au_lname ='White'
Union
Select * from authors
where au_lname= 'Green'
Lets say I call the 1st SQL Statement sp1, and the 2nd one sp2.
So logi... more >>
null and not null
Posted by Ishan Bhalla at 9/21/2004 10:27:02 PM
Basically I want to check for the existence of ‘null values’ and ‘not null’
values.
Ie: Sometimes I want the following SQL Statement to fire:
select * from discounts
Where stor_id is not null
And sometimes I want this one to fire.
select * from discounts
Where stor_id is nul... more >>
books about concurrent ?
Posted by Dean L. Howen at 9/21/2004 9:45:41 PM
Dear friends
Could you tell me some papers/books giving solution about concurrent
problems?
... more >>
Stored Procedure Performance
Posted by Lachlan at 9/21/2004 9:29:04 PM
I recently tried to improve the performance of a simple stored procedure that
was taking approx 8 seconds to run.
The layout was roughly this:
CREATE mySP
@someParam as bit
AS
SELECT * FROM table1 Where ....
if @someParam = 1
BEGIN
SELECT * from table2 where...
END
I was t... more >>
2 Master and 2 Transaction Table
Posted by Malik at 9/21/2004 9:19:02 PM
Dear hi
I need a simple script to create Two Master Tables and Two Transaction
Tables with relations.
can any write script here for me.
Thanx.
... more >>
Rounding
Posted by MPF at 9/21/2004 8:39:54 PM
Thanks in advance for any help.
Via flat file, we receive a value of 1.375%. The corresponding printed
document shows an applied rate of 1.37%, dropping any rounding that
would/should occur.
All of the functions that I have tested, with regards to rounding, round the
value up to 1.38.
... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Explain TSQL running
Posted by Just D. at 9/21/2004 6:48:58 PM
All,
I found this script in one FIDONET conference and decided to test my servers
available around. The result is more than strange.
-- TSQL
DECLARE @i INT,@j INT
SET @j=0
SET @i=0
WHILE @i <= 3000000
BEGIN
IF @i > 100
SET @j = @j+100
IF @i < 300
SET @j = @j-... more >>
Poor VB Programming
Posted by DavidM at 9/21/2004 5:57:23 PM
Hello all -- I just inherited a crappy program from our home office to
implement locally. Of course, it requires modification for our environment.
Please read my concerns and view a portion of the sloppy programming and
respond. This is my worse nightmare... and as Jack Bauer would say, "the... more >>
Divide by zero error
Posted by Big Slim at 9/21/2004 5:52:23 PM
I'm trying to create a derived column from two other columns like so:
select ColA, ColB, (ColA / ColB) as ColC from myTable
The problem is, sometimes one or both "real" columns contain a zero, so
I get a "divide by zero" error.
How would I create a statement that avoids the error and retur... more >>
Bulk Copy Program
Posted by Ross Pellegrino at 9/21/2004 5:24:49 PM
Hi
I have a flat file that contains records many records. The first field
states the following for each record:
'I' = insert
'U' = update
'D' = delete
Is it possible for the BCP to achieve this objective? I know there be some
coding involved. I also noticed that there's an ODBC API t... more >>
UPDATE ISSUE
Posted by MS User at 9/21/2004 5:22:05 PM
SQL 2K
I got a update statement (given below).
MyTable - 3 million rows
[commondata].[dbo].racurrencyconversionrates - 84 rows
Update is performing on a server with multiple databases, 'commondata' is a
different db.
The update is like this
update MyTable
set currency_rate_cad = rat... more >>
Autopopulating a field based upon a substring
Posted by Demian Valle at 9/21/2004 4:14:26 PM
I have imported a text file into SQL that looks something
like the following:
data zone event
---- ----- -----
Account: 1234 NULL NULL
NULL 11 14
NULL 90 87
NULL ... more >>
Problem with the where clause
Posted by Ishan Bhalla at 9/21/2004 4:11:02 PM
I am facing a problem with how to construct part of the ‘where’ clause.
Basically I want to check for the existence of ‘null values’ and ‘not null’
values.
Ie: Sometimes I want the following SQL Statement to fire:
select * from discounts
Where stor_id is not null
And somet... more >>
Length of a Text Data Type Column
Posted by viet NO[at]SPAM rocketmail.com at 9/21/2004 4:01:19 PM
How can I can determine the length of a column with Text data type ?
The SQL statement:
SELECT LEN(CAST(TextCol AS VarChar(8000))) MyLen FROM tblA
return up to the number 8000.
... more >>
Using xml to create where clause
Posted by Aaron Prohaska at 9/21/2004 3:28:00 PM
Is it possible to create a 'where' clause using xml? The reason that I
would like to do this is so that I can use an xml file to create the
businesss rules for how data is accessed in the database.
regards,
Aaron... more >>
A lovely Query...
Posted by Justin Drennan at 9/21/2004 3:27:05 PM
Morning/Afternoon guys...
I have a table which stores purchases a client makes.
Table contains ClientID, PurchaseDate, Amount
If i want the minimum purchase date, and amount per client - what is the
best way to do this?
Select
Clientid, Min(Purchasedate)
from Table X
group by cli... more >>
Numeric in VARCHAR field
Posted by Rafael Chemtob at 9/21/2004 3:25:17 PM
How do I query any records that are not numeric in a field of type VARCHAR.
... more >>
@@ identity
Posted by Savas Ates at 9/21/2004 2:48:34 PM
Dim MyConn, RS, connStr
Set MyConn=Server.CreateObject("ADODB.Connection")
connStr=MM_connstr_STRING
MyConn.Open connStr
set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open "news", MyConn, 2, 3, adCmdTableDirectstrSQL
objRS.AddNew()
objRS("txt") = "hlkhlkjh"
objRS.Update()
... more >>
Query taking unusually long time?
Posted by John at 9/21/2004 2:17:36 PM
Hey all,
my query below is taking unusally long time to complete. I'm wondering
if I have the syntax correct, i.e., it might be going beyond what I want it
to
do. If anybody could take a look and let me know, I'd greatly appreciate it!
UPDATE A
SET A.CRMI_HH_ES = B.CRMI_HH_ES,
A.ZIP_CODE = ... more >>
Check if string found in statement inside Stored Procedure
Posted by Raed Sawalha at 9/21/2004 2:13:04 PM
Dear :
I have stored procedure which has input parameter as varchar(200) , i need
to check if a such word found in the statement , for example i have
"You can place your text here" which is stored in the parameter @Statement
I need to check inside the stored procedure if "place" is exist in the
... more >>
Connect to another server..
Posted by Dominic Feron at 9/21/2004 2:11:48 PM
Hey guys,
Is it possible to connect to another server using de PL/SQL language in the
Query Analyser?
My script is running on the server "SQL1" but I need to access some table on
the "SQL2" server. How can we do that?
Thx for your help.
... more >>
Difference between records
Posted by David C at 9/21/2004 2:02:18 PM
I have a table that tracks dollar amounts for each supplement level during a
repair of autos. As each level changes, I need to create records that
reflect the difference between the current record and the previous record.
There are multiples for the same account/service.
For example, using Re... more >>
BULK INSERT statement 'datafile' parameter
Posted by Rafael Chemtob at 9/21/2004 1:55:05 PM
Hi,
When i use my bulk insert statement as follows, I get an error using the
variable @vchFileLocation, but if I hardcode the location, it works. Any
ideas?
DECLARE @vchFileLocation VARCHAR(1000)
DECLARE @delimeter VARCHAR(2)
SELECT @delimeter = ','
SELECT @vchFileLocation = 'c:\files\file1.... more >>
xp_sendMail (SQL Server 2000) for Win XP
Posted by Eddy Soeparmin at 9/21/2004 1:34:58 PM
Hi,
I'm thinking to use xp_SendMail to send email to recepients, but I don't
know how to set that up, both in development and at client side. To set up
at client side, I'm hoping to run a script within an apps. Thanks.
SQL Server 2000 - SP3a
Windows XP Pro - SP1
- Eddy
... more >>
TOP statement doesn't accept a variable
Posted by Derek Ruesch at 9/21/2004 1:06:25 PM
The following stored procedure is designed to return the
given row number from a query.
CREATE PROCEDURE returnrownumber @rownumber INT AS
SELECT TOP 1 Name
FROM (SELECT TOP @rownumber Name
FROM tblEmployee
ORDER BY Name) DerivedTbl
ORDER BY Name DESC
However when I run th... more >>
DTS programming
Posted by Kamran at 9/21/2004 12:58:23 PM
Hi,
I am writing program (in VFP 8) to upsize data from VFP to SQL 2K. For some,
I create text files and use BCP but for tables with memo fields VFP does not
output memo to text file.
Since the data is large and process needs to be automated I need to know how
to program using DTS i.e. DTS ... more >>
user-defined function limitations
Posted by Tom Wilson at 9/21/2004 12:06:01 PM
The Books Online has the following description for user-
defined functions:
***
The following statements are allowed in the body of a
multi-statement function. Statements not in this list are
not allowed in the body of a function:
Assignment statements.
Control-of-Flow statements.
DEC... more >>
Optional UniqueIdentifierParameter in Stored Procedure...
Posted by Fred Morin at 9/21/2004 11:58:13 AM
I need help....
I have a the following
ALTER PROCEDURE dbo.sp_Revision_Select
(@rev_ID int=0)
AS
SELECT [rev_ID], [rev_Date], [rev_Desc]
FROM [dbo].[Revision]
WHERE ([rev_ID] = CASE WHEN @rev_ID = 0 then rev_id else @rev_id end )
But I need to change the type of REV_ID from INT t... more >>
multiple dbs or big one db
Posted by Sidney Pecul at 9/21/2004 11:47:10 AM
Looking for your thoughs !!!!!!!!!!!!!!!!!
I am in a process of redesigning our corporate database.
Right now we have multiple databases residing on separate SQL Servers
(different locations). We decided to bring all IT resources into a single
place and run on the same SQL Server.
The... more >>
SQL DBA Newbie
Posted by student at 9/21/2004 11:42:43 AM
Hi,
Please provide links for documents for starting SQL Administration.
Thanks
... more >>
learning stored procedures
Posted by Steven Scaife at 9/21/2004 11:20:30 AM
I want to learn how to program and create stored procedures, I've found a
few websites that have helped me learn them slightly, but I was wondering if
anyone can recommend a good book that goes through the basics and into the
more advanced stuff.
I would consider myself at a basic level of ... more >>
database name naming convention
Posted by SQL Apprentice at 9/21/2004 11:18:22 AM
Hi,
We have this application that created a new database.
The name of the database is 2004application.
Will this type of name cause problems.
I know that you cannot name any objects starting with a numeric character.
Any advices.
Thanks,
... more >>
Removing Trailing Zero
Posted by Mark Vergara at 9/21/2004 11:14:15 AM
Hi!
Please kindly help me on this, Is there any code of
removing the trailing zero's in sql just like for
example I have my data..
89.890000 the output I would to see is 89.89..
thanks any suggestions and answers is highly
appreciated..
Thanks
Mark
... more >>
Newbie Question (n parameters)
Posted by jeremy at 9/21/2004 10:40:44 AM
Hello all-
I've run into a delimma and I'm not sure the best way to
solve it. I'm trying to create a stored procedure that
can accept n parameters. For example, assume we have a
table that has movie theators and their locations. I'm
trying to create a stored procedure that accepts n
... more >>
conditional update
Posted by aamirghanchi NO[at]SPAM yahoo.com at 9/21/2004 10:30:12 AM
Hi,
is there a way I can use the Update command on a table column only if
certain conditions are satisfied. For example, in the following
example I would like to update column B only if column A=1, otherwise
I do notwant to touch column B.
UPDATE tblTemp
SET colA=1 -- [, colB=2 only if col... more >>
Very Frustrating Problem with DateTime
Posted by Tod at 9/21/2004 9:50:09 AM
Pardon my newbieness.
I have an Excel workbook that is using ADO to pull in
data from a SQL database. The workbook has a table with
times down the side and names across the top. Formulas
fill in the data using the time and names. The problem is
that it seems that what the SQL database cal... more >>
DTS Copy SQL objects problem
Posted by Harag at 9/21/2004 9:44:39 AM
Hi all
SQL 2k (dev.ed.) sp3a
Win 2kPro
I've got a problem with a DTS package. I have it running at 9am every
morning to copy DB tables (inc data) /stored procs etc from a server
other side of the world (3rd party host) to my local server. This has
been working well for a couple months now.... more >>
SQL Server Developer Edition Performance
Posted by A.M at 9/21/2004 9:28:32 AM
Hi,
Using same machine, I can feel the performance of SQL server developer
edition is slower than the performance of standard edition or desktop
edition.
Id that true?
Thanks,
Alan
... more >>
Like Clause in SQL server
Posted by SoulEmbraced NO[at]SPAM gmail.com at 9/21/2004 9:23:36 AM
Dear extremely knowledgeable people,
I'm writing a stored proc that will perform a search on a table for
the one string that is passed into it. However, I cannot figure out
how to code it so that the LIKE portion of the select statement places
the quotes outside of the percentage signs. My cru... more >>
Date Range design question
Posted by Marcin Gorzynski at 9/21/2004 9:13:49 AM
Hi
Could you give me any advice in a following problem
I have one table that keeps range of dates DateFrom - DateTO and price
DATEFROM,DATETO, PRICE
In Second table I keep discount range in the same format DateFrom - DateTo
and discount
DATEFROM,DATETO, DISCOUNT
To calculate final price I... more >>
Send mail automatically
Posted by fdde at 9/21/2004 9:06:15 AM
I am new to XSMTP (To send Email from SQL server, I think that's what it's
called!) What I would like to do is to automatically send an Email to the
Club incharge when a member's birthday is approaching. I have a DOB field in
the database and I would like to use XSMTP do send an Email automatical... more >>
Keeping leading zeros
Posted by SusieQ at 9/21/2004 8:49:56 AM
I have a batch of numbers to enter into a database. I need to keep the
leading zeros in the field.
Snum=Clng(request("txtStartNum"))
IE: User entered number - 0008896439
Can you tell me please how to accomplish this please?
TIA
... more >>
Need SQL statement for data adapter that Uses 3 tables
Posted by http://www.visual-basic-data-mining.net/forum at 9/21/2004 7:35:22 AM
I need help writing the sequel statement that will need to sort the
following information correctly.
This database is for employees requesting a lateral transfer. Lateral
meaning the CodeID of the new job is the same as the Employee's current
CodeID.
I am having trouble with getting the sor... more >>
Index on bit filed
Posted by Akash uday at 9/21/2004 6:23:14 AM
Dear experts,
Can We create index on BIT filed in SQL 2000. If yes than
pls give me the query to create index on that.
Thanks... more >>
Recursive Relationship
Posted by jez123456 at 9/21/2004 4:27:03 AM
Hi, I have a problem with a recursive relationship.
Here is the code to create a test table
CREATE TABLE [tblEmployee] (
[strLogonName] [varchar] (30) COLLATE Latin1_General_CI_AS NOT NULL ,
[strLogonManagerName] [varchar] (30) COLLATE Latin1_General_CI_AS NULL ,
PRIMARY KEY CLUSTERED ... more >>
still struggling
Posted by jez123456 at 9/21/2004 3:39:03 AM
Thanks for the reply but I'm now getting
Error 107: The column prefix 'b' does not match with a table name or alias
name used in the query
Is this because b and c are not set?
"Alejandro Mesa" wrote:
> Try,
>
> create trigger utr_tblEntitlement_I on tblEntitlement
> for insert
... more >>
Stack?
Posted by x-rays at 9/21/2004 2:47:31 AM
Hello Experts,
Is there any system stored procedure or function or
something that I can get the info of who called my
trigger or my stored or function etc?
Thanks in advance.... more >>
Temp Tables, Transaction and Loops
Posted by Jan Schoenrock at 9/21/2004 12:13:04 AM
Hi,
I'm running SLQ Server 2000 and I've had the following Problem:
When I'm using a temp table within a stored procedure and call this stored
procedure from another stored proc within a loop and a transaction I always
get a mass of error messages. The content of these messages is always t... more >>
Array in Stored Procedure
Posted by Quazi Mortuza at 9/21/2004 12:05:15 AM
I want to pass array as parameter in Stored Procedure.
Like Parameter will be Name,Subjects (array if possible
dynamic array/ Table)
i.e. Mater and Child table data at a time.
Thanks
Mortuza
... more >>
query
Posted by EM at 9/21/2004 12:03:01 AM
Hallo to all
I try to run a query from two tabels from one DB with an other table from an
other DB . I would like to get in the result from VnetuserConfig.dbo.site
the colum
NAME.
here my query:
SELECT
JobId,DictatorId,DateTransCompleted,Length,TranscriptionistId,DictatorSite
FROM ... more >>
|