all groups > sql server programming > august 2003 > threads for tuesday august 5
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
data import source = odbc link destination=sql server 2k with stored procedure
Posted by Gazi at 8/5/2003 11:40:51 PM
Hi,
I want to import data from an odbc linked database. The source database is
progress, linked with the Openlink Odbc connection. If i use DTS, i get
(known) problems because there is a memo field in the source table. Here it
was recommended to use a stored procedure instead of a DTS.
As i... more >>
xp_srv_paraminfo_sample
Posted by Ahamad at 8/5/2003 10:28:03 PM
Hi
When I run the xp_srv_paraminfo_sample in VC++ 6.0, I am
getting the error "Undeclared Identifier: ODS_VERSION".
When this line is commented, I am getting the linker
error. Are there anyone to me to solve the problem ?
Ahamad... more >>
need help with a query
Posted by Lachlan James at 8/5/2003 9:52:12 PM
Hi,
I am having trouble with one of my reporting queries.
I have a table called Competition and another called
UserAnswer. UserAnswer stores answers received by users
for a given Competition. I also have two other tables
called Team & Player that hold info about Teams & Players.
Each ... more >>
help conversion problem
Posted by Joel Gacosta at 8/5/2003 7:42:59 PM
Hi All,
I want to convert a character data type into numeric but im having problem
when dividing a number which is less than the denominator. It returns 0.
what seems to be the problem. here is my query...
CONVERT(int, SUM(Duration/60)) As TotalMins
... more >>
Convert
Posted by Marco at 8/5/2003 7:29:32 PM
I need to convert this example in 16 decimals number.
CREATE TABLE #TMP_APLICACAO
(
[VL_APLICACAO] [MONEY],
[NR_QUANTIDADE] [NUMERIC] (28,16),
[VL_PU_OPERACAO] [NUMERIC] (28,16)
)
declare @vl_pu_operacao numeric(28,16)
INSERT INTO #TMP_APLICACAO VALUES ( 3103.40, 3.00, 0)
sele... more >>
how to get the current connecting DB name ?
Posted by max chen at 8/5/2003 5:30:45 PM
Hi
Can I get the name of current connecting DB with sp_XXX ?
Plz help, TIA !
Max.... more >>
Ordering by a variable
Posted by Amos Cividalli at 8/5/2003 5:03:13 PM
I try the following SQL statement:
declare @o varchar(20)
set @o= ' name'
select top 5 *
from MyTable
order by @o
In return, I get this error message:
Server: Msg 1008, Level 15, State 1, Line 7
The SELECT item identified by the ORDER BY number 1 contains a ... more >>
trigger xp_sendmail values from inserted table
Posted by Will Jay at 8/5/2003 3:38:56 PM
Does someone have an example of a trigger using xp_sendmail, that includes
some of the columns of the inserted record in the body(message) or subject
of the the email. I cannot make it happen.
Thanks
wj
... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
MDF file size
Posted by Robert at 8/5/2003 3:32:29 PM
In my experience, MDFs are always a multiple of 512 bytes in size. Yet,
after shrinking, an MDF is 301824 bytes. This is not a multiple of 512
(although it is a multiple of 256). Anyone know what gives?
Thanks.
Bob
... more >>
Which data type decimal, money, float...?
Posted by JCardinal at 8/5/2003 3:29:22 PM
For a sql server 2000 table that must hold exchange rates for currency and
fractions of hours that will be multiplied by currency values, is it (in
general) best to use a decimal data type or a smallmoney / money data type?
The values are small, i.e. a typical exchange rate might be 1.3367 or ... more >>
How do I copy a database on the same server with a different name?
Posted by Raanan Avidor at 8/5/2003 3:10:49 PM
How do I copy a database on the same server with a different name?
Raanan
... more >>
Joining a table to a procedure
Posted by John at 8/5/2003 3:05:33 PM
From a Newbie (fresh off the boat from Access land).
Please Help
We have a simple bunch of Access queries
(procedures/views) similar to the following but cannot get
them to work in SQL Server. We are missing something
obvious and would be very grateful to know what.
We have a database ... more >>
Quick Query Analyzer Question
Posted by Ben W at 8/5/2003 1:32:15 PM
Hi there,
When writing queries in Query Analyzer - whenever I type a single quote, the
character does not appear until I press another character, or Esc.
How can I turn this brilliant :-| feature off??
Version: SQL 2000
Many thanks
... more >>
Tricky (Impossible?) - Nested Top
Posted by Archibald at 8/5/2003 1:14:38 PM
I know how to solve this problem with multiple queries
using a while statement but I am curious if anyone knows
of a way to do it in a single select statement.
To explain/demonstrate the problem I will transfer the
concept to the Northwind database. Essentially, I would
like to know the ... more >>
Using max() with GROUP BY
Posted by Rick C. at 8/5/2003 1:08:06 PM
select subm_no, init_prem, sum(tot_prem)
from premium
where subm_no = 39792
group by subm_no
I know the above statement will tell me that init_prem "is invalid in the
select list because it is not contained in either an aggregate function
or the GROUP BY clause". Normally I will deal with... more >>
stoopid question ...
Posted by Bob Castleman at 8/5/2003 12:54:40 PM
How do I do this:
select * from sp_who where dbname like '%xyz%'
I thought sp's were essentially like datasets but apparantly not.
Thanks,
Bob Castleman
SuccessWare Software
... more >>
simple query help
Posted by Dana Wanner at 8/5/2003 12:44:07 PM
I am very new to writing even the most basic queries, and hope one of you
would be willing to help me out.
I am trying to query a database for duplicate item numbers.
select * from IV00101 where itemnmbr = itemnmbr
above is what I thought the query should look like, but I was wrong it
... more >>
hiding sql server tables
Posted by John Livermore at 8/5/2003 11:53:15 AM
We are working on a product that will be deployed to a customer site.
We want to keep our customers from getting into the database and
examining the data model, etc. Is there a way to keep them from doing
this?... more >>
Create a Deadlock
Posted by Fred at 8/5/2003 11:46:58 AM
When I started at this company they run continious trace
flags to capture deadlocks.. The flags are
-1,3605,1240,1205.
These trace flags monitor for a deadlock and report any
finding in the Error log. The error log is sooo full with
messages about NOT finding deadlocks, that its hard to ... more >>
write query in SQL Query Analyzer
Posted by John Davis at 8/5/2003 11:40:43 AM
In SQL Query Analyzer, if we write the query statement, we
need to erase the previous statements first. otherwise,
all the above statments will be executed again. It is very
tudious, and anyone knows the workaround to the problem??
For example, here's the 3 different SQL statement, but if
... more >>
OSQL and kill all connections
Posted by Patrick at 8/5/2003 11:26:54 AM
How can I disconnect and kill all connections from osql ?
Thanks
Pat
... more >>
Problems Using Temp Tables (##TEMPNAME)
Posted by JNDiaz at 8/5/2003 11:26:21 AM
I have a stored procedure that can open different tables, calculate data,
and return for reporting purposes. For this, I create a Temp table with the
data from the main tables queried and grouped. From the Temp table I
calculate the numbers I need to return. This is much faster and efficient
... more >>
Bulk Copy and Clustered Index
Posted by Frank Cheng at 8/5/2003 11:20:40 AM
Hi all,
When doing a Bulk Copy to load large amount of
data into a table, I was told that it would be wise to
(I don't have any existing data in that table)
1) Drop all th existing indexes
2) Bulk copy the data into the table
3) Rebuild the indexes
However if one of the indexes is a c... more >>
default vales
Posted by Abraham at 8/5/2003 11:19:24 AM
Hi,
How can I find table name, column name of all columns having default value
''
Is there any system table store the defalt values.
Thanks
... more >>
Raiserror doesn't work ( ODBC, VC++, T-SQL )
Posted by Alexander Rayev at 8/5/2003 11:17:25 AM
Hello.
I have a problem raising an error from stored procedure.
When I insert Raiserror at the beginning of the SP everything works well.
Then I do something in SP ( such as call another SP ) and then do Raiserror
error doesn't fire exception on the client....
Client ODBC, VC++ 6.0 SP5 , se... more >>
BCP and taking off a database
Posted by Patrick at 8/5/2003 11:03:57 AM
Hi Freinds,
SQL 2000
I need to take offline <mydatabase> eveytime the computer restarts. I
created a batch file with BCP utlity ,
I need the command for taking off the database from BCP
Thanks in advance,
Pat
... more >>
How to update a column ?
Posted by Polaris at 8/5/2003 10:49:36 AM
Hi:
I need to update a column with a number so that all rows of this column has
the same value. Anyone can tell me how to do that?
Thanks
... more >>
help with sp please!
Posted by ben h at 8/5/2003 10:25:31 AM
copied in below is my sp (MSSQL 2000), I'm trying to return the two
variables {newFeedbackID, newRequestID} as if they were part of a recordset
to an ADO recordset object, which I access as follows:
requestID = (rsFeedback.Fields.Item("newRequestID").Value)
Am I doing the sp right?? I was ho... more >>
deadlock
Posted by sam at 8/5/2003 10:07:05 AM
Hi ,
I have a question. My manager wants me to implement this.
In case a transaction rolls back because of deadlock , it
sould get commited automatically.
How can I implement this?
Any help is appreciated. Pls give as many reply as
possible.
Thanks a lot.
... more >>
HELP Copying data between two databases on the save server
Posted by Tom Mauldin at 8/5/2003 9:58:37 AM
I am new to SQL 2000. I have 2 databases on the save server. I need to copy
data in a table in one database to a table in another database. I am trying
to use the code below but keep getting errors "Invalid Object name
'OldPractice.ageid' Can some one help me with the code so I can get the
da... more >>
Select query
Posted by Meher Malakapalli at 8/5/2003 9:52:18 AM
Hi,
I have a table with the following data:
RowID IPXID RebateAmount AdjDesc
1 1 10 Test1
2 1 -10 Test2
My desired resultset should be
IPXID RebateAmount AdjDesc
1 0 Test1, Test2
or
IPXID RebateAmount AdjDesc
1 0 Test2
I have written the SQL for this to get my desire... more >>
outer join, cross join, union? DDL/sample data incl.
Posted by Kevin at 8/5/2003 9:51:31 AM
Ok, I'm sure i'm missing something obvious...
DDL/DML
create table #codes (Code char(1))
-- insert distinct codes
insert #codes select 'A'
insert #codes select 'B'
insert #codes select 'C'
here is the expected output - the disctinct combination of codes, with their
relative positio... more >>
Changing the date format
Posted by Ioannis Demetriades at 8/5/2003 9:43:21 AM
Hi,
I am using ADO.NET to connect to an SQL server 2000 db and I need to know
how to change the format of the date values that are coming through from the
database. I suspect there is an environment variable or something that can
be set either through the ADO.NET connection string or through a... more >>
catch @@Error output
Posted by Immy at 8/5/2003 9:14:50 AM
Hi all,
Does anyone know how to capture the @@error result description, NOT THE
ERRORID which I can do via @@error.
i.e. Server: Msg 2812, Level 16, State 4, Line 1
Stored procedure 'dbname..spname' not found.
If I just use the errorid and join onto sysmessages then I dont get the
comple... more >>
SQL Profiler Lock:Acquired
Posted by Largo SQL Tools at 8/5/2003 9:10:58 AM
The lock type is stored in a field name BinaryData (which of course contains
binary data). Does anyone know the format of this field so I can extract
the lock type?
Thanks.
... more >>
DELETE *.csv from T-SQL
Posted by Sean at 8/5/2003 9:00:28 AM
I need for my SQL Server 2000 stored proc to delete a file
from my network drive. I can't find the T-SQL equivalent
to the VB 'KILL' function (there is a KILL function in T-
SQL, but it does something else).
Anyone know how to do it?
Thanks in advance.
Sean... more >>
Backup restore to another SQL server HELP!
Posted by Marcus Ghiust at 8/5/2003 7:16:07 AM
I have 2 SQL servers, I created a backup of database(test)
on server A and I want to take that backup and restore it
to a database(test) on server B. The location for sql
backup on server A is D:MSSQL\backup and the path for
server B is E:Mssql\Backup. This is a SQL 2000
environment. Th... more >>
DATENAME/DATEPART question
Posted by Andy at 8/5/2003 5:56:17 AM
Hello,
Thanks for the help with the first error message. Query
Analyzer seems to accept the query now.
However, the result set shows:
April 2003
August 2003
1. Is it possible to change these dates into:
04/03
08/03
The chronological order would be respected in this case.
2. Is it... more >>
bulk copy using format file
Posted by Stuart Dee at 8/5/2003 5:52:17 AM
Hi,
I have a table
which i need to copy some data into. The data format is
comma delimited with quotes around strings.
Using the table below. At first I created a format file
using the correct types ie SQLINT but found the integers
were screwed and seemed to correct itself when I just u... more >>
Preferred SQL Editor
Posted by Amit at 8/5/2003 5:26:23 AM
Hi,
Thanks in advance for help extended.
I am developing an application in C# for C#-database
connectivity using Visual Studio .Net.
Now Visual Studio .Net has inbuilt SQL editor using which
we can create procedure, view, functions, tables, database
diagram, create database(with limited ... more >>
DATEPART error message
Posted by Andy at 8/5/2003 2:33:12 AM
Hello,
I have a problem using the DATEPART function.
The error message returned is 'invalid parameter 1
specified for datepart'.
This is my query (object: return the sum of the invoices
per month per lot)
SELECT
L.DESCRIPTION_LOT AS [LOT],
DATEPART ('mm', F.DATEINVOICE) + '/' + D... more >>
Selecting tables with relations
Posted by mmmc_reptail NO[at]SPAM hotmail.com at 8/5/2003 1:42:16 AM
Hi,
I have two tables tableA and tableB.
tableA: tableB:
- eka - toka
- name - eka
- id - ope
- updated
The tableA is a parent table and eka is the primary key.
tableB's eka is foreign key.
If I do a search where tableA's eka is 4, I need to search
a... more >>
ADO Connection timeout does not work
Posted by Alex Cheung at 8/5/2003 1:16:16 AM
hi,
I am writing a porgram that retrieved the data from
SQL Server. It is required the program would not suspend
or hang on, even though SQL Server is down or Network busy
while accessing the database. I have tried to set the
connection timeout to 1 on ADO Connection. But it doesn't
... more >>
I don't want to see a SQL Server error message
Posted by Diego Parolin at 8/5/2003 12:44:08 AM
Hi, in this store procedure
CREATE PROCEDURE LH_H_PPM_Commessa
AS
set nocount on
INSERT INTO [dbo].[H_PPM_CommessaID] ([CodiceCommessa] ,
[CodiceCommessaEffettivo] ,
[Descrizione] ,
[MercatoID] ,
[ClienteID] ,
[DescrizioneCliente])
(SELECT [Commessa_mis],
[Commessa_effettiva... more >>
|