all groups > sql server programming > september 2003 > threads for tuesday september 30
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
Aren't firewalls enough for information security?
Posted by Scot at 9/30/2003 11:49:12 PM
Hi all,
Some sources like www.techieindex.com saying "Firewalls
are necessary tools, but they are not the core of
information security. You need to concentrate on a
holistic security architecture. Security shouldn't be
added to an enterprise; it must be woven into the fabric
of the ap... more >>
DB (tables) deployement
Posted by Oliver Young at 9/30/2003 10:57:33 PM
I need to deploy my DB to the other PC (end user). What do you recomend? To write a script to create (few) tables? Is there some
tool for deployement?
... more >>
INNER JOIN
Posted by Oliver Young at 9/30/2003 10:55:18 PM
I have this situation:
SELECT a.ID, b.Naziv, a.Naziv AS Expr2, a.Namen, c.Ime, a.Kreiran, a.Zaprt
FROM ToDos a INNER JOIN
Podjetja b ON a.PodjetjeID = b.ID
Two tables are connected. How can I connect third one? I need c.Ime field from third ( c ) table.
... more >>
Syntax Help
Posted by Newman at 9/30/2003 10:42:20 PM
Dear All
I have the follwoing command extracted out of access but
does not work in SQL Server. I get an error in the "INNER"
for some reason. Can anyone help
UPDATE Budgets INNER JOIN TMP ON Budgets.Code=TMP.Code SET
Invoices = TMP.sumOfGOODS, InvTax = TMP.sumOfTax
WHERE TMP.ST_DTYPE=2;... more >>
Import Human-Readable text file into SQL Server 2000
Posted by sstorhaug NO[at]SPAM webuniverse.net at 9/30/2003 10:03:01 PM
Hello,
I am receiving a text file that is produced from a mainframe that is
out of my control. I am attempting to find a (hopefully clean) way to
import it into a SQL Server database in an automated fashion. I am
not really concerned about how many tables it requires or what the
schema look... more >>
selecting records randomly from a database
Posted by IrishManInUsa at 9/30/2003 9:59:34 PM
Hi Everyone,
I have a table and there is just over 24,000 records in the database......is
there a way that I can write a sql statement that will pull back a record
randomly.
I was trying to use the rand statement and use the entryid field on the
record, which is an autogenerated number, but... more >>
Protect my self from viruses here
Posted by Roy Goldhammer at 9/30/2003 9:27:49 PM
Hello there
After several formats of my computer as a result of viruses i've installed
firewall
After that my email address got 70 emails from users registered in here on
this newsgroup: mails that looks like microsoft messages. But all of them
had viruseses inside them and it blocked other... more >>
Distributed Queries
Posted by Tom Antola at 9/30/2003 9:21:19 PM
All,
I am trying to write a distributed query using two SQL Servers. The first
server has the second server as a linked server. The stored procedure on
the first server has the SET XACT_ABORT ON and it has BEGIN DISTRIBUTED
TRAN. Inside the distributed transaction I execute a stored procedu... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Connection pooling
Posted by Tom at 9/30/2003 8:53:22 PM
May I ask are there any sample code or online reference /
tutorial for ADO.net / Data Access Block Connection
Pooling? ... more >>
Selection and join differences
Posted by Bobby at 9/30/2003 6:21:41 PM
Is there any difference in the data returned in a multi-table select by
the table used in the 'FROM'?
ex:
Select a.this, a.that, b.other, c.another
From a
versus
From b
Also, if I'm using lots of tables that can be joined a few different
ways, will there be a difference in the d... more >>
SET problem with an Indexed View
Posted by cw3 at 9/30/2003 6:10:22 PM
I have an indexed view & need to insert some data into one of the base
tables of the view. The inserts are performed inside a stored procedure
call and runs fine with SQL Query analyzer. When the stored procedure is
run from an asp page it fails with the following error:
<font face="Arial"... more >>
using function in select statement and passing parameters to it
Posted by andy at 9/30/2003 5:56:40 PM
I have a function that returns a small 2 columned table. I need to pass
parameters to this function via a select statement. I have tried the
following:
SELECT p.param1, p.param2, p.param3, fnCustom.var1, fnCustom.var2
FROM tblParams p CROSS JOIN fnCustom(p.param1,p.param2,p.param3) fnCustom
... more >>
Select on one column or the other...
Posted by Non Sequitur at 9/30/2003 5:55:15 PM
I have a problem that exceeds my T-SQL programming skills... How do I code a
SPROC that returns the result of a select, and if the select would return an
empty rowset, then the SPROC should execute a different select?
Here is what I mean:
CREATE TABLE Ticket(
TicketID decimal(18, 0) IDENTI... more >>
HELP: Exporting for use in MySQL
Posted by Matrix at 9/30/2003 4:24:58 PM
Ok, anyone know anything about MySQL? The only way I see to use data within
tables for use in MySQL is to export as text file but I dont see a way to
import the data from the MySQL Console Manager.
Then my next consideration would be a query to create the tables and insert
it into te MySQL datab... more >>
Design/Modeling books and or advise wanted.
Posted by Charlie at 9/30/2003 4:17:56 PM
I posted this question long ago to several groups but it didn't generate a
lot of interest so I thought I would try again.
I have been looking for books on database design and or modeling but can't
determine which method or approach would best suite my needs.
I guess this comes from the fact... more >>
Exec in Stored Proc
Posted by Jason MacKenzie at 9/30/2003 4:10:52 PM
I apologize if this got double posted and for the terrible formatting
I have a stored procedure that is going to have a lot of parameters added to
it in the near future. I thought the easiest way to do this would be to
declare an nvarchar variable to hold the query and then build the query
in... more >>
timestamp
Posted by Jonas Knaus at 9/30/2003 4:01:50 PM
hi there
in my database i have a column timestamp. now i read this entry with a
reader:
programming language: c#.net
....
....
byte test ;
while (reader.Read())
{
test = Convert.ToByte(reader["AdrTimestamp"]);
}
....
....
i got the answer that this cast is not va... more >>
EXEC Inside Stored Proc Question
Posted by Jason MacKenzie at 9/30/2003 3:57:43 PM
I have a stored procedure that is going to have a lot of paramters added to
it in the near future. I thought the easiest way to do this would be to
declare an nvarchar variable to hold the query and then build the query
inside the stored proc and exec it from there. My question has to do with
t... more >>
resetting value of identity column
Posted by middletree at 9/30/2003 3:54:39 PM
I need to reset the value of a column which is an identity field. This field
is also the PK.
I posted this question a couple of days ago, and was told that this would
work:
SEDBCC CHECKIDENT(TKT_Ticket, RESEED, 1000)
(where TKT_Ticket is the name of the table)
I ran a delete query to e... more >>
create .txt file with a stored procedure
Posted by Sandra at 9/30/2003 3:34:35 PM
How can I generate a .txt file with a stored procedure.
Something like this -
select * from my_table
into c:\temp\just_a_test.txt
Thanks in advance for any help.
Sandra:)... more >>
Check is a storedProc is already running
Posted by Craig at 9/30/2003 3:33:00 PM
I have a stored procedure that takes about 5 minutes to run.
It could cause problems if it's kicked off while it's already running.
Is there a way to check if it's already running?
I guess I could do some dummy Update at the beginning of the sp to create a
lock, so a 2nd instance is blocked, b... more >>
Bit field set to zero by update through stored proc
Posted by Tom Couvret at 9/30/2003 3:18:29 PM
I have a stored proc that is pretty simple... code at the end.
The table def is also attached.
Problem is that when I fire the stored proc from an app or via Query
Analyzer, as well as doing my update it sets one of the bit fields to
zero. I can watch it with profiler, looking for stored p... more >>
Query with Order by
Posted by Prashanth at 9/30/2003 3:10:17 PM
Hi,
I have a table
tblNames(nId, sName)
nId sName
1 12
2 6
3 42
4 abc
5 pqr
6 lmn
7 efg
8 xyz
9 uvw
I want the results to be ordered by sName. Also another condition is t... more >>
sql front-end applications?
Posted by JC at 9/30/2003 2:51:43 PM
I am new to SQL programming.
Are there any front-end applications that can make creating and connecting
to an SQL database easier? I know you can use Microsoft Access to connect
to SQL but wasn't sure if there were any other options.
Thanks! Any help would be greatly appreciated.
jc
... more >>
Tricky Logic
Posted by Paul at 9/30/2003 2:50:25 PM
Hi All
I have a table of actions for users in a company. I now want to open a
recordset showing how many actions there on each separate day of a
particular month.
e.g.
Day Of Month, No of Actions
1 2
2 4
3 ... more >>
@@rowcount
Posted by jt at 9/30/2003 2:26:17 PM
how can i check to make sure that an update did in fact
update a row - i'm using the following error handling:
update tContract
set status_id = 3
where contract_id = @contract_id
set @err_code = @@error
if @err_code<>0
begin
set @err_desc = 'updating tc... more >>
Primary key
Posted by fabriZio at 9/30/2003 2:19:40 PM
I have a primary key on 2 columns. (c and c2)
for example I have c = 2
I have a sp that does the following
*************
select
*
from
t
where
c = '2'
if @@rowcount > 1
begin
update
t
set
c = '2'
end
else
... more >>
Help! Cannot Select the table from Linked Server in stored procedure
Posted by Rayman at 9/30/2003 2:08:05 PM
Hello All,
I have two SQL server, which I have created a linked server of Server B in
Server A.
When I tried to create the following stored proceudre:
----------------------------------------------------------------------------
-
CREATE procedure spLinkedServer
as
Select *
From ... more >>
Re: how to get the list of table...
Posted by Lloyd Dupont at 9/30/2003 2:03:39 PM
no worries, I found it:
SELECT name FROM sysobjects WHERE (xtype = 'U')
"Lloyd Dupont" <net.galador@ld> wrote in message news:...
> I just installed SQL Server and plan to use it with an application which
> automaticaly explore database.
> I wonder, (I have an SqlConnection object working),... more >>
update Trigger help
Posted by Orestes at 9/30/2003 1:55:47 PM
Hi;
I'am need to make a trigger that when i update any field
in the table tells me which field is beeng updated and the
old and new values to later place them in a log table.
regards;
Orestes... more >>
BCP Switch question
Posted by Rog at 9/30/2003 1:54:36 PM
I am using BCP to import some csv files. The -t switch is
for the field terminator. How do I specify a comma?
THanks... more >>
Calling a stored procedure from a trigger
Posted by David Clausen at 9/30/2003 1:52:27 PM
Hello, I need to audit a slew of tables.
I'd like to create a tiny trigger on each table that will
call a single stored proc to do all of the auditing work.
The question is: Is there any way to "pass" the INSERTED
and DELETED special tables to the stored proc?
Thanks!... more >>
Strange Operator ::
Posted by Craig at 9/30/2003 1:49:15 PM
I've run across some sample code online demonstrating
execution of a user-defined function.
the example statment was:
"select * from ::fn_someFunction()"
I've never seen this "::" operator used anywhere else, and
I can't seem to find a reference to it in the docs. Can
anyone explain wh... more >>
Changing table owners
Posted by borr at 9/30/2003 1:41:11 PM
Is there a way to change ownership of a table from a user
to dbo?... more >>
how to get the list of table...
Posted by Lloyd Dupont at 9/30/2003 1:07:56 PM
I just installed SQL Server and plan to use it with an application which
automaticaly explore database.
I wonder, (I have an SqlConnection object working), whic query should I pass
to get the list of tables ?
... more >>
Check for @ in email address
Posted by Fox at 9/30/2003 12:39:56 PM
This is one statement.
SELECT email,FirstName,MiddleName,LastName
FROM Competitors WHERE Affiliation = 'FBBA' ORDER BY LastName, FirstName;"
I need another statement that will select only those records whose field
"email" do not have
the "@" within them. How can I request if @ is in the ema... more >>
finding count
Posted by Paul B at 9/30/2003 12:20:10 PM
I'm trying to find the following E.g. for REF_SITE=2 show me the number of
USERs. But, if must be the earlier created record for that user. Some sample
data is below and the answer would be 1, user 5204. For the other users, the
'2' REF_SITE was the 2nd (older) record for the USER. If it helps, ... more >>
BULK Insert from VB Script ? Part 2
Posted by rog at 9/30/2003 12:09:12 PM
Is there a way to do this from within Query analyzer. So I
don't have to use a script. Basically I have a directory
with csv files based on the date. I was going to create a
VB Script to parse the date so that I could use it to
recreate the name of the csv file For example if the date
was ... more >>
Bulk Insert from VB SCRIPT? Part 1
Posted by Rog at 9/30/2003 12:04:01 PM
Can I use the Bulk Insert command from a VB SCRIPT or ASP
page the same way I would use say the SELECT Statement. I
want to basically use the BULK insert to go through an
entire directory of csv files and BULK INSERT them to a
table. The only way I know how is to use VB Script. ... more >>
SQL Server Access using ADO.Net through Internet
Posted by Cybertof at 9/30/2003 11:52:54 AM
Hello,
Is there a way to access a SQLServer from the internet and not just the
LAN ? (server_adress, port)
I would like to access my Sql Server located in my office behind an ADSL
Gateway/firewall from a .NET application running on my own PC at home
through a modem.
I would like somet... more >>
SQL Trigger
Posted by Sanny Shaikh at 9/30/2003 11:30:23 AM
Hi,
I am creating an order (inserting row into Order table)
through a Power Builder application. I have setup a
trigger on this table that updates a field in the Order
table every time an order is inserted.
After I create the order and hit done. I don't see that
specific field update... more >>
linked server
Posted by rob at 9/30/2003 11:24:26 AM
Hello all,
The '\' in the below linked server query causes a syntax
error.
Anything I can do to get this working?
SELECT *
FROM SQL2\MSSA.DB3.dbo.tblA
... more >>
Scheduled Restore in SQL 6.5?
Posted by Josh at 9/30/2003 10:39:59 AM
Our company's database is maintained offsite, and every
night a backup is posted to an FTP server. I download the
backup file and restore it to our local server each
morning. I'd like to be able to set up the restore as a
scheduled task. I've tried doing it with a LOAD DATABASE
command,... more >>
string manipulation
Posted by sandy at 9/30/2003 10:30:48 AM
what is the easiest way to hit first alpha position in a
string
e.g. '123567SRING789ENDSTRING'
should return 8.
Thanks.
... more >>
registration new SQL server
Posted by LamP at 9/30/2003 10:10:10 AM
Hi,
I tried to stransfer data to our new SQL server.
Unfortunately I can not find it in the list of servers
available. When I tried to registered the new SQL Server
to the group, I could find it. Or when I tried to
register from the new SQL server, I cannot find my old
server in the li... more >>
Does someone have a "Data can opener"
Posted by AJACODE at 9/30/2003 9:53:27 AM
Does someone have a "can opener" to unlock this data?
I have a tblConsumer Table with a Consumer ID
I also have a tblDisablility table
with
ConsumerID,
DisablilityType,
Cause
They join on ConsumerID.
DisabilityType data is a 1,2 or 3 to rate the primary,
seconday and third type d... more >>
SQL Server And Access
Posted by ThunderMusic at 9/30/2003 9:50:56 AM
Hi,
I'm using SQL Server 7 and I need to make a view using 2 sources for my
data: One source is my actual SQL Server Database and the other source is an
Access Database. Is it possible to make connections between those two?
Thanks
ThunderMusic
... more >>
Kill Users in an automated Custom Script--Help!!!
Posted by Sparky at 9/30/2003 9:38:26 AM
I am new at this...and just need to fix a problem in a third party program.
There is a user loging in to the SQL server via third party program that is
not clearing when it logs out. This uses up the licenses...to the point
that the other users can't use the program.
So, to find the user I ... more >>
Connection information
Posted by Nice Chap at 9/30/2003 9:23:57 AM
How can I get Connection information like User Id, Workstation Id etc from
within a stored procedure ? Please...
... more >>
syntax error
Posted by Derek Ruesch at 9/30/2003 9:19:27 AM
I have a DTS package that imports data from a third party
ODBC datasource.
The query in this DTS package has double quotation marks
around the "tablename"."columnname". The DTS package runs
fine on a computer running WIN2000. However, when you run
this package on a WINNT 4.0 machine, the ... more >>
Dynamically get function names
Posted by Jeff at 9/30/2003 9:17:22 AM
Hello,
Is there a way to make a call to MSSQL to get a list of all functions and
there parameters? The call for example would return a list of hundreds of
functions in a format like:
LTRIM ( character_expression )
... more >>
I need serious help please.....
Posted by Ricky at 9/30/2003 8:27:14 AM
Hi guys
I posted a query yesterday and was asked to put DDL/insert
statements and I did. Still haven't heard anything from
anybody. I am not posting it again here. If someone can
please look at page 3 of 2518, titled Query Help from
Ricky posted on Sept. 29 at 2:09 PM that would be great.... more >>
Select Into and using UNION statement
Posted by Largo SQL Tools at 9/30/2003 8:24:55 AM
Is it possible to to a Select Into using a Union statement? For example:
Select Into #TempTable
0 as Field1,
0 as Field2,
0 as Field3
Union
Select Into #TempTable
1 as Field1,
1 as Field2,
1 as Field3
Union
Select Into #TempTable
2 as Field1,
2 as Field2,
2 as Field... more >>
Temp Table Question
Posted by Largo SQL Tools at 9/30/2003 8:22:44 AM
When I create a temp table (e.g., #SomeTable), do I have to specifically
drop the table when I'm finished with it or will SQL Server delete it when
my connection is broken?
Thanks.
J.R.
Largo SQL Tools
The Finest Collection of SQL Tools Available
http://www.largosqltools.com
... more >>
Error when Scheduling a DB Backup
Posted by Offeral at 9/30/2003 8:18:16 AM
When attempting to backup to a file on the local machine,
I get an error 'Device error or device offline'.
I have made sure that the location I'm attempting to save
the backup to is shared and that the backup owner has
access to this on the local machine. Any ideas on why
this thing is g... more >>
Should I use Temp Table or Table Variable in this case ?
Posted by tristant at 9/30/2003 8:01:21 AM
Hi SQL Gurus,
I break a Big stored proc into some smaller stored procs where I should pass
a result set between all stored procs for them to work ON. In this case :
Should I use ##TempTable or @TableVariable ?
Create Proc Posting AS
Create Table ##Temp(...)
Select ... From... INTO ##... more >>
array's in Yukon?
Posted by chris at 9/30/2003 7:57:04 AM
The owner of my company is having me research the enhanced
programming abilities of Yukon. Specifically, he is
looking for me to produce eveidence that it will be able
to use arrays. Does anyone have a link that could point me
in the right direction?
Thanks.... more >>
Correct use of Datetime Format...
Posted by lubiel at 9/30/2003 7:42:08 AM
Hello,
Someone knows, how I can convert
this string = 'Wed Sep 24 03:16:49 2003'
into field of table with datetime format
'2003-09-24 03:16:49.000' ???
Any help is greatly appreciated.
... more >>
sp_who 'active' + dbcc inputbuffer
Posted by MV at 9/30/2003 7:39:52 AM
Hey all,
I am looking for the way to add "dbcc inputbuffer" result
into "sp_who 'active'", so that when "sp_who" is executed
I don't have to pick a SPID and go look at what it's doing.
Hope somebody has figured this out already...
Thank you,
MV... more >>
Best practices for SET NOCOUNT
Posted by kaligrrl NO[at]SPAM yahoo.com at 9/30/2003 7:28:34 AM
We recently determined that our "transactions not rolling back"
problem was due to an "undelivered" deadlock error early in the code,
in a stored procedure, that we did not know about and MTS/COM+ just
let us keep processing when we should have stopped. The solution to
the problem is to use "SE... more >>
error 208 on STORED PROC CALL
Posted by Lali at 9/30/2003 6:23:25 AM
PLEASE HELP !!
When tracing with profiler I notice that I get error 208
constantly on my stored procedure call.
The stored proc exists in the user 'ip's default
database 'prod' and the user is also set as the 'db_owner'
for this database. No other grants was done for 'ip'.
Here is the... more >>
Full Text Search of .pdf files
Posted by PJ at 9/30/2003 5:57:33 AM
It appears that .pdf files are ignored by queries of the
Full Text index and catalog. Does anyone have a solution?... more >>
Updating the same record at the sametime
Posted by Allen Williamson at 9/30/2003 5:41:47 AM
I have a store procedure that will update a record. Is
there away to check to make sure no one else is editing
the same record at the same time? Can I trap this by
using an error trapping statement in my stored
procedure? ... more >>
Error 4318
Posted by Rag at 9/30/2003 5:14:47 AM
Hi
When i try to restore filegroup i'm getting following
error and Database goes to Loading Mode in SQL 2000.
MSDN support article 295371 explains about this but
haven't mentioned anywhere how to resolve it.
could anyone help me in this?
Server: Msg 4318, Level 16, State 1, Line 4
... more >>
DateDiff Vs Date1 > Date2
Posted by Vikas at 9/30/2003 5:05:14 AM
Hi Friends
I have one doubt on the performance issue.
Suppose in a SQL Query 1 I have
SELECT * FROM tblX WHERE dtDate1 > dtDate2
and in the other query no. 2 I have is
SELECT * FROM tblX WHERE DATEDIFF(minute,dtDate2,dtDate1)
> 0
Now which one will give me better performance?
Also... more >>
UPDATETEXT or REPLACE
Posted by marcopolo at 9/30/2003 4:52:08 AM
I would like to update a few varchar columns if I find
certain text and update with something else, but I would
like to keep the rest of the text in each row. How can
this be maid.
UPDATETEXT function I do not really understand how to use.
REPLACE, I do not know what text to look in to fi... more >>
SQL query
Posted by Kranthi at 9/30/2003 4:29:37 AM
Hi Everyone!
I'm just trying to retreive a column dynamically. Here
it goes like:
I read a value from a table. Say it's the DAY
(Table.DATE) and then if it's say 4 then I read a column
value in another table with the column name as DAY_4. So,
it's like I have to read a column, DAY... more >>
Distributed Transaction with 2000 and 2003 Advanced Server.
Posted by jenkinssimon NO[at]SPAM hotmail.com at 9/30/2003 3:43:42 AM
I have a question about distributed transactions.
I have three servers all running SQLServer 2000 SP3.
2 of the servers are running Microsoft 2000 Server and one is running
2003 Server.
The following SQL will run on the 2000 server but not the 2003 server.
create table #LoanNumbers ( Lo... more >>
Distributed Transaction with 2000 and 2003 Advances Server.
Posted by jenkinssimon NO[at]SPAM hotmail.com at 9/30/2003 3:41:29 AM
I have a question about distributed transactions.
I have three servers all running SQLServer 2000 SP3.
2 of the servers are running Microsoft 2000 Server and one is running
2003 Server.
The following SQL will run on the 2003 server but not the 2000 server.
create table #LoanNumbers ( Lo... more >>
Simple problem..?
Posted by Mikko Tussunen at 9/30/2003 1:13:50 AM
Is it possible to do a charindex search that returns the first index of a
string in a string, starting the search from the end of the string? Is there
a function for it?
... more >>
|