all groups > sql server programming > april 2004 > threads for monday april 12
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
SQL Server/ADO/XP problem "query cannot be executed"
Posted by George Copeland at 4/12/2004 10:42:31 PM
This is a request for help fixing a SQL Server 2000/ADO problem on Windows
XP. I would appreciate any useful assistance.
PROBLEM: SQL Server access on my machine fails as follows:
1. All of my VB6 apps reference the following ADO typelib:
Microsoft ActiveX Data Objects 2.7 Library
Locate... more >>
Updating data based on timestamp
Posted by ajmiester at 4/12/2004 7:01:50 PM
Hi
I have a table that has data being inserted as soon as it available. I have
a query that is scheduled to run at the end of the day which extracts data
where date > yesterday. I have to modify it to run every half hour and only
include data that was inserted after the previous run.
Create... more >>
changing data type or converting
Posted by enrico martinelli at 4/12/2004 6:36:57 PM
Hello there!
I have a column in a table with data type float, which
has data such as 0.00, -3.9765600000, 56764.7664, etc...
I just want this column to show positive or negative or
zero with 2 decimal to the right.
Any ideas are highly appreciated.
thanks!... more >>
Q: Design considerations for table to store Emails in?
Posted by Sky at 4/12/2004 5:36:52 PM
Hello.
I'm wondering what is considered the best practice for a schema for a table
to store emails in.
I ask this question because I am confused as to how to store an email that
is addressed to several people in the office, once in a database to save
space, and allow linking to/from other ite... more >>
Need help Updating data based on timestamp
Posted by ajmister at 4/12/2004 5:34:14 PM
Hi
I have a table that has data being inserted as soon as it available. I have
a query that is scheduled to run at the end of the day which extracts data
where date > yesterday. I have to modify it to run every half hour and only
include data that was inserted after the previous run.
Create... more >>
sp_addlinkedserver
Posted by dk at 4/12/2004 5:32:06 PM
can anyone point to a good example of
using sp_addlinkedserver with an
access97 .mde file?
tia,
dk... more >>
update question
Posted by chris at 4/12/2004 4:30:04 PM
How would I set the value of a column = the value of
another column from the same table:
update product
set SecondCardIsFree = (select IsUpgrade from product)
Subquery returned more than 1 value.
update product
set SecondCardIsFree =
(select IsUpgrade from product p2
inner join p2 ... more >>
dynamic where clause with variable columns
Posted by Gary D. Rezek at 4/12/2004 4:06:09 PM
Hi All,
I'm trying to make a dynamic 3 field filter in a stored procedure.
The following dynamic single field filter works.
@FilterByFieldName1 => Field Name
@FilterBy1 => Field Value
SELECT @SQL1 = 'SELECT * ' 'the * is used only for space saving in this post
SELECT @SQL2 = 'FROM... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
CASE statements?
Posted by Brian Henry at 4/12/2004 2:50:11 PM
Is there case statements available for stored procs? like
CASE 1
' DO something
CASE 2
' Do something else
CASE else
' do something different
thanks
... more >>
append to text data?
Posted by BRB at 4/12/2004 2:46:04 PM
Is there any way to append to a text data with T-SQL? I have text data on one server, and I notes (also text data) another on another server. I want to append the notes several times per day. Thanks
BR
SS2K... more >>
2 cursors with nested WHILE @@FETCH_STATUS possible?
Posted by Andreas Klemt at 4/12/2004 2:30:58 PM
Hello
is this possible to have nested WHILE @@FETCH_STATUS = 0?
If not I would like to now why not and is there a better way?
....
DECLARE cur CURSOR FOR
SELECT person FROM table
OPEN cur
FETCH NEXT FROM cur INTO @person
WHILE @@FETCH_STATUS = 0
BEGIN
DECLARE cur2 CURSOR F... more >>
BUG: BOL Article - "Custom Stored Procedure Conflict Resolver"
Posted by PCK at 4/12/2004 2:20:52 PM
Did not know how else to get this to MS. Maybe some of
you MVPs can get it to them...
In BOL article "Custom Stored Procedure Conflict
Resolver", the last paragraph states
"After the stored procedure is created, you must
configure an article to use that stored procedure as its
custom... more >>
Reserved words/symbols for SQL Server 2000
Posted by Warren at 4/12/2004 1:21:02 PM
Does anyone know where I can find an article that shows most of the reserved symbols for SQL Server 2000. A few developers want to name databases with a (-). And I know this causes issues with SQL Server , like being able to truncate the transaction log etc. Any help is appreciated
Thanks
War... more >>
Profile Trace: determining where sp originates
Posted by Timo at 4/12/2004 1:08:32 PM
Let's say there are two databases, DB#1 and DB#2, and a user JOE. DB#1 and
DB#2 have stored procedures identically named (.e.g. "uspGetOrders") with
the same signature. Is it possible when running a trace that filters on
user like JOE, to determine which database the procedure belongs to which... more >>
Run sql within a stored porcedure as sa
Posted by Seal at 4/12/2004 12:28:43 PM
Hi,
Is there a way to run a particular set of instruction in a stored procedure
as 'sa' instead of the user that calls the stored procedure?
Thanks
... more >>
Encapsulating stored procedure results in a function
Posted by Scott McNair at 4/12/2004 12:25:58 PM
Hi,
One of my complaints about stored procedures is that (unlike a function) I
can't join or select against data returned by one. Is there a way I could
pass a stored procedure to a function and have it return a
joinable/selectable table based upon the stored procedure table that was
fed... more >>
random numbers
Posted by chris at 4/12/2004 12:06:03 PM
hi
is there a way to generate random numbers that i can use as a primary key. like the sequence in oracle
thanks... more >>
Nested query with SQL 2K MSDE
Posted by Ray Melendez at 4/12/2004 12:00:51 PM
Hi,
I have a small problem with a db. I had the same problem after
importing the db tables to Access so I assume its an error
on my query.
I have two tables that I'm trying to do a nested query.
Query1: SELECT * FROM table1 where VDN_Name in ('12345', '23456')
I get my results correctly.
I... more >>
Re: Table Design Question
Posted by Louis Davidson at 4/12/2004 11:42:44 AM
Oops, continuing on,
> Okay, so the thing that continues to bother me is that "data" is always
> built into the metadata of any object. The design principle, which is
> one of those things I will now add to my bag of "things that I think are a
> really really good" ideas is:
>
> Within a gi... more >>
How can I pass a variable from VB.Net to an SQL Query
Posted by J French at 4/12/2004 11:18:03 AM
Please provide some code to show me how to pass a variable (Cat1) to a
query.
I have tried :
DECLARE @Find nvarchar(30) SET @Find = ' + Cat1 + ' SELECT Master.nameLast +
', ' + Master.nameFirst as etc.
WHERE Master.nameLast LIKE @Find
... more >>
delete where isnull
Posted by mcnewsxp at 4/12/2004 11:16:08 AM
using xp_cmdshell to run a droplet
Posted by Tom at 4/12/2004 11:16:06 AM
I am trying to use the xp_cmdshell procedure to execute a droplet I have stored on my server. This is part of a web app to upload and store images in a SQL Server 2000 DB. I am attempting to upload to the server (which I can do), trigger this photoshop droplet to resize the image to a uniform size... more >>
Accessing list of SQL Servers from VB
Posted by EvanK at 4/12/2004 10:41:07 AM
Is there a way in vb.net to access a list of available sqlservers and populate it into a drop down? Thanks.... more >>
Repair code
Posted by Julio at 4/12/2004 10:40:26 AM
Hello
Excuse, but I am learning the inglish
I want to see if they can help me to repair this code, I have the following
one
code
Create view TotalConsumo
AS
select ConsumoID,fecha,clienteid,Energia, Energia -
isnull ((select Energia from Consumo a
where a.ConsumoID =
(select max(Cons... more >>
extended stored procedure
Posted by Daniel P. at 4/12/2004 10:39:51 AM
Can anyone point me to a link / article wher it explains how to connect to
the SQL server inside an extended sproc written in C/C++? I looked in the
SQL Server examples and BOL / MSDN library and I found two ways
* by using DbLib (Yuck! I thought I can move away from this technology)
* ODBC - th... more >>
Getting Date from a Table
Posted by Steve NO[at]SPAM BT at 4/12/2004 10:34:38 AM
Hi All
I am new to SQL Programing, and I have a table with a column name of
datesaved, Data type is datetime
and some of the dates are
10/04/2004 20:27:30
10/04/2004 20:28:32
10/04/2004 20:29:20
10/04/2004 20:32:40
and so on,
How do i select just 10/04/2004 from the table with out the... more >>
How to update the substring in a field?
Posted by Joe at 4/12/2004 10:26:01 AM
How to update the substring in a field
Let's say the table Stock is like
ID Descriptio
=== ================
1001 NATL ABC US
1002 CA ABC US
1003 TOKYO ABC JAPA
and I want the data is changed from substring 'ABC' to 'DEF'
ID Descriptio
=== ================
1001 NATL DEF ... more >>
showing a little compassion
Posted by Dan at 4/12/2004 10:12:52 AM
I recently received this response from someone on this forum.
<anonymous@discussions.microsoft.com> wrote in message
news:1a99c01c41e65$d15e87e0$a501280a@phx.gbl...
> Oh - No! It's another one of those IDoits. I'm sure Joe
> Celko will be along very soon to jump up on his soap box
> and give ... more >>
How to know the current database name
Posted by Danny Mansour at 4/12/2004 10:07:03 AM
Hi there,
Inside the code of a stored procedure, is there a way to
figure out the database this stored procedure is in or
belongs to. I basically need to read a registry key from
this stored procedure where the key is identified by the
current database name.
please let me know if you ... more >>
INSERT trigger on view won't fire
Posted by david at 4/12/2004 9:56:02 AM
I can't get an INSERT trigger on a view to fire in SQL Server 2k. I execute
CREATE TRIGGER [trigMechanical
ON [uvwMechanical
INSTEAD OF INSER
A
BEGI
-- a rude "Hello, world" msg
RAISERROR (50009, 16, 10
EN
Inserting a row into the view quietly propagates the values to the underlying... more >>
UDF value
Posted by Jay at 4/12/2004 9:51:04 AM
I would like a UDF to calculate the number of records in a recordset. The UDF would return an Integer which calculate the number of records in a SQL string that the UDF makes with the variables that are passed to it
For example if I pass the fields "city" and "state" to the function. The function ... more >>
Job Scheduling Question
Posted by Amos Soma at 4/12/2004 9:22:55 AM
Can someone show me a Select statement that determines the next time a job
is to be run? I know that msdb..sysjobschedules has a next_run_date field
but this doesn't seem to be the next time the job is to be run.
Thanks, Amos.
... more >>
Table Structure Guidelines
Posted by A.M at 4/12/2004 9:19:50 AM
Hi,
In our development team, we have different opinions about data model and
database table structure (column name/data type). For example email field
should be varchar(60) or varchar(12)? "name" is not a good column name, it
should be "first_name" and varchar(40) should be enough.
Is there a... more >>
Object owner
Posted by Seal at 4/12/2004 9:15:48 AM
Hi all,
What is the most efficient way to determine who is an object owner (in this
case a table)?
Thanks
... more >>
Dirty Read
Posted by JohnA at 4/12/2004 8:51:57 AM
I've heard that if you use a no-lock hint that there are
circumstances where you may skip a record that is locked
rather than read the unmodified version. Can anyone shed
any light on this topic?
Thanks.... more >>
Search queries with multiple constraints
Posted by Brian Henry at 4/12/2004 8:48:16 AM
Im trying to make a search system for a full text indexed table (well its 2
tables it searches) I need to get the list of Primary keys in both tables
from the search (this part is easy)
the part that i dont know how to do is join the two lists of primary keys
together, then join that new list ... more >>
Duplicates in large table
Posted by Matt Carr at 4/12/2004 8:36:03 AM
I have a table with 110 million rows and about 90% of it is duplicates. I've created a cursor that goes through the table and deletes all the duplicates leaving one record remaining using ROWCOUNT. I've created a non-clustered index on the three columns used to find the duplication
This is runni... more >>
Getting top row(s) based on date
Posted by Rob Meade at 4/12/2004 7:58:18 AM
Hi all,
I have a view which contains details of news items posted, I would very much
like to be able to list the newest post for each of the various news pages
in a summary, so for example if I have 5 different news pages, it would
retrieve the most recent post (based on the date posted) from ... more >>
Select/print a row
Posted by Christopher Benson-Manica at 4/12/2004 7:43:13 AM
How can I print the results of a SELECT statement? I know this is
probably simple, but I haven't found anything that tells me how to do
it...
--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org | don't, I need to know. Flames welcome.... more >>
Problem in Executing Query
Posted by Kishor at 4/12/2004 4:46:04 AM
Hi all
I am having a small funny problem, situation here is I am issuing queries like this
I am pasting code here
Use Northwin
select * from dbo.Categories where CategoryID in(1,2,3,4
This Query works fine but when I am executing this query I am getting following error
Declare @Str Varc... more >>
Nested Cursor possible in Stored Procedure? Please see my example. Thanks.
Posted by Andreas Klemt at 4/12/2004 3:58:06 AM
Hello
is this possible to have two WHILE @@FETCH_STATUS = 0?
If not I would like to now why not and is there a better way?
....
DECLARE cur CURSOR FOR
SELECT person FROM table
OPEN cur
FETCH NEXT FROM cur INTO @person
WHILE @@FETCH_STATUS = 0
BEGIN
DECLARE cur2 CURSOR FOR
... more >>
Is it possible to have 2x Cursors and 2x @@FETCH_STATUS = 0 in one Stored Procedure?
Posted by Andreas Klemt at 4/12/2004 3:49:44 AM
Hello,
I have a Stored Procedure and I want to use
2x Cursors with different Name and I have 2x
WHILE @@FETCH_STATUS = 0
Is this ok or is there a better solution. I need to use at least
two Cursors in my Stored Procedure.
Thanks for any help in advance!!
Andreas
... more >>
Export to CSV from a Stored Procedure
Posted by Robert Robichaud at 4/12/2004 1:01:04 AM
Can someone provide me with a sample or point me in the right direction?
Wish to export the contents of a temporary table to a .CSV file. The .CSV
file will be used in another application.
Thanking you in advance.
... more >>
|