all groups > sql server programming > june 2004 > threads for friday june 25
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
db library for C & distributed query
Posted by gaialee at 6/25/2004 11:58:01 PM
Hi all..
I am developing a software system using 'db library for C' to manage data in the SQL 2000. I'd like to use Internet standard dotted format for 'linked_server_name' to syncronize data in more than two linked SQL servers as follows :
"1.1.1.1".dbname.user.table
This distributed ... more >>
Replacing a string value across all char, varchar, text, nchar, nvarchar, ntext fields in all user tables
Posted by Bri Gipson at 6/25/2004 10:43:13 PM
I've been slammed before for posting so called "solutions" on newsgroups, but it was all for the best since it taught me a few lessons. This is being posted for a couple of reasons. The first one is that I didn't find any other posts that had a solution
to this problem. The other is that I figure s... more >>
SQL 2000 temporary table problem
Posted by DaWiz at 6/25/2004 9:51:58 PM
We have an in-house developed data warehousing application that uses ASP and
SQL Server 2000. One portion of the code utilizes temporary tables for
intermediate data manipulation and has worked for over 4 years with no
problem (under windows server 2000).
We recently migrated to Windows Serve... more >>
Update() test in trigger returning wrong result?
Posted by R Baker at 6/25/2004 6:05:11 PM
I have a situation in which UPDATE() appears to be reporting TRUE for a
column that is (1) not in the list of inserted fields, and (2) has no
default value. This seems blatantly wrong to me. What could I be missing?
(Incidentally, I'm doing the test IF NOT UPDATE(column), so maybe negation
isn... more >>
Avoid divide zero in the where clause
Posted by culam at 6/25/2004 4:44:01 PM
Hi,
I am trying to run the query below and it boomed when B = 0.
How would I rewrite this query for it to work.
Basically I want to exclude if A or B equal zero.
SELECT A, B, A/B
FROM TABLE1
WHERE A <> 0
AND B <> 0
AND A/B >= .5
Thanks in Advance,
Culam... more >>
diskperf -y
Posted by joe at 6/25/2004 4:33:05 PM
PROBABLY this is not a SQL server question, but it 's kind of related. if
I run diskperf -y on command line in my sql server, I will enable the
Logical and Physical Disk performance counters, will that slow down my SQL
server?
... more >>
Releasing Code To Clients
Posted by a_gera80 NO[at]SPAM hotmail.com at 6/25/2004 4:12:42 PM
Hi,
Currently we send code (stored procedures, triggers etc) to our
clients as text files which they apply through Query Analyser.
Unfortunately this means they can basically view our source code even
if we encrypt the stored procedures.
What's the easiest way to package up the code in such... more >>
DISTINCT-Like Functionality
Posted by GM at 6/25/2004 4:10:27 PM
Hi,
I have a table in my database (Incident) that has around 30 field of varying
data types (nvarchar, ntext, int, etc). The table contains many foreign key
relationships. I am trying to construct a SQL query to return unique rows
from Incident based on certain criteria. My problem is that ... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
stored proc code always returns null?
Posted by Brian Henry at 6/25/2004 3:56:16 PM
I have this code in my stored procedure (this pretty much is the whole
procedure) and when i do the select @TierValue to return a number or try to
print it out it returns null all the time... but when i run the query inside
alone it returns the correct number.. how do i get the returned singleton... more >>
Script to Backup/Restore Transaction Log
Posted by Inte at 6/25/2004 3:44:34 PM
I appreciate your help to do:
1. Script to backup Transaction Log of DB_1 database from SERVER_1 to
SERVER_2 with "Verify backup upon completion" option enabled.
2. Script to restore in SERVER_2 Transaction Log of DB_1 database (same
name in SERVER_1) backuped before with "Force restore ov... more >>
deleting problem query
Posted by Mikey at 6/25/2004 3:38:02 PM
Hi I have created a query below. I have a table with two
columns postcode, and salesno(persons salesnumber). A
person can have many diff postcode assigned to them my
problem is the query works fine deleting postcodes
starting with 2 letter characters such as NW,Sw, TA but if
I need to dele... more >>
Date Functions...
Posted by Matty B at 6/25/2004 3:05:25 PM
Hi Peoples,
I'm not sure this is the correct forum for this
question, however, in a nutshell - Is there a Date
Function in SQL that will calculate, for example,
the "Third Tuesday of every month", or, "Second Friday of
every month"?
Let's assume for a moment that I simply do not want ... more >>
ConnectionTimeout
Posted by Vlad at 6/25/2004 2:13:24 PM
I'm creating connection object to SQL Server db this way
Set objConn = New ADODB.Connection
objConn.CursorLocation = adUseClient
objConn.ConnectionString =
"PROVIDER=MSDASQL;dsn=Coordinator;uid=vladc;pwd=developer4444;database=SRS;"
objConn.ConnectionTimeout = 1
objConn... more >>
SQL query help (return only alphanumeric records)
Posted by F HS at 6/25/2004 2:06:25 PM
Hi!
create table #t (Type varchar(20))
insert into #t values ('1234')
insert into #t values ('abcd')
insert into #t values ('56adc')
I need to write a sql to give records when data in Type field is
alphanumeric i.e. mix of characters and numbers ( no pattern). It could
be 1bac2, x767m, ... more >>
Menu Bar 'Window' option
Posted by Berny at 6/25/2004 1:54:16 PM
Can anyone tell me how to add the feature under the 'Window' menu that lists
the currently open documents?
I can't seem to find it under the Menu Customize...
Any help would be greatly appreciated
... more >>
Yet another crazy SQL
Posted by Saga at 6/25/2004 1:38:24 PM
Hi all,
I have been asked to generate a report, where the user specifies a date/time
range a the id of the container to report on. Simple enough, but as thing
are,
the sad truth is that the tabla uses two fields to store the date/time, a
Date
field for the date and a varchar(10) field for ... more >>
alphanumeric sort question
Posted by Ray Powell at 6/25/2004 12:53:40 PM
Using the following:
DROP TABLE #Test
CREATE TABLE #Test
(
col VARCHAR(20) NOT NULL
)
INSERT INTO #Test VALUES ('100TH')
INSERT INTO #Test VALUES ('10TH')
INSERT INTO #Test VALUES ('9TH')
INSERT INTO #Test VALUES ('10 TH')
SELECT * from #Test ORDER BY col
This sorts tak... more >>
Delete SQL in a loop
Posted by Mani at 6/25/2004 12:41:01 PM
set rowcount 20000
delete table1
while @@rowcount > 0
delete table1
set rowcount 0
some times this loop does'nt delete table1 fully. Is there a way to resolve it... more >>
Need guidance with this sp, please
Posted by EManning at 6/25/2004 12:38:01 PM
Using SQL2000.
I've got 2 tables (DDL's below), one with required procedures and one with
procedures that a resident has done. I need to create a 3rd table or a view
for procedures the resident hasn't done yet or has not done the required
amount. All I need to see in this table or view is th... more >>
WHILE Transact-SQL statement
Posted by Carmen de Lara at 6/25/2004 12:37:01 PM
Hi everybody, I have the following code that have an error. The error is "Line 6: Incorrect syntax near '='.". How can I resolve the problem of assign the field empleadoid to the variable @empleadoid. Thanks
declare @EMPLEADOID AS CHAR(10)
DECLARE @SEMANA AS CHAR(2)
DECLARE @FECHAINI AS DATETIM... more >>
Update-trigger for all but one column
Posted by Jonathan Blitz at 6/25/2004 12:17:11 PM
I have a trigger for an update. However, I need to distinguish between the
case where many columns are updated and where one specific column is
updated.
I want to perform some specific action in all cases EXCEPT when the update
is only to one specific column.
How do I do this?
Using "If Up... more >>
Tough Select qry question
Posted by L at 6/25/2004 12:10:30 PM
I need help identifying the missing values in the table
below. The left column contains a modified version of the
column on the right. I am missing values for example's 2
and 3. Any help would be appreciated. Thanks, Liz
Example 1
60011911 LGC000011911
60011911 LGC009986310
60011911 LGC0... more >>
Another set of eyes, please
Posted by D Mack at 6/25/2004 12:02:01 PM
The SQL statement below works, it gives me the fields I'm looking for up to the work EXISTS, after that it goes to hell in a handbasket. Even though data is specifically excluded, it still gives me that information. I'm hoping one of you can take a quick look at it and find an obvious mistake. Th... more >>
get row with null value
Posted by Owen at 6/25/2004 11:52:32 AM
Hello:
I want get all rows that in one field (datetime datatype) are null, because
a try like this and not work
select * from table where fielddate = null
Best regards.
Owen.
... more >>
Get results from Last hour
Posted by Brian at 6/25/2004 11:33:51 AM
I am trying to create a DTS that will run every hour to import the results
into a different server. the query below is an example of what I want to do
but I need it to change dynamically. can anyone assist me with this?
Select * from TABLE_Data where datecreated between '6/25/04 10:00:00 AM' an... more >>
breaking a large transaction into smaller transactions
Posted by Dan D. at 6/25/2004 11:24:02 AM
We've used code like this in the past:
SET ROWCOUNT 1000
WHILE (1=1) BEGIN
BEGIN TRANSACTION
update tblleads_branch set pest_flag = 'x'
where lead_flag in (3,6) and pest_flag = 'z'
-- Update 1000 nonupdated rows
IF @@ROWCOUNT = 0
BEGIN
COMMIT TRANSACTION
... more >>
stored procedure and linked server
Posted by Ann at 6/25/2004 11:12:19 AM
We have a stored procedure on serverA, but there is an
update query in the sp that using a database on linked
server serverB.
The query takes more than 2 minutes to excute.
But if we run the query on ServerB itself, it takes
milliseconds.
I found when excuting this query, it uses a re... more >>
trigger problem
Posted by Bob at 6/25/2004 11:07:50 AM
Debugging would be easier if I could see which trigger called another. Is
there a way to get at this information?
Bob
... more >>
Collation/Regular Expression Bug?
Posted by wjhaase at 6/25/2004 10:12:04 AM
This may seem obscure, but it blew a hole in an hour of my day. The following code demonstrates a SQL Server bug for which I have not found any documentation. Would someone debunk or confirm my assertion?
--none of the selects should return, 2 and 4 do return
declare @Val varchar(50)
set @Val... more >>
Information_schema.columns
Posted by SKG at 6/25/2004 9:46:27 AM
How can i access Information_schema.columns of other databases like
use Northwind
select * from pubs.dbo.Information_schema.columns
This hasb an error.
Thanks!!!
... more >>
Changing SQL using VBA
Posted by Jason V at 6/25/2004 9:39:16 AM
In an Access db you can change the SQL of a query using
application.currentdb.querydefs("query").SQL. Can you do the same with an
Access Data Project (.adp)? How?
... more >>
Selecting data from one table and putting into another
Posted by Brian Henry at 6/25/2004 9:38:18 AM
I have a table that looks like this
Tiers
=======
TierID
CoverageTypeID
Name
TierCode
then I have another table thats like this
ContractCountsTierData
=================
CCID
Tier
InitialCount
**********
What I want to do is get a list of all the Tiers from the Tiers table tha... more >>
what is special about # preceding table name?
Posted by Ed at 6/25/2004 9:23:17 AM
Hello,
I create a temp table on the fly and need to drop it if it
exists.
If (object_id ('tblx') Is Not Null) Drop Table tblx
this works fine for a table called tblx
if (object_id ('#tmp') Is Not Null) Drop Table #tmp
but it doesn't work if the table is called #tmp or #tblx.
It a... more >>
Unique Number Replacement
Posted by Bradley M. Small at 6/25/2004 8:59:46 AM
I need to modify a system such that I can replace a number that is unique by
source to one that is unique across all sources.
Let say I am getting 3 files
--a.txt--
A,001,DataDataData
A,002,DataDataData
A,003,DataDataData
--b.txt--
B,001,DataDataData
B,002,DataDataData
B,003,DataData... more >>
Indexed Views Error
Posted by stringG at 6/25/2004 7:39:27 AM
Names must be in two-part format and an object cannot
reference itself.... more >>
UNICODE data in a SQL statement encoded with ANSI character sequence....
Posted by Donovan J. Edye at 6/25/2004 7:19:44 AM
G'Day,
Env: Delphi 6.02 Enterprise
For other reasons I need to excute a SQL statement that represents
UNICODE data but this data is encoded in an ANSI string. Eg.
UPDATE tblMyTable SET MyUnicodeField = "#3478#2976"
where: #3478 represents the ordinal value of a UNICODE character and
#2... more >>
Computed columns in temp tables
Posted by Steven Yampolsky at 6/25/2004 7:18:46 AM
I am having a problem with using UDF as part of a temp table computed
column. Here's the sample code:
IF EXISTS( SELECT 1 FROM information_schema.routines WHERE routine_name =
'fn_test')
DROP FUNCTION dbo.fn_test
GO
CREATE FUNCTION dbo.fn_test( @x int, @y int)
RETURNS INT AS
BEGIN
DE... more >>
Indexed Views Considerations
Posted by stringG at 6/25/2004 6:41:53 AM
Quote:
After the clustered index is created, any connection
attempting to modify the base data for the view must also
have the same option settings required to create the index.
This this mean any insert/ update on the base tables will
have to include the "SET" options as well? Just curiou... more >>
Faster Views
Posted by stringG at 6/25/2004 6:20:27 AM
Hello,
Are there any tried and true methods to increase the data
return speed of a view?... more >>
sysperfinfo counters SQL-Server
Posted by rschiller NO[at]SPAM utanet.at at 6/25/2004 3:41:21 AM
Hi,
could somebody explain to me, how the counters in the SQL-Server
sysperfinfo table are build? I mean, if the documentation says e.g.
"trans/sec" - what time frame does it mean? Is is since the start of
the instance, is it in the last 10 min? I cannot find any description
about the monitor... more >>
table-valued function with parameters from other table
Posted by Philipp Sumi at 6/25/2004 1:48:50 AM
Hello newsgroup
I have a table-valued function that returns a table with a single row
containing several calculated values. Calling the function with
hard-coded values works nice (dummy example):
SELECT * FROM MyFunction('john', 'doe')
The problem is that I need to call the function w... more >>
script object as
Posted by toylet at 6/25/2004 1:13:57 AM
When you right click on a user table in query analyzer 2000,
you got an option "script object in new window as CREATE".
Which system sp_ can do the same thing?
--
.~. Might, Courage, Vision. In Linux We Trust.
/ v \ http://www.linux-sxs.org
/( _ )\ Linux 2.4.26
^ ^ 4:12pm u... more >>
|