all groups > sql server programming > september 2003 > threads for wednesday september 24
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
Writing to a flat file...
Posted by Gish Smith at 9/24/2003 11:46:08 PM
How to write to a log file(ASCII) using a stored procedure in SQL server
2000.
Thanks,
... more >>
sql mail
Posted by drishtik at 9/24/2003 11:28:07 PM
hi
i am making an car rental application.
i want to use xp_sendmail to send a mail to my customer informing him that
the car has been booked succesfully and
his booking id .
when i use
exec master..xp_sendmail @recipients='rajnish@hotmail.com',
@subject='test1000',@message='test message10... more >>
SP parameter.....
Posted by Gish Smith at 9/24/2003 11:27:14 PM
In SQL Server 2000. Can I make one of the stored procedure parameter as
optional. so that if I don't specify the parameter it will not throw error.
thanks
Gish smith
... more >>
concatenating with single quote in the SQL query.....
Posted by Gish Smith at 9/24/2003 11:19:30 PM
I have table called "customer" with column as "CustName".
How to run a query to get the data as
'row1',
'row2',
'row3',
I am finding difficulty in concatenating single quote.
Please advice.
gish smith
... more >>
Getting data from different servers....
Posted by Gish Smith at 9/24/2003 11:04:26 PM
how to run a single query which gets data from two tables spread across two
diffeent servers.
ie table1 resides in server1
table2 resides in server2.
how to run a single query which gets the data combined from two tables.
thanks
Gish Smith
... more >>
declare local variable / text datatype / SQL 7
Posted by Darth Sidious at 9/24/2003 10:25:24 PM
What's the alternative in SQL7 if you need to declare a local variable of
datatype TEXT?
... more >>
How to add a user with osql?
Posted by Arjen at 9/24/2003 9:50:15 PM
Hallo,
I want to add this 'NT AUTHORITY\NETWORK SERVICE' server account as user of
my MSDE.
How can I do that with the osql tool?
Thanks!
... more >>
Datbase comparison.....
Posted by Gish Smith at 9/24/2003 9:20:56 PM
For development purpose I have created two copy of the same database. As the
prodcuction day approaches it is very difficult to merge these two
instantly. Is there any way I can find the differenc between these two
database and manage the merge esaily ?
thanks
Gish smith
... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
How to use sp_ExecuteSQL's result set...
Posted by hom at 9/24/2003 8:32:37 PM
I am executing a few dynamic SQL statements using sp_ExecuteSQL. It works
fine when I simply want to execute a SQL statement without having to worry
about the result set (not the result value of 0 or 1). The problem comes
when I want to set some variables using the result set returned by
sp_Exec... more >>
@@error changes to 0 when try to read
Posted by nfalconer at 9/24/2003 8:25:26 PM
I have a stored procedure executing a transaction set of sql statements. I
also throw a few user-defined error types when expected values are invalid,
for the purpose of logging the error code in a seperate table. The problem
is that the moment I try to assign a local variable to the @@error gl... more >>
Update statement does not work when calling from Visual Basic 6 program
Posted by David N at 9/24/2003 4:55:12 PM
Hi All,
This drove me nut! I have a stored procedure contains the following =
update statement
UPDATE DT
SET storage_group_id =3D TMP.keep_id
FROM DATA_STORE DT=20
INNER JOIN #TMP_TABLE TMP
ON(TMP.remove_id =3D DT.storage_group_id)
The above update statement works if I c... more >>
Creating Index with Duplicates OK
Posted by sue_kailasam NO[at]SPAM hotmail.com at 9/24/2003 3:42:01 PM
Hello All
I'm in the process of upgrading an Access 2.0 database to Sql Server
7.0
In Access, I have fields which are indexed and set to "Duplicates OK",
how do I do that in Sql Server. I have that field set as Primary Key
and Indexed, but is there a specific place where I can say that
Dup... more >>
problem in executing dynamic query
Posted by Nandakumar at 9/24/2003 3:12:17 PM
Hi Friends,
The following statements are generating error
Need Advice from U
Declare @SqlString as nVarchar(300)
Declare @tbl table (PageId Int, srt int Identity(1,1))
Select @SqlString = " Insert @tbl Select * from ( Select " + Replace
('101,103,102',',', 'a Union all Select ') + " a ) a ... more >>
Change Collation
Posted by Vincent at 9/24/2003 2:31:13 PM
I'd created a database in SQL_Latin1_General_CP1_CI_AS.
Now I want to store data in another language.
Therefore I created a table and the columns are set to
"Chinese_Taiwan_Stroke_CI_AI" Collation.
However, when I insert data to the table,
the records are "???"
Can anyone help me?
Thanks
... more >>
How to avoid cursor?
Posted by Jeff Mason at 9/24/2003 1:48:43 PM
I apologize for being a bit long-winded here, but I have a problem which I have been
able to solve, but I could only do so using a cursor. I've read that cursors should
be avoided at all costs, and I've read that some believe that almost no problem can
only be solved with a cursor - that there i... more >>
Calling a Job from within a Job
Posted by darrin.wilkinson NO[at]SPAM cma.ca at 9/24/2003 12:40:44 PM
Hi,
I'm using MS SQL Server 7.0 SP3.
In my job (Job 1) there is a step in the middle where I need to run
another job (Job 2). Upon completion of the running of Job 2, I want
Job 1 to continue on to the next step.
eg.
step 1 of Job 1.......Do something
step 2 of Job 1.......Run Job 2
... more >>
Roolback transactions inside a cursor
Posted by Pedro CLIKEAR at 9/24/2003 11:44:02 AM
Hi, all:
i would like to know one thing about working with cursors and transactions.
If I call an external stored procedure inside a cursor and after that
operation finishes occurs an error and I need to rollback all the data
modifications, will the modifications made by the instructions insid... more >>
When to use Strore proc
Posted by guy_tanguay NO[at]SPAM hotmail.com at 9/24/2003 11:39:41 AM
I'd like to know..in a three-tier environment
is it bad to use store proc?
Is it better to construct the query inside a vb procedure and pass the
string to a Recordset or just call a procedure by a command control?
I'd like to have some advice..thank U
It's very important
Thank U... more >>
Theoretical triggers question
Posted by Stephen Ahn at 9/24/2003 11:38:40 AM
Just a theoretical question about SQL Server 2000 :
Say you delete several rows from a table, and that table has a Delete
Trigger
which inserts another row into the same table.
Will behaviour of SQL Server be well-defined and predictable in such
circumstances ?
eg. are there possibilitie... more >>
DMO-Script-Methode drop Constrains check if exists
Posted by Christian Stein at 9/24/2003 11:02:34 AM
I have a question about the Script-Methode by DMO.
I have Script the complete DB with DMO and I have one mistake. When I Drop
the FKeys with:
Dim intFlagsTableConstrainDrop As Integer = _
SQLDMO.SQLDMO_SCRIPT_TYPE.SQLDMOScript_Drops Or _
SQLDMO.SQLDMO_SCRIPT_TYPE.SQLDMOScript_OwnerQ... more >>
DTS Versions - Running latest
Posted by Ginja at 9/24/2003 10:44:19 AM
Hi All,
Apologies for the cross-post!
I have a load of DTS packages that run within each other, outside each other
all over each other etc etc....
I have continual problems with the latest versions of the packages not being
run. I have to keep going into the packages and updating sub pac... more >>
Duplicate a Row with identity field
Posted by David Chase at 9/24/2003 8:55:44 AM
I need to duplicate a row that has an identity field as a primary key and be
able to return the new identity (is an int field) value. I think I need the
INSERT INTO but was not sure of syntax to bypass identity and also return
the new identity. Can anyone help? Thanks.
David
... more >>
WorkAround ? Too many table names in the query
Posted by AJACODE at 9/24/2003 6:36:24 AM
Here's the full message
Server: Msg 106, Level 15, State 1, Line 1329
Too many table names in the query. The maximum allowable
is 256.
Any Ideas on how to work around this limit ??
Thanks
AJA... more >>
Could not allocate space for object 'History' in database 'CA because the 'PRIMARY' filegroup is ful
Posted by Dev M at 9/24/2003 5:30:39 AM
using sql 2k!
sometimes I get this error massage while imoprting data (thru DTS) even
though there is enough HDD space on the data drive and the
'automatically grow file' option is turned on. so, I investigated and
based on my research I made the following changes yesterday:
1. change the s... more >>
My First Cursor Procedure
Posted by Jim Heavey at 9/24/2003 4:57:53 AM
Hello, I trying to learn how to create a stored procedure which uses a Cursor.
I created the procedure and it compiles fine, but when I attempt to run, I get
a message indicated that "expects a parameter @Title". The @Title parameter is
an output parameter, not an input parameter. Maybe I am m... more >>
How to insert values into 2 tables in the same time?
Posted by Tom at 9/24/2003 3:05:06 AM
Hi,
I created 2 tables:
ProductCategory
ID (PK)
CategoryName
Product
ID (PK)
CategoryID (FK)
ProductName
Price
How should I make use of the FK integrity contraint and
write the SQL statement to insert values into
CategoryName, ProductName and Price at the same time?
Thanks ... more >>
Setting Trigger Order
Posted by Ravindiran K.T. at 9/24/2003 2:57:10 AM
I have a SQL server with compatability as 5 and i have
more than 1 trigger for my table, which was created using
with Append.
Now is there any way to set the Order by which the trigger
will get called.Pls suggest me a solution.... more >>
passing a variable to an osql query
Posted by Javier Castillo at 9/24/2003 2:38:39 AM
I have an aplication that runs on MSDE.
I have created a query file that I input into osql that
simply deletes records between a certain date/times. It
does this using a stored procedure provided with the
aplication using the following format:
purgeevents '00/00/00 00:00:00','00/00/00 00... more >>
Searching SQL Server on a network
Posted by JKuhr at 9/24/2003 1:57:06 AM
Hello,
i want to scan how many and waht kind of Versions of MS
SQL Server are in the network. I have following
questions :
1. Is there a way, how i can scan the sql server, witch
have other tcp ports as 1433 ?
2. Is there a way, how i can scan the sql server, witch
have other tcp... more >>
Horizontal Partition
Posted by Julian at 9/24/2003 1:53:15 AM
Hi Group
I think I'm missing something here; someone please
enlighten me.
Imagine I have a table with MANY rows:
CREATE TABLE Customer
(
CustID integer NOT NULL PRIMARY KEY,
LastName varchar(50)
)
I would like to partition this horizontally. So,
DROP TABLE Cu... more >>
Binary update
Posted by joker197cinque NO[at]SPAM yahoo.it at 9/24/2003 1:36:12 AM
First of all, sorry if message was sent 2 times, but I don't see it in group :)
I have binary column and this is one possible value:
0x800000000000000000000000000000 --> it says me that bit 1 is ON.
I would update this column to flag bit 3 too to have this value:
0xA000000000000000000000... more >>
Check for empty recordset in stored procedure
Posted by mmaxsom NO[at]SPAM citlink.net at 9/24/2003 1:16:37 AM
How would I check/validate for an empty recordset in a stored
procedure?
test_table:
tid cus_fname cus_lname rid sup_id item month_item_sold active
------------------------------------------------------------------------
1 john doe 1 100 $3 1/1/2003 ... more >>
SQL Server "short-curcuit" evaluation of search params
Posted by mortennp NO[at]SPAM hotmail.com at 9/24/2003 1:05:47 AM
Hi
We have a SQL Server 2000 database with a run-of-the-mill customers
table containing nvarchar columns for customer name and customer
address.
There's a clustered index on name and a non-clustered index on
address.
Users can search the customers from a web form using both name and
add... more >>
Question on Celko's nested set model
Posted by Gary Hampson at 9/24/2003 12:35:31 AM
I am trying to get a handle on Joe's nested set model example for
hierarchies (see below) and have a really stupid question. When he adds the
lft and rgt columns in the personnel table, how does he determine and insert
the values for those columns? I mean, is this possible programatically or
d... more >>
|