all groups > sql server programming > july 2003 > threads for tuesday july 8
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
How to store Date in SQL Server
Posted by Odelia at 7/8/2003 11:19:32 PM
Hello,
I have problems with Storing Dates into SQL Server. I am
using ASP to do so.
When I change my locale settings to "Chinese - Taiwan". I
hit an error saying the at the Date format is not right.
Then, I create a function which returns: YYYY-MM-DD
HH:MM:SS and it can work.
However... more >>
How to store Date in SQL Server?
Posted by Odelia at 7/8/2003 10:37:31 PM
Hello,
I have a problem with storing date in SQL Server, with
locale setings not "United States" but others(E.g.Chinese -
Taiwan).
I created a function to change the date to this format:
YYYY-MM-DD HH:MM:SS and it works(As before creating this
function, there's a problem storing the dat... more >>
Datawarehouse ?
Posted by Sender at 7/8/2003 9:07:55 PM
What is a Datawarehouse and how does it differ from Database? I know how to
create Database in SQL Server. How do we create DataWarehouse in SQL Server?
Sender
... more >>
Strange problem with delimited identifiers
Posted by Bob Noll at 7/8/2003 5:41:51 PM
Hi,
I am using SQL Server 2000 (8.00.194) Personel Edition
(it came with Office XP Developer) for an Access 2002
Project development. Recently in my MSDN subscription I
rcvd and installed Visio for Arch. and used it to reverse
eng my database. I then used the gen option to gen a DDL
s... more >>
how to pass in list and insert them one by one
Posted by Mike at 7/8/2003 4:42:00 PM
Hi,
I have a parameter that pass in list to store procedure,
for example,
'21, 34, 254,3e3'
how am I able to split it and insert one by one to a table . column 1 and 3
are hardcoded value.
1567, 21 , 0
1567, 34, 0
1567, 254, 0
1567, 3e3, 0
... more >>
SET OPTIONS
Posted by Devron Blatchford at 7/8/2003 4:37:34 PM
Can someone tell me how I can tell what set options a procedure has, I am
looking for any procedure or view that has SET QUOTED_IDENTIFIER OFF OR SET
ANSI_NULLS OFF.
Thanks
Devron
... more >>
Viewing the event log
Posted by Bob Castleman at 7/8/2003 4:26:35 PM
I turned on trace flag 1204 and forced a deadlock on our test server. When I
try to view the output in the event log in the Enterprise Manager, double
clicking on the message brings up in a window with next and previous buttons
and I have click through multiple lines of output.
This is REALLY ... more >>
Replace in ASP/VBS/SQL
Posted by pretorianboy NO[at]SPAM yahoo.com at 7/8/2003 3:53:01 PM
I need to replace all occurancies of "is" in "This is a test (is), is,
penis." with "<a href=is.htm>is</a>".
The thing is, if I use a simple Replace function, the "is" in penis
also gets replaced.
I need to do it either in ASP/VBS or MSSQL, but I'd have it rather
done in ASP.
TIA... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Memory Leak?
Posted by Jon Mundsack at 7/8/2003 3:00:54 PM
I am watching the "Mem Usage" for the sqlserver.exe process in the Windows
NT Task Manager climb at a rate of about 400k per minute. This has been
going on steadily since the server was rebooted yesterday. We're now up to
50% memory used out of a 2gb "limit"
I don't know if it was doing this b... more >>
view a query's SQL in VB
Posted by Jasper Paulsen at 7/8/2003 2:59:16 PM
How can I use Visual Basic to view the SQL built into a
query?
I have two databases in SQL Server.
One is on a SQL 7 production server,
and the other is on a SQL 2000 test server.
Both databases have tables and queries,
stored in SQL Server. The tables and queries
should be the same in... more >>
Why we do double work?
Posted by sender at 7/8/2003 1:54:13 PM
When we develop a package using front end like Visual
Basic etc. then we can write code to validate what kind of
data the user can enter, save, update or delete. For
example, if we want the Name should not be greater than 20
characters, we can write code for this validation. If we
want tha... more >>
single quotes in select statement
Posted by Michelle at 7/8/2003 1:52:39 PM
In this case, the employee name has a single quotes, so the following select
statement actually inquires 'WILLIAMS, O'. How can I bypass this?
Select * from tblEmployee
where name = 'WILLIAMS, O'WONDER'
Thanks.
... more >>
A question on UDF programming
Posted by Vivek Dangwal at 7/8/2003 12:58:29 PM
In a user-defined function, I have 31 variables each of which stores a
"float" type value.
The values stored in all these variables are supposedly random, and have no
defining order.
say, I have
@var1 = 2300.0,
@var2 = 2312.4,
@var3 = 2312.4,
@var4 = 2504.2,
.....
and so on upto
@var31 ... more >>
Date comparisons
Posted by melo at 7/8/2003 12:30:29 PM
Hi. I'm using ADO.NET to retrieve data from SQL Server via stored
procedures. Lately I found the following problem:
There's a stored procedure that has a DateTime input parameter (say
@statusDate). This parameter is passed from ADO.NET code as DateTime.
Inside stored procedure, there's a compa... more >>
Hierarchies/Relational Division
Posted by Kevin Munro at 7/8/2003 12:17:35 PM
Hello, I've a problem with hierarchies and relation division.
I'd be really grateful for any help on this, I've included all
my DDL below with comments to explain the steps.
Hope this makes sense!
Many thanks,
Kevin Munro.
www.c3amulet.com
-- Here's a fictitious example of a hierarc... more >>
Using Inserted and Deleted tables in Conjunction in a Trigger
Posted by Mark Simmerman at 7/8/2003 12:11:36 PM
I want to check a table to see if a column (req_ship_dt) has been updated
with an update trigger using the following:
IF UPDATE (req_ship_dt)
I discovered that our accounting system will delete and insert a row with no
change made to req_ship_dt, but change other columns during a shipping
... more >>
Simple stored proc in query question
Posted by Bob Castleman at 7/8/2003 12:10:31 PM
Is this possible?
Table_1
Col1 Col2 Col3
a e
b f
c g
UPDATE Table_1
SET Col3 = Some_Stored_Proc Col1,Col2
Thanks,
Bob Castleman
SuccessWare Software
... more >>
SQL Query
Posted by kalyan at 7/8/2003 12:00:35 PM
the table called itm_lots contain item_id, and lot_number
for item no. 1 lot no. A,B,C (A shoud not come again)
item 2 lot no A,B,C (should come) but should not repeat.
I NEED QUERY TO AVOICE DUPLICATE IN LOT NO.
THANKS
KALYAN
... more >>
Need Help in Stored Proc Syntax
Posted by Mansoor Aleem at 7/8/2003 11:57:23 AM
I need help in writing a stored procedure on SQL Server
2000. Basically the stored procedure's primary task is to
generate invoice records and insert the records in a
invoice table. In order to generate the invoice records,
I have an initial table which are basically Day Records.
The tas... more >>
Minimum Distance Theory Question...
Posted by trinetgrinch NO[at]SPAM yahoo.com at 7/8/2003 11:50:50 AM
I have a solution in mind, but I wanted to hear what the local
SQL-Server programming gurus have to say about my problem --- I've
seen the problem stated in various flavors, but I am trying to drop
all of this into a stored procedure, and my general knowledge of T-SQL
vs the other programming la... more >>
quick question
Posted by Karen at 7/8/2003 11:39:33 AM
if you want to select top 100 records, you will use
SELECT TOP 100 *
FROM tableName
Is there anyone knows how to find bottom 100 records?
Thanks.
Karen
... more >>
Problem: Copy data from server 1 to server 2
Posted by Andy at 7/8/2003 11:37:10 AM
Hi together !
I have a problem:
I "just" wan't to copy some records from server 1 to
server 2 (same table).
But here are the problems:
1. The servers are not connected (can't use linked servers
or replication).
2. The target table already contains records, so i only
wan't to insert th... more >>
dynamic sql dropping and select into
Posted by cynthia elms at 7/8/2003 11:33:33 AM
I have a stored procedure running on SQL 7.0 that works
most of the time but a few times a week gets the following
error:
'Could not find table named 'table id'. Check
sysobjects.'
The way they have designed the procedure:
@wrk_table -- input parameter for table name
@wrk_quicksav... more >>
Urgent syntax question
Posted by Deborah Bohannon at 7/8/2003 11:30:02 AM
I have a recordset with approx. 189,000 records in it. I need to do an
analysis based on random groupings of the data. For instance, on random 60%
of the records within a certain criteria, I want to apply one part of the
analysis, and for the remaining 40% another part of the analysis.
Is th... more >>
nText
Posted by Rocky at 7/8/2003 11:19:27 AM
SQL Server 2000
I am trying to pull off a record from a table which has 2 ntext fields. =
How do I retireve all the information stored within these fields. =
Example code for query analyzer would be great.
Thanks for any help in advance
Rocky... more >>
DMO BulkCopy and trigger
Posted by shyam NO[at]SPAM webridge.com at 7/8/2003 11:18:56 AM
In the BulkCopy object is there a way to specify a hit to use "FIRE_TRIGGERS"?
Thanks... more >>
difiiculties with ::fn_trace_gettable()
Posted by M at 7/8/2003 10:39:13 AM
Hi
here is a sample trace I defined on SQL server 2000
and want to visit the result from it's .trc file:
/****************************************************/
/* Created by: SQL Profiler */
/* Date: 08/07/2003 10:28:12 AM */
/******************************... more >>
ouput to printer
Posted by Sender at 7/8/2003 10:30:54 AM
How to send the ouput of a SQL Query directly to Printer?... more >>
DTS package failed on sql server agent
Posted by yanping at 7/8/2003 9:12:10 AM
Hi,
Yesterday afternoon I changed the service account to
local system account for sql server agent, after that, one
DTS package job which is used to track user login inf.
failed, the error msg is " login failed for user NT
authority/system", error number is 18456 which said user
has n... more >>
redefine 2nd question on my SP help needed???
Posted by Helixpoint at 7/8/2003 9:09:46 AM
Here is the sql.... if quotePrice is NULL I need to copy ASKING_PRI to
quotePrice. Not sure how to do it with the Join???
SELECT tempQuoteDetail.quotePrice, InventoryRecord.ASKING_PRI
FROM tempQuote INNER JOIN
tempQuoteDetail ON tempQuote.tempQuoteID =
te... more >>
Date problem
Posted by Simon at 7/8/2003 8:59:19 AM
I have date field in my table:
2003-06-29 02:21:19.373
Now I would like to get the records from my table:
SELECT * FROM table WHERE date='06-29-2003'
but it doesn't work.
I get the result only if I write the select like this:
SELECT * FROM table WHERE date>'06-28-2003' AND date<'06... more >>
Passing null for select
Posted by dw at 7/8/2003 8:56:07 AM
We're doing a stored procedure for a search page with a number of optional
parameters. If they're not entered by the user, a Null is passed to SQL
Server for that parameter. It all works fine, except for one parameter: When
the @parmResultDate (which is actually a smallint, not a date) is passed ... more >>
xp_cmdshell driving me nuts! Experts please help!
Posted by drdeadpan NO[at]SPAM yahoo.com at 7/8/2003 8:47:39 AM
Hi,
I've been struggling with this for days now with limited sucess.
Manybe you guys can help out. All this would be effortless in
Oracle/Unix but I've been
asked to work on SQL Server 2000. So I ask you gurus to help me out.
I have a stored proc in which a variable @var has multiple li... more >>
Select quantity from 2 tables
Posted by Simon at 7/8/2003 8:37:16 AM
I have 2 tables:
table1:
country1 quantity1 idProduct1
table2:
country2 quantity2 idProduct2
Now I have to get the quantity:(quantity1-quantity2)
for each productId for each country.
(where idProduct1=idProduct2 AND country1=country2)
If quantity1 doesn't exist then quant... more >>
Easy one..!
Posted by Rich at 7/8/2003 8:32:47 AM
Creating a view. The daily amounts taken in a bar are
listed. When I use the SUM function to display the
amounts week by week the daily amounts are not just
summed, but multiplied massively by something, and i cant
work out why!
Help!
Rich... more >>
I defined PK, how to restore original value for quality field
Posted by Ricky at 7/8/2003 8:16:40 AM
In my TableA I have a KeyPK, Tagkey, datetime, quality and
Rev fields. KeyPK is the primary key. What I want to do is
whenever a user issues an update statement on quality
field and if the existing value of quality field is 97 I
want to restore the vale no matter what user tries to
change ... more >>
Yahoo POP3
Posted by Sender at 7/8/2003 8:09:31 AM
I have a Yahoo POP3 account. I have configured my Outlook Express with this
account. Can I send emails using SQL Mail. (I am not talking about extended
stored procedure). Where should I find my Outlook Express profile and
configure with SQL Mail. (I don't have Exchange client)
... more >>
Second Normalized Form..
Posted by Sender at 7/8/2003 8:03:02 AM
If I am right...a table is in second normalized form if all the non-key
attributes depend upon ALL the attributes contributing to Primary Key and
not just one or more of thsoe attributes.
So does this conclude that if we table has only attribute contributing
towards Primary Key there is no cha... more >>
How to add an image into a database
Posted by Gendrot at 7/8/2003 8:01:20 AM
Hi,
I need to add an image into a database from a stored
procedure called from a C++ program. In my c++ program I
use the ODBC API (CDatabase, CRecordset) and I want to put
the image in the database from this program
How can I do ?
Regards
Fabien Gendrot
... more >>
Why do we do double work?
Posted by Sender at 7/8/2003 7:59:56 AM
When we develop a package using front end like Visual Basic etc. then we can
write code to validate what kind of data the user can enter, save, update or
delete. For example, if we want the Name should not be greater than 20
characters, we can write code for this validation. If we want that EmpID... more >>
SQL Server's 'form server'
Posted by John WANG at 7/8/2003 7:44:30 AM
I am working on an internet-based project. I select SQL
Server as its database DBMS. But as Oracle can provide a
tool called 'develope server, form programming'. which can
help programmers build an data input forms quickly and
cheaply, I can not find such function in SQL. I beg for
help fo... more >>
Getting column name in Select statement
Posted by Jane at 7/8/2003 7:41:23 AM
How can I use the column_name provided from
information_schema.columns in a Select statement that is
used for extracting certain columns from a table? ... more >>
How to restore the original value for a field
Posted by Ricky at 7/8/2003 7:03:46 AM
In my TableA I have a Tagkey, datetime, quality and Rev
fields. Tagkey is not the primary key, in fact no primary
key is defined on this table. What I want to do is
whenever a user issues an update statement on quality
field and if the value of quality field is 97 I want to
restore that va... more >>
SQL Query for deleting duplicate records
Posted by jijo at 7/8/2003 6:19:30 AM
Dear All,
Does anyone know the SQL query for deleting duplicated
record from a table?
Eg:
There are 10 fields, out of that if two fields (say
company and code) are the same , then I wanted to delete
the duplicate record.
Pls help
Thanks in advance
Jijo David
... more >>
There is insufficient system memory to run this query.
Posted by MattD at 7/8/2003 6:18:37 AM
Hi all,
I'm having a recurring problem with my ASP/SQL Server 7
website. The website will be running smoothly, with a
fairly consistent level of (externally visible)
performance, until, after about a week, I'll suddenly
start to get the following error...
Microsoft OLE DB Provider for... more >>
Import text file
Posted by PSH at 7/8/2003 3:35:12 AM
l am using a dts package to import a text file with
delimited colums the problem is that the dts package
fails to convert a number value like 12,00 to a numeric
field like float.
Any good ideas ?
PSH... more >>
|