all groups > sql server programming > october 2003 > threads for wednesday october 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
compare all the records of all the fields of two tables
Posted by Frank Dulk at 10/8/2003 11:25:44 PM
Does some exist it sorts things out of to compare all the records of all the
fields of two tables and to see that this different one among the tables?
Each table has 90 fields
example
table 1 table 2 table1
table2
field1=a ... more >>
Using SQL Server Distribution ActiveX control with C#
Posted by a_farnsy NO[at]SPAM yahoo.com at 10/8/2003 10:55:58 PM
I am trying to use the SQL Server Distribution ActiveX control in
Visual C# to trigger the replication of a snapshot that has already
been created at the publisher.
The replication is working correctly, but the "status" event is not
triggered. I have attached an event handler, but it never app... more >>
Clause Computes
Posted by Frank Dulk at 10/8/2003 10:01:21 PM
I need to store in some way the result that the clause computes me brings.
Please, help me.
... more >>
occupies RAM memory
Posted by Frank Dulk at 10/8/2003 9:59:13 PM
I am with a problem, I have the sql 2000 installed in a server. When I tie
the server the sql it occupies some 250 Mb of the RAM memory, even without
any user to be accessing the base. That value is going increasing more and
more, even if the users don't use.
He/she/you would like to know somebo... more >>
Importing from Excel into SQL server
Posted by Jonathan Blitz at 10/8/2003 9:25:30 PM
I am not sure if to post this here or on the Excel newsgroup. I will start
here.
I am trying to import data from an Excel file into an SQL table.
My problem is that some of the data is loaded as NULL values. This seems to
be because some of the rows contain what Excel claims to be "numeric dat... more >>
How do you sum times in SQL Server
Posted by Siv at 10/8/2003 9:17:00 PM
Hi,
I have a smalldatetime field called "dteDuration" in a table that holds the
duration of a support call. I need to sum that field for a given customer
over a given date range so that I can bill then for time on the phone. How
can you do that in TransactSQL as Summing of datetime or smalld... more >>
Cursor-Loop
Posted by HartA at 10/8/2003 8:04:20 PM
With the following code(there is more code in the SP): If I have 2 records
in my Import Table that have no match in Customer. I want to make sure I
write both records to my ErrorLog Table. When I run this code only one
record get written to the ErrorLog Table. How do I get it to write all the
... more >>
How do I change the ownership of a temporary table?
Posted by Patrick Flaherty at 10/8/2003 6:09:53 PM
Hi,
I'm getting the following message back (via ODBC diagnostics):
[Microsoft][ODBC SQL Server Driver][SQL Server]The current user is not the d
atabase or object owner of table '#bogiecumret'. Cannot perform SET operation.
pat
... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
a time out has occurred while waiting for buffer latch type 4
Posted by Abraham at 10/8/2003 6:02:17 PM
We are getting this error on SQL Server 2000 ( SP3)
" a time out has occurred while waiting for buffer latch type 4 "
As per Microsoft this may happen when memory is >3GB and awe enabled ,and
this is fixed in SP2
But in my case
SQL Server 2000 -Standard Edition (SP3)
AWE disabled
OS Memo... more >>
table datatypes and cursors
Posted by Wells Caughey at 10/8/2003 6:00:28 PM
Is it possible to use table datatype variables within cursors? For some
reason when I try, SqlServer tells me that the table variable has not been
declared when it obviously has. Specifically I am trying to do the
following:
declare @cond int
declare @var table (/*table definition*/)
set... more >>
Difference between LongTime fields?
Posted by mark at 10/8/2003 5:52:48 PM
I'm stuck:
In a query I am trying to compare two fields with a date/time data type and a
LongTime format to get the difference in hours (minutes and seconds if
possible). After that I need to determine if the difference is greater than 5
hours.
The part of the query looks like this so far (... more >>
Using Case Statements in Order by Clause
Posted by Arun Karthik at 10/8/2003 5:38:12 PM
Hi all,
We have used the following select statement in stored procedure:
Note: @ProdName, @SortBy - SP parameters
SELECT *
FROM
Product
WHERE
ProdName LIKE '%' + @ProdName + '%'
ORDER BY
CASE WHEN @SortBy =3D 'ProdNum' THEN ProdNum
CASE WHEN @SortBy =3D 'OrderDate' THEN OrderDate
... more >>
sql advice
Posted by Tumurbaatar S. at 10/8/2003 5:28:19 PM
The table contains 2 key fields like Type (some number) and
Date (some date). I need to collect the _last_ records (i.e. Date has max
value) for _every_ Type. I think to use UNIONs and SORT BY Date
with TOP, if possible. Any other more perfect query advice?
... more >>
Best practice for querying different tables (or not) in Stored Procedure
Posted by Philipp Sumi at 10/8/2003 5:02:31 PM
Hello Newsgroup
I have a SP that queries the database based on several parameters. One
of the parameters referes to a customer table, the others are optional
and refer to different tables. For performance reasons, I would like to
query and join these related tables only if I really have to.... more >>
Stategy for adding indicies
Posted by JerryK at 10/8/2003 4:57:44 PM
Hi,
Does anyone have some basic rules of thumbs for adding indicies to a SQL
server 2000 database? I have been going throught the stored procedures we
have trying to optimize performance. I am wondering if I should put
indicies on the fields used in foreign key relations. Any thoughts?
j... more >>
IDENTITY on a BitMap column?
Posted by Dieter Katzenland at 10/8/2003 4:56:50 PM
Consider the following table
CREATE TABLE Attributes( id int identity(1,1),
name varchar(100),
mask bigint)
Now, attribute mask will be a bit mask of the attribute name. Consider the
data:
id nam... more >>
Multiple selection criteria on one column
Posted by John Belloise at 10/8/2003 4:41:54 PM
I promise I'm not a complete newbie. However, I cannot figure out this
problem.
RANK - VARCHAR
SOURCE - VARCHAR
SELECT COUNT(*)
FROM TABLE_X
WHERE (RANK LIKE 'XXX')
AND (SOURCE NOT LIKE 'AAA')
AND (SOURCE NOT LIKE 'BBB')
result: 8365 records.
I've done it manually by selecting * ... more >>
restore?
Posted by LL at 10/8/2003 3:37:46 PM
Hi,
I have sql statement:
restore database northwind from Disk='c:\data\northwind.bak' with FILE = 2
How to get the info from the bak file? How do I know the file is 2 not 3?
Thanks...
... more >>
Maximum stored procedure, function, trigger, or view nesting level exceeded (limit 32) ???
Posted by jobi at 10/8/2003 3:32:58 PM
Hi ,
I'm obviously missing something here ...
Can someone tell we why I get this message (db option recursive trigger is
not switched on !)
Thanks
Johan
/****** Object: Table [dbo].[T_JOBI] Script Date: 8/10/2003 15:02:28
******/
CREATE TABLE [dbo].[T_JOBI] (
[IdNr] [int] NOT ... more >>
Scrip de data
Posted by Freitas at 10/8/2003 2:52:16 PM
Please,
In ASP code, I can extract the time of a DATETIME object using
<%TimeValue(RS1.Fields.Item("NameObjetc").value)%>.
How can I extract a time of a DATETIME object using JAVA Script?
... more >>
CREATE CURSOR .. UPDATE FOR .
Posted by Tanveer Malik at 10/8/2003 2:18:56 PM
I have defined a Cursor - DYNAMIC LOCAL UPDATE FOR . - in a Stored
Procedure. When I try to Update it by using UPDATE csrCURSOR in the same
Procedure the error message 'undefined object .. name is displayed.
any Help in Updating data by using the Updateable Cursor will be welcome
--
Tanveer... more >>
Ensuring data in a column is limited to certain values in another table
Posted by George Hutto at 10/8/2003 2:15:51 PM
Folks,
In SQL 2000, I've got one table (Contracts) that has a field (SalesmanID).
SalesmanID comes from the table Associates where the AssociateType indicates
that this person is a salesman.
How can I ensure that the value entered into Contracts.SalesmanID is a
person in Associates with A... more >>
parameter null test no longer working
Posted by manofsteele NO[at]SPAM 311.com at 10/8/2003 1:22:38 PM
Hi, I have a stored proc that takes 2 parameters. It checks one of the
paramters for null and if it isn't then it does some processing. The problem
is that after importing the data from another db the test now fails. I
thought it was the ANSI NULL Default checkbox in options. It seemed to of
fix... more >>
data type of time
Posted by Matthew Louden at 10/8/2003 1:20:54 PM
In SQL server, I want to know what is the data type of time? I use datetime
for the data type of both date and time, it turns out when I add a new
record like this:
insert into [timecard] (ID, TimeIn) VALUES ('1001', '12:03:31 PM');
It will insert 1/1/1900 12:03:31 PM in the database.
Any... more >>
Collation Errors with Union and Views
Posted by Douglas Marquardt at 10/8/2003 12:58:51 PM
Hi All:
I am getting the error : Cannot resolve collation conflict for UNION operation.
I've read all I can find in the books online on this,
and tried whatever I could think of to solve this,
but I can't get Unions to work in my SQL 2000 db
when I try to do a union on two views. If I unio... more >>
Locking Problem in SQL Server
Posted by Babz at 10/8/2003 12:38:47 PM
Hi,
I have two Sql Connections one is Fetching the data from the table at
constant interval of time
and another will update the data at constant interval of time.
My problem is when ever the update Connection is updating the data it is
locking the rows,
Though I am not fetching the locked... more >>
Performance question: where condition "LIKE '%'" ignored?
Posted by Philipp Sumi at 10/8/2003 12:36:41 PM
Hello
I'm currently developing a web application that contains a search form
with various (mandatory) fields. As I would like to use SPs with
paramters rather than to assemble the whole SQL string, I was asking
myself how the query optimizer would ignore parameters which would only
contai... more >>
datalength( '' + space(5) + '' ) = 7 !!!???
Posted by Antoine Perret at 10/8/2003 12:34:33 PM
Hello,
What configuration could cause a database to substitute a space character
for empty strings ?
Two databases on the same server. In one the statement select '' + '123' +
'' yields " 123 " and on the other the same statement yields "123".
Thanks for any insight
AP
... more >>
Database Design Question
Posted by Gee at 10/8/2003 12:14:45 PM
How would you link these table on a diagram:
create table ClientLetters
(
UserCode varchar(8) not null ,
LetterID int not null
primary key(UserCode,LetterID)
)
GO
create table Letters
(
LetterID int not null Primary key,
OriginalLetterID int not null,
Version int,
De... more >>
Moving fields value to anothe field
Posted by mamun_ah NO[at]SPAM hotmail.com at 10/8/2003 12:09:32 PM
Hi All,
I have the following case.
I have a table in MS SQL 2000, which has 8 fields and already
populated with data. Now, I need to modify the table with the existing
data in the following way.
I need to condense the table (or move some fields from its current
location, not deleting... more >>
Insert
Posted by sunil at 10/8/2003 12:05:46 PM
Iam inserting records from table T1 to table T2 using
following syntax
insert into T2 (col1,col2)
select col1,col2 from T1
T2 has contstraints on certain columns.
Is it possible to determine which record failed during insert operation.
Both tables have primary keys.
If i insert single r... more >>
Run replication before SQL Service stops
Posted by Simon at 10/8/2003 12:03:35 PM
I want to run replication before SQL Service stops.
I notice that it can be done in alerts...
But which event do I have to capture ??
... more >>
mpg or mpeg from sql server
Posted by Dan Heile at 10/8/2003 11:45:55 AM
has anybody used sql server to serve up .mpg files for an
internet application. we are now using SQL to store
product images but wondered about movies
Dan <><... more >>
DMO Multiple Script Types
Posted by mcampbell37075 NO[at]SPAM Yahoo.com at 10/8/2003 11:43:49 AM
This may be a very simple question, but I am wondering if someone can
help me. I'm using the DMO Table object's Script method to script the
tables in a database (I must generate the script because I am
manipulating the output text). In the DMO documentation there is this
line for setting the S... more >>
Divide by Null - can this equal null?
Posted by alex NO[at]SPAM totallynerd.com at 10/8/2003 11:31:19 AM
Hi...
I'm writing a rather complex DTS script, and in one of my
calculations, it'll be dividing by a variable from one specific table.
Some of this data is null, so it's dividing by Null, which errors out
saying I'm dividing by zero.
Is it possible to tell MS SQL 2000 to produce a null in ... more >>
Can I do this without cursors?
Posted by Michael at 10/8/2003 11:29:09 AM
Hello,
I need to populate another table with new records based on a data entry
table.
Basically in this data entry table, I have two fields that represent a range
of numbers, an example record (range1 = 12, range2 = 18)
In the table I'm populating, I need to insert a record for each value... more >>
Complex data moedling problem: How to join cost information with different calendars ...
Posted by katiesoft1 NO[at]SPAM yahoo.com at 10/8/2003 11:20:04 AM
We are taking big performance hits joining our cost information to
different fiscal calendars for reporting purposes. Can anyone
recommend a solution?
I have my cost information stored in 1 table like the following:
Vendor StartDate EndDate Cost
A 1/1/03 1/7/03 1... more >>
identity fields just jumped by 10000
Posted by middletree at 10/8/2003 10:58:31 AM
I have an identity field in a db used by an ASP-driven intranet app. The
field is the primary key, and it is a number the the user sees and uses. We
went live with the app last week, and I reseeded the field to start back up
at 1000. It had been 10000 when I was testing prior to going live, and... more >>
SQL Server Security
Posted by Ron at 10/8/2003 10:46:30 AM
Can anyone give me any tips or links as to what the best practices are for
SQL Server security?
I am also interested to know the best ways to utilize a database remotely
without the connection string being made available.
Thanks ,
Ron
... more >>
Bulk insert
Posted by Jen at 10/8/2003 10:39:58 AM
Hi,
I would like to load a file to our db server. I have the
file on my local hard drive. Can I do it from query
analyzer on my box? how can I specify the data_file?
Thanks... more >>
syntax or else?
Posted by kob uki at 10/8/2003 10:37:21 AM
What is the proper syntax to set an integer column to identity column? EM
creates a new table, pumps the data over and then drops the table. This is
TOTALY unacceptable! What if I have millions of rows in that table? In 1
single transaction it going to pump millions of rows into the transaction
... more >>
Old Buliten Board Postings Pre-2003
Posted by Mark at 10/8/2003 10:18:59 AM
How do I get older bb postings. I was here about 9 mos ago
and read a post, now I can't find it anymore. I think it
was some time in 2002 or 2001. When I set the date back
that far I get 0 results.
... more >>
Multi-statement
Posted by André Almeida Maldonado at 10/8/2003 9:24:58 AM
When I try to run the code bellow, I have the answer:
Server: Msg 226, Level 16, State 5, Line 3
CREATE DATABASE statement not allowed within multi-statement transaction.
WHY????????
BEGIN TRAN BDPP WITH MARK 'Criação do Banco de Dados PP'
CREATE DATABASE PP
ON
( NAME = 'PP_D... more >>
StoredProc - Help!
Posted by RK at 10/8/2003 9:19:28 AM
Hello All & Greetings.
I have the following scenario and am looking for some help and will
appreciate any suggestions. Thanks in advance.
Scenario:
I Have 2 Tables.
Table Structure:
table1: partID, itemcode, speakers, DIN (bit field)
table2: partid, vid
For UPDATEs, I have to do ... more >>
Inserting into 'ntext' columns
Posted by Alexander Hoffman at 10/8/2003 9:04:19 AM
The following trigger:
===========================
create trigger update_trig on TEST for update
as
insert TEST_AUDIT
select
*
, getdate()
, 'UPDATE'
from inserted i
return
==========================
gets fired when a row in the TEST table gets updated. We
write the change to a... more >>
update else insert?
Posted by Jochen Daum at 10/8/2003 8:31:36 AM
Hi!
I need to "warehouse" data from an Informix table as a linked server
into SQL Server. As there is no facility to see what changed, I would
like to update all records or insert them, if there is none.
Whats the best method to do something like that in a stored procedure?
I looked to turn... more >>
Create a DATABASE using the "Create Database ..." cmd
Posted by Cristian Vitan at 10/8/2003 7:57:16 AM
To Whom it may concern:
I have the SQL server 2000 installed. and I do know how
to create the Databases using the SQL shortcuts.
I do not know how to type the command "CREATE DATABASE
newdb" to create a database.
Do I do it on DOS prompt or is somewhere a "QUERY" link
on the SQL Server ... more >>
HOW TO? Result set with "SELF UNION" on ParentID, recursively?
Posted by Todd Beaulieu at 10/8/2003 7:46:59 AM
I'd like to query records that meet a requirement, and
then union in all records from the same Table that are
referenced by those in the original result set. This
second set can also reference records, and so on.
Example:
ID
Description
ParentID
So, I'd like find all records that me... more >>
Create a database using the 'CREATE DATABASE' cmd
Posted by Cristian Vitan at 10/8/2003 6:48:25 AM
To Whom it may concern;
I would like to create a database using the CREATE
DATABASE command and I do not know where to apply it.
Please let me know where I can type the command create
database to create databases.
Thank you
Cristian Vitan... more >>
Error executing SP: OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an error.
Posted by amcniw NO[at]SPAM yahoo.com at 10/8/2003 6:24:49 AM
I get this message when I attemt to execute a stored procedure from an
ASP.net page:
"OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an error.
\r\nINSERT INTO ##TempImport(APC,ServiceIndicator,Weight,NatCoin,APCDesc,Release)
SELECT * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0','Excel
8.0;HDR... more >>
sql query problem
Posted by Galileo Mak at 10/8/2003 5:47:24 AM
Inventory
Product_id Color Size Qty
12345 white A 2
12345 white B 4
12345 white C 5
12345 white E 2
12345 red A 4
12345 ... more >>
adding system stored procs
Posted by Rayan Yellina at 10/8/2003 5:37:25 AM
Hi Guys,
Someone delete one system stored procedures
(sp_grantdbaccess). How can I add this back. If I try to
add, the owner is ok (as "dbo"), but the type is "user"
which is not correct. I need it as "system" because all
others have type as "system". In future how can I hide
these... more >>
@@error problem.
Posted by ramy at 10/8/2003 1:57:46 AM
hi,
I have created a linked server from my sql server to
another sql server say "B". Iam trying to write an sp
which has the foll. tsql commands.
select * from B.master.dbo.sysobjects
if @@error <> 0
print 'Error !'
Now the problem here is that if the linked server "B" is
down, i... more >>
PRINT command output.
Posted by Vlassis at 10/8/2003 1:56:32 AM
Hi all!
I need to return the output of the PRINT command to my VB6
application. I use the connection.Errors collection to get
error information, but PRINT commands don't seem to add
errors to this collection. I must be missing something...
Thanks
Vlassis
... more >>
Extracting rows that differs from another table
Posted by Risun at 10/8/2003 1:51:04 AM
Hi everyone
I need to be able to extract data from a table (A_temp) so
that i can pump that data into another table (Sales).
Both table have the same columns but the A_temp table
holds data that sometimes already exist in table Sales.
In Oracle you could use the MINUS arguement to compare t... more >>
Trying to reduce deadlock
Posted by Andrew at 10/8/2003 12:56:47 AM
I have a deadlock scenario which I am finding hard to
resolve. It appears to be deadlocking on an index rather
than data.
My application has multiple threads submitting queries to
the database. Two threads often run the same stored
procedure at the same time. Sometimes a deadlock resul... more >>
Need help with MAX(DateTime) Select Statement
Posted by sqlguy at 10/8/2003 12:04:47 AM
password_id
standard_id
password
passworddate
1
4
password1
8/20/2003 13:00
2
4
password2
12/25/2003 12:30
3
4
password3
12/25/2003 13:30
4
2
mypass
6/5/2002 18:00
... more >>
|