all groups > sql server programming > june 2003
Filter by week: 1 2 3 4 5
Copy file to database
Posted by Martin de vroom at 6/30/2003 10:39:27 PM
Hi,
I have a single comma seperated file that I need to copy to a single table
in a database, this process will occur at least once every single day
This is not a problem, In fact I have inplemented a DTS package to do it,
and re run this everyday at a certain time.
My problem is whether th... more >>
Returning results where the match is not always there!!!
Posted by Sh0t2bts at 6/30/2003 10:08:43 PM
Hi All
I have two tables that I need to match customer data on.
The first table holds all of the customers billing info
Title
Name
Address
Account Number
The second holds amongst other things the customer e-mail address, dont ask
why they are seperate it's not my database,
Account n... more >>
Date/Time Format?
Posted by Jason Davis at 6/30/2003 9:31:05 PM
Hi there,
I have a datetime field which needs to be displayed as:
"Monday, May 19, 2003 (10AM)"
How can I achive that?
Thanks
... more >>
avoid writing to log file on insert
Posted by Jed Ozone at 6/30/2003 8:55:53 PM
Is there any way to NOT write to the Log File when doing an INSERT on a
database setup as Simple? I am hoping there's some T-SQL syntax that can
prevent the INSERT from being logged.
I have a table I write to but I don't care if it's saved. All the inserts
on the table cause the Log to grow ... more >>
execute DTS package
Posted by Salim Afþar at 6/30/2003 7:12:41 PM
Hi,
How can I run a DTS Package with T-Sql?
I need to run it with a Stored Procedure.
Thanks,
Salim
... more >>
find file size,last modified date thru SQL
Posted by FR at 6/30/2003 6:50:00 PM
Can i find out the filename,filesize and last modified date using TSQL for
all files under a given directory ?
Thanks
... more >>
generating random numbers
Posted by Jaimee at 6/30/2003 6:48:39 PM
How do I generate a random number between 1 and 10?
I need to capture information of potential clients and
randomly assign them to salespersons.
Thanks.... more >>
Does sql allow us to find out when a table has been changed?
Posted by Jesse Fitterer at 6/30/2003 5:59:05 PM
Without going to the table itself, can we determine if and when a table
has been changed after its creation date? I know the sysobjects will
list the creation date (crdate) but is there a way to see when the table
has been last updated. (Update,insert, delete)
*** Sent via Developersdex http... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
retrieving the DAY from the datetime value i.e. "monday", "tuesday" ....
Posted by aeze616 NO[at]SPAM cse.unsw.edu.au at 6/30/2003 5:19:50 PM
Dear sir,
How do you retrieve the day of the week from the datetime value? I
don't want the number. But I want like, 'Monday', 'Tuesday' and so on.
Is it possible?
zeallous... more >>
Regular Expressions in SELECT statement?
Posted by Alex M at 6/30/2003 4:39:06 PM
Hi,
I need to separate certain data in a large text field into distinct columns,
however I need to use regular expression to extract the data, as it is field
delimited, as below:
"Value=123|Description=hello, world!|Data=123456ABCDE|"
"Description=goodbye, world!|Value=345|MoreData=ABCDE123... more >>
Server Explorer in VS.Net
Posted by Steve Barnett at 6/30/2003 4:17:39 PM
Hi,
I've created a database using Server Explorer in VS.Net 2003 pro and
would like to generate the sql script necessary to reproduce the database if
I need to start over. However, no matter what I do the "Generate Create
Scripts..." option remain greyed out on the menu.
Does anyone know ... more >>
How to unload processes when constraint errors happen
Posted by Ty at 6/30/2003 3:44:58 PM
Hi all,
I am shredding really large XML files into SQL via SP_XML_PrepareDoc. I do
a lot of internal error handling within the SPROC, and I always call
SP_XML_RemoveDocument before I call RAISERROR.
While this is great for ensuring I do not use up precious RAM for
RAISERRORS, how would I g... more >>
Another user has modified the contents of this table or view; the database row you are modifying no longer exists in the database;
Posted by Ioannis Demetriades at 6/30/2003 2:59:14 PM
Hi,
I am testing a trigger that and I am getting this error message saying
"Another user has modified the contents of this table or view; the database
row you are modifying no longer exists in the database"
What I am trying to do through the trigger is not to allow the creation of a
new s... more >>
How to Pass stored procedure parameters inside trigger
Posted by Ricky at 6/30/2003 2:43:36 PM
I have an Update trigger defined on PITRY table. This
trigger in turn inserts old records from PITRY table into
PITRYAudit and inserts the related history pre coded
inside trigger into PITRYAuditHistory such as user name
with value CURRENT_USER, comments (pre typed comments
inside trigger)... more >>
How create simple cursor?
Posted by Ronald S. Cook at 6/30/2003 2:27:57 PM
I need to write a stored proc against a table to return a single string
containing a concatenation of all email addresses, separated with
semi-colons.
ID Email
1 sam@hotmail.com
2 dave@msn.com
3 julie@yahoo.com
Result = sam@hotmail.com;dave@msn.com;julie@yahoo.com
I'm assuming I... more >>
Question on EXEC ()
Posted by exBK at 6/30/2003 2:26:04 PM
Is it possible to capture the output of a EXEC() statement
into a variable ? I construct a dynamic sql which returns
a single value (SELECT count(*) from X) and I execute this
sql using EXEC. So is there anyway I can assign the count
(*) value to a local variable ? Or any other suggestions
... more >>
Specifying "do not update" values in "additive" UPDATE sprocs
Posted by joelpt NO[at]SPAM eml.cc at 6/30/2003 2:12:59 PM
Hello,
I want to write a sproc whose purpose is to perform 'additive' UPDATEs
to a given table. By 'additive', I mean I would like the existing
data in the table for a given record to be preserved, and to only
update those fields for which I pass parameters into the sproc.
So, the method I'... more >>
Ugent need help or piece of Code
Posted by Malik hassan at 6/30/2003 2:10:30 PM
Hi,
I have a link Datbase and SQL Server 2000 HAVE a procedure with input
parameters and output parameters. Trying to use Stored Procedure but odbc
call fail...3146.... We are forced to use DAO.
--
Best regards,
__________________________________
Malik Mehmood Ul Hassan
... more >>
Raw Column Data to Fields
Posted by sunil at 6/30/2003 1:25:12 PM
Here is the situation:
Table1
col1
-------------------------------------------
FirstNameLastNameMiddleNameStateCode
First 9 chars are FirstName
Next 8 chars are LastName
Next 10 chars are MiddleName
StateCode 2 chars
This format is fixed.
What's the best way to split it into another ... more >>
SQL Query Help needed.....
Posted by Post Mortem at 6/30/2003 1:24:16 PM
Hi all,
your help is needed.....
i need to build a query that gives me one column as a sum and the other as
the date
for instance i want to know how many users i had during the last
month.....and i want it by weeks
then i need the sum of all the users per week
something like this.....
Da... more >>
Query Plans
Posted by Amos Soma at 6/30/2003 1:20:19 PM
All,
Could someone suggest a resource that would help me understand what query
plans are telling me? For example, I don't know if a Bookmark Lookup is a
good thing, or the difference between an Index Scan vs. an Index Seek etc.
Ultimately I would like to be able to look at a query plan and ad... more >>
An odd question!!
Posted by Venkatesan M at 6/30/2003 12:50:04 PM
Hi folks,
This is an odd question...
We all know the advantages of using Stored Procedures.....
I want to know the disadvantages of using stored procedures.
Thanks in advance.
... more >>
Status Table for Cursor
Posted by .matt at 6/30/2003 12:33:17 PM
What's the easiest way to log success
or failure on rows manipulated with a cursor.
Example. Each successfully processed row
throught the cursor writes a 1 or 0 to a status
column of the associated data.
Any help would be great! Thanks!... more >>
subquery with more than 1 fields
Posted by Calvin at 6/30/2003 12:30:13 PM
select * from ordermaster where (orderid,customerid) in select
orderid,customerid from orderdetail
the sql can't be run in ms sql and is there any similar approach?
using join will have total # of records returned more than i expected.
... more >>
Valid Trigger??
Posted by Harris M. at 6/30/2003 11:59:42 AM
Hello All,
Is this a valid trigger? Is "Updated" an actual table and
can I use it to update tables in other databases? Thanks
in advance for your kind help.
create trigger trans on contact2
for update as
IF EXISTS ( SELECT * FROM Updated WHERE ugpstatus like '%
closed%')
BEGIN
UPDA... more >>
VB book
Posted by arik at 6/30/2003 11:49:12 AM
hi,
I am new to Visual basic. I want to program
some applications that will help me manage and inquire the
databases (using visual studio 6).
Can anyone please recommend me on a book ?
... more >>
Trusted connection from FoxPro 5.0
Posted by Geoff Callaghan at 6/30/2003 11:34:45 AM
I am trying to create a trusted connection from a FoxPro 5.0 program to a
SQL Server 6.5 via a VPN. I need to run an automated process, and of course,
without the trusted connection it will always ask for a password. However,
on matter what I do, the ODBC driver keeps telling me it is not associa... more >>
Stored procedure help, makes server jump to 100%
Posted by luis NO[at]SPAM dacorporation.com at 6/30/2003 11:34:34 AM
Hello, we have a users table with the following fields:
client_id varchar 20
counter1 int
counter2 int
..
..
..
counter50 int
We need to do some queries that match counters from different users.
For example: user admin1 has a value of 5 in counter1 and zero for the
rest of the counter ... more >>
add column between two existing columns with ALTER statement
Posted by Wyatt at 6/30/2003 11:28:04 AM
Can I control where a column enters a table using an ALTER
TABLE statement? I need to control because of an XML
import/export issue. Right now I am doing it manually via
Enterprise Mgr.
Thx,
Wyatt... more >>
Need more help on how to pass parameters from stored procedure into trigger
Posted by Ricky at 6/30/2003 11:08:56 AM
Thanks oj for responding to my query. But since I am a
novice I was able to decipher the statements but was not
able to determine where should all these statments reside
and how will they work. Just to refresh your memory, my
question was how can I override the parameters defined in
a trig... more >>
Using DatePart and DateDiff together in a query
Posted by Patty at 6/30/2003 10:57:20 AM
Does any one know how I would go about using DatePArt and DateDiff in the
same query for the same field? For example, I need to get the amount of days
bettween two dates, which would be the DateDiff, but I don't want it to
count Sat. or Sun.. Say 06/02/03 - 06/09/03, this date span includes Sat a... more >>
Custom replacement function
Posted by rbscheer NO[at]SPAM my-deja.com at 6/30/2003 10:51:56 AM
Hi.
I am trying to create a custom replace function for my applications. I
have a table with two columns where I store some words and their
synonims. My function needs to read a string and verify that any of
the words is present on the first field. If it is, I need to replace
this word with t... more >>
Varchar (8000)...long XML String??
Posted by aleXsticY at 6/30/2003 10:35:45 AM
Hello,
I have get a XML String that has 30,000 characters in a SQL SP. How
can I do that taking under consideration that I can't use a text variable in
my store proc since I will be instanciating a DomDocument object in my Store
Proc
CREATE PROCEDURE adminfCreateMultiMatch
@sJobXM... more >>
using DatabaseName.dbo.TableName
Posted by guy_tanguay NO[at]SPAM hotmail.com at 6/30/2003 10:24:43 AM
First, sorry for my bad english...I work hard to improve it
I need to access a table in a different database
Ex: I work on a table tableOne in my Database DbaseOne
I need some info in tableTwo from the Database DBaseTwo
Someone told me that my query who look like this:
Select x1,... more >>
Passing contents of a flat file to an internal variable
Posted by Ty at 6/30/2003 10:20:19 AM
I want to do something like this inside a sproc:
DECLARE @internalText VARCHAR(8000)
SET @internalText="c:\myTestXML.XML"
QUESTION:
Assuming the contents of myTestXML.XML is <=8000K, how do I pass the
contents of that file to the variable I declared?
Thanks!
/Ty
... more >>
viewing triggers?
Posted by Adria at 6/30/2003 10:06:12 AM
How can I view all triggers for a table? I am exporting a
production table to a test machine and need to make sure
that all triggers have been copied.
TIA,
Adria... more >>
How to declare TinyInt constant numbers?
Posted by w. jORDAN at 6/30/2003 10:05:09 AM
Hello all,
Here
----------------------------------
Select 1, column_name From a_table
----------------------------------
1 is a constant of type Int by default.
But I want it to be of type TinyInt, another way to
do this without "cast (1 as tinyint)"?
... more >>
Problem query
Posted by Scott.Ashby NO[at]SPAM SMNA.com at 6/30/2003 9:57:15 AM
We recently migrated an application that had run for years on a
WinNT4/SQL 7.0 system to a Win2K/SQL 2000 system, and have a query
that simply will not run. The SQL 2000 system is running Win2K SP 3,
and SQL 2000 SP 2 with the security update of 10/16/02 (SQL Slammer
security patch).
If you ... more >>
Debugging SQL server SPs
Posted by mensand at 6/30/2003 9:40:20 AM
Hi,
I've installed SQL server 2000. Now with this new install i can't debug any
more.
When i try to debug the SPs are executed if there was no debugger
What could i have done wrong ? Or what do i need to do to allow / support
debugging on my SQL 2000 server ?
Greetings Andre Mens
... more >>
Dataset and table names.....
Posted by Jim at 6/30/2003 9:30:03 AM
I have a stored procedure that queries a sql server database and returns the
multiple data tables ( 7 to be precise) these tables are the results of many
joins.
When I use the System.Data.SqlClient namespace objects to access this data
it is returned intoa dataset, this dataset has the tables a... more >>
to get the nth record meeting the query requirement
Posted by Michelle at 6/30/2003 9:16:50 AM
In SQL server, if I want to retrieve the first record which meets the query,
I can use 'select top 1'. However if I want to query the nth record, is
there a easy way to do it?
Thanks.
USE pubs
SELECT TOP 1 pub_id
FROM titles
WHERE type ='business'
ORDER BY pub_id
... more >>
xp_send mail requires @user?
Posted by Ralph at 6/30/2003 8:48:00 AM
I'm using xp_sendmail in a project (which is the first
time it has been used on this SQL Server installation)
and it is returning the following error:
xp_sendmail: Procedure expects parameter @user, which was
not supplied.
Even making a simple call such as the following:
xp_sendmail @... more >>
stored proc and tcp/ip
Posted by Helmut Wöss at 6/30/2003 8:09:16 AM
Hello,
is it possible to communicate with another program using tcp/ip?
I mean, i have another program where i know the port number
and the protokol and what i get back. Now i want to call this
program using ip number and port number, sending a string to
it and getting the answer as string ba... more >>
newB question: related tables question
Posted by Blue man at 6/30/2003 5:47:12 AM
hello
i have a data base with 10 tables, i want to automaticaly creat a row in all
of the tables wehen i create in the first one.
normal table relation didn't work for me , so what are they? what is these
relations functionality? i have creted relation between my tables, but when
i add a row no... more >>
MaxDate
Posted by dennis at 6/30/2003 5:34:57 AM
I have 3 tables:
table1:
DateMod (smalldatetime)
StId
Eid
table2:
DateMod (smalldatetime)
StId
Wid
table3:
stid
I am selecting the max(Wid) and max(eid) based onstid:
select max(Wid),date
from table2 a,table 3
where a.stid=b.stid
group by a.stid
union
select max(eid),date
fro... more >>
How to optimise many updates on 1Mio rows?
Posted by George at 6/30/2003 3:56:28 AM
I need to perform many update queries on the same table
sporting 1 Mio rows.
It is not possible to do all updates in one query, I
definitely need several queries.
On the other hand, in each update query, I'd rather update
only about 20,000 rows at a time to avoid blowing the log
file.
... more >>
Rebuild_index_in_SQL_server_¿?¿?
Posted by SAlva at 6/30/2003 3:33:52 AM
hi all,
in access we have an "utility" to rebuild autonumeric
index when a table is empty(Set the autonumeric to the
first available number,erasing the previous index). How
can I do it in SQL?... more >>
Overriding a default error message in SQL Server
Posted by aeze616 NO[at]SPAM cse.unsw.edu.au at 6/30/2003 12:12:48 AM
Dear sir,
Just to rephrase my question in relation to the previous posting.
Is it possible to override a default error message? For example, I
type convert 'Select (datetime, '56/04/2004', 103)'. When I run this,
it will give me an error saying 'Arithmetic overflow'. Instead of SQL
... more >>
Performance of Data retrieval
Posted by Udayakumar.S at 6/29/2003 10:37:29 PM
How to improve the performance pf 50 Lakhs data in SQL
Server Database from my Application.
What are the all measures to improve the performance of
the data retriveal from SQL Server.
... more >>
How to catch errors
Posted by aeze616 NO[at]SPAM cse.unsw.edu.au at 6/29/2003 6:28:08 PM
Dear sir,
I have a problem with date conversions. I want to catch an error
like this in a stored procedure using something like RAISERROR but I'm
not sure what to do.
For example, I want to convert the date '56th December 2004' i.e.
56/12/2004. It raises an error and gives me an error me... more >>
|