all groups > sql server programming > august 2003 > threads for wednesday august 27
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
Updating smalldatetime field with current date and time?
Posted by Robert Johnson at 8/27/2003 11:49:27 PM
How can I update a smalldatetime field with the current date and time? I
have tried many different ways using the Convert function, but I just can't
seem to figure it out. I've been working on this problem most of the
evening. I would really appreciate any help you can give me.
Thanks in advan... more >>
Saving and retrieving speech data ...
Posted by MOINAK BHATTACHARYA at 8/27/2003 11:20:48 PM
Hi,
How do I save speech data (binary) into Sql Server table
using ADO.NET?
Thanks... more >>
Formatted SQL Server error in stored proc
Posted by Soloist at 8/27/2003 10:55:00 PM
According to SQL BOL, errors raised by SQL Server have
several attributes:
- Error number
- Message string
- Severity
- State
- Procedure name
- Line number
In case of an error, the client can retrieve Error Number
and Message String if connected through OLEDB, ADO, ODBC,
DB Library, ... more >>
Using Calculated Fields
Posted by Roy Goldhammer at 8/27/2003 8:52:00 PM
Hello there
I've see that i can create a calculated field
This thing look very nice
But is that meens that the access to tables and pooling, updating and
inserting data will be slower ?
any help would be useful
... more >>
distinct
Posted by Chris Dangerfield at 8/27/2003 6:09:12 PM
How can I bring back a distinct list, but still have both columns returned ?
distinct to be against stock_code
cheers
SELECT pol.stock_code, po.date_expected
FROM dbo.tbl_purchase_order_lines pol INNER JOIN
dbo.tbl_purchase_orders po ON pol.purchase_orde... more >>
comparing tables
Posted by tt at 8/27/2003 5:59:38 PM
Hello
I'm trying to get do a select on the following table:
Vend Vendcontrdet Vencontract
Vendtype Customtable(list of standard
contracts-(HVAC,carpet,etc)
----- ------------- ------------- ... more >>
Dumb newbie question
Posted by G at 8/27/2003 5:29:44 PM
how do I get select 11/5 to return 2.2. Currently it is
returning the whole number and not a decimal remainder.
It should return an answer of 2.2
Thanks in advance...
... more >>
Changing database context within a stored procedure
Posted by Dennis S. at 8/27/2003 5:23:04 PM
I'm creating an application that allows individual users to set up databases
on a SQL Server server. All the databases have the same structure --
they're separated from one another simple for security reasons. And I want
to put all the stored procedures for accessing these databases into a sin... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Is it better to drop temporary table at the end of a stored procedure?
Posted by Eduardo Barcante at 8/27/2003 5:21:04 PM
The stored procedure perform is better if I don't drop the
temporary tables inside my code? Why?
Thanks,
Eduardo Barcante... more >>
Problem with Runing DTS within Stored Procedure
Posted by Patrick at 8/27/2003 5:12:50 PM
Hi Freinds,
SQL 2000
I have a stored procedure which running a dts package:
Create procedure proc_run_dts
as
exec master..xp_cmdshell 'dtsrun /Smyserver /Usa /Ppassword
/NexporttimecardXDEV'
Go
DTS is a package for transfering files from SQL to a linked ORACLE server.
when I am runn... more >>
Kill process problem (Error 6106)???.
Posted by Inzy 2000 at 8/27/2003 4:43:24 PM
Hi!
I've a job that updates a database every day. The job has few steps:
kill processes (spids), truncate tables, dropping indexes, loading data
into the tables and etc. It it failing at the first step (i.e. kill
processes) with the message "Process ID 29 is not an active process ID.
[SQLSTAT... more >>
Query two 'servers'
Posted by Robert A. DiFrancesco at 8/27/2003 3:53:09 PM
What statements (or setup) are necessary to execute a query which accesses
databases on two different servers?
thanks
... more >>
Inserting Unicode Data using Query Analyzer
Posted by Rageesh at 8/27/2003 2:50:21 PM
I tried running the following Code in SQL query analyzer.
The Table #Works contains a unicode column AlterNateName. The script given
below inserts Unicode data into the AlterNateName Column , then it tries to
fetch the data that is entered into the table.
------------SQL SCRIPT -------------
... more >>
Triggers seem to cause PK violations/changed records in Access
Posted by Scott K. at 8/27/2003 2:32:23 PM
Hi,
Please help, this may not be the right forum but the
Access folks aren't helping at all.
Access 2002 ADP front
SQL Server 2002 back end
Access has been giving me the "Another user changed...."
message, then a PK violation. When I insert data through
EM, I don't get any errors at ... more >>
run_time field in sysjobshistory table
Posted by Brian Lundin at 8/27/2003 2:27:44 PM
1. What format is this field in?
2. How can I convert it to a standard date string?
Thanks.... more >>
INSTEAD OF UPDATE
Posted by d.flakowski NO[at]SPAM megalith-software.de at 8/27/2003 2:01:03 PM
Hello,
I'm using SQL-Server2000 and want to use the "INSTEAD OF
UPDATE"-trigger to audit the changes done on a table. The auditing to
another table is no problem at all, but how can I update the record in
the original table as the real UPDATE is replaced by the execution of
the trigger.
As ... more >>
unique key / check constraits
Posted by Chris Dangerfield at 8/27/2003 1:38:15 PM
I have a table which has 2 fields of relevance to this question.
stock_code varchar50
question int
I have the table indexed in order, stockcode, then question.
I am happy for the table to have duplicate stock_code
I am happy for the table to have duplicate question
I ... more >>
Get records from different server
Posted by Balaji at 8/27/2003 1:31:11 PM
hi
Is it possible to get record from different SQL Server which is in different
machine from tsql query statement.
Thanks
Balaji
... more >>
Sub select question
Posted by Jim Bancroft at 8/27/2003 1:13:22 PM
Hi everyone,
Is it possible to do this?
I have a query which returns X records. I'd like to add to this query and
return Y additional records.
The kicker is, those Y records depend on the original X records. For every
record in X, I want to search for and return those records with the s... more >>
SELECT statement
Posted by Sharon Walker at 8/27/2003 12:37:49 PM
I have the following table --
SELECT * from Invoices
go
Amt InvDate
----- -------------
100 Jan 01 2003
100 Jan 04 2003
100 Feb 25 2003
100 Mar 23 2003
I want to select the sum(Amt) but only for distinct
months. So, if Jan has 2 invoices... more >>
enforcing lower case entries in the table
Posted by helena at 8/27/2003 12:21:52 PM
I need to make sure that in a specific field in a table
all the entries are converted to lower case. Can I enforce
that in the table or the only way is to convert the data
in the update and insert script? thank you... more >>
sysmessages table
Posted by Andrew Retzlaff at 8/27/2003 11:55:58 AM
Hello,
I just start to use the @@error command, and in the description of it says
that I have a table call sysmessages, but is not.
where is it?
Regards
Andrew Retzlaff
... more >>
1FK (1 table) referring to 2 PKs (2 tables)
Posted by helena at 8/27/2003 11:45:57 AM
--How do I load this table when i have the fk is referring
to 2 tables?
insert into table_to_load (
col1_pk
col2_fk (this fk refers to 2 tables: Table A and Table B)
col3
col4)
select
s.colA_pk
s.colB
s.colC
s.colD
from table_source s
--here is the part I don't know:
if s.colD=X ... more >>
GROUP BY and ORDER BY problem...
Posted by Steve Thompson at 8/27/2003 11:39:38 AM
Hello all,
First of all, I apologize for such a long post. Here's my problem. I have
this stored procedure that contains the following...
....
BEGIN
INSERT INTO #BCDetailTemp SELECT S.SetCode, SC.Description, Rollup1,
Rollup2, BuildCode, SUM(S.AUVCalcYr01) AS AUVCalcYr01, SUM(S.AUVC... more >>
Using SQLDMO to script UDF's
Posted by Kiril at 8/27/2003 11:35:44 AM
I'm using SQLDMO in an application to script db objects.
Although the statement (in VB)
For Each dmoUDF In dmoDB.UserDefinedFunctions
looks good and the keywords 'capitalize' as you would
expect, when run, the compile error 'Method or data member
not found' pops up and the section 'Use... more >>
Join and Where clause Question
Posted by William Reyes at 8/27/2003 11:18:02 AM
I have a query that has many table joins. Most are outer.
Table1 has a one to many relationship with Table2.
I am saying.
--------------------------------------------------------------------
Select Table1.tb1_IDField, Table1.Fld2 From Table1
Left Join Table2 on Table1.tb1_IDField = Table2... more >>
Simple challenge
Posted by Chuck Ros at 8/27/2003 11:15:38 AM
Does anyone know how to do this, that is if it can be done...
I want a select statement that returns a derived list of dates in a
recordset. For example:
SELECT TheDate FROM ('8/1/2003' TO '8/5/2003')
TheDate
--------
8/1/2003
8/2/2003
8/3/2003
8/4/2003
8/5/2003
Seems like a si... more >>
Sub select question
Posted by Jim Bancroft at 8/27/2003 11:01:36 AM
Hi everyone,
Is it possible to do this?
I have a query which returns X records. I'd like to add to this query and
return Y additional records.
The kicker is, those Y records depend on the original X records. For every
record in X, I want to search for and return those records with the s... more >>
need a query to return records which don't exist
Posted by maxhodges NO[at]SPAM hotmail.com at 8/27/2003 10:44:59 AM
Given a date range (@StartDate, @EndDate) I need to return a list
dates for which records don't exist. for example, given this date
range:
@StartDate = '8/1/2003'
@endDate = '8/7/2003'
and these records
ID;LogDate
1;'8/2/2003'
2;'8/4/2003'
3;'8/6/2003'
4;'8/7/2003'
5;'8/8/2003'
I wan... more >>
UPDATE and INNER JOIN
Posted by James Napolitano at 8/27/2003 10:32:50 AM
How would I contruct an UPDATE and INNER JOIN. ... more >>
Creating table having structure same as that of existing table
Posted by Kuntal Kumar Sasan at 8/27/2003 10:28:39 AM
Hi,
How can I create a table (need to create temporary table) having
structure same as that of an existing table. Only need is to create table,
no need of copying data along with it.
Thanx in advance,
K.K.
... more >>
Storing pictures
Posted by Lenny Kiz at 8/27/2003 10:16:09 AM
Hi All!
I need some ideas how to store pictures (binary data, large files) to SQL
Server. I did this using VFP and now need to do same thing with different
backend. Where should I look fo some samples?
Thanks
Lenny
... more >>
vertical join?
Posted by brian richards at 8/27/2003 9:41:25 AM
I'm trying figure out how to "stack" similar columns from two different
tables. In this particular case I'm trying to grab distinct addresses from
multiple tables to create a view of all the addresses from the other tables.
So if I have
Table A
Address city state... more >>
The query processor encountered an unexpected error during execution
Posted by tmeier NO[at]SPAM aci.com at 8/27/2003 9:13:47 AM
Greetings,
I'm hoping someone can shed some light on any mistakes I may be
making...
When I run a stored procedure I've written, I receive the following
error message:
Server: Msg 8630, Level 16, State 77, Line 1
Internal Query Processor Error: The query processor encountered an
unexpecte... more >>
Sharing encrypted stored procs???
Posted by fardad at 8/27/2003 8:11:56 AM
I know one can create an encrypted stored proc and after
creation even the owner wouldnt be able to see the
source!!! Can such a proc be shared with other people in
its encrypted form?
I guess it would be like giving someone an *.exe?
Thanks
Fardad
@
acm.
org... more >>
Access upsize to SQL issues
Posted by Andrew Holems at 8/27/2003 7:47:45 AM
Hello , a bit of a problem. I upsized an Access dB to
SQL 2000 and everything seemed to convert fine. My
problem is the MACROS that were functional in Access are
now broken. The macros were used to match fields in the
tables to those in form controls. I would open up a
primary form and th... more >>
PLEASE HELP
Posted by Roberto Carrasco at 8/27/2003 7:23:12 AM
Hi,
I'm starting to use Microsoft Sql Server 2000 and I need
to create a Stored Procedure that reads a table that has
some columns that are varchar and contains information
like '12345567 KB' and '1234 KB', I only need the numbers
so i want to remove the ' kb', and convert the column to
... more >>
Source control on stored procedures?
Posted by James Bender at 8/27/2003 6:27:31 AM
Hi,
I am developing a commercial product which uses many
stored procedures. Can somebody give me a good
recommendation of a way to do source control and
versioning of these? Currently we are not using any
database development or modeling tools, and we are using
Visual Sorce Safe for ver... more >>
Alter View
Posted by Alan Ayers at 8/27/2003 6:13:05 AM
I want to be able to alter a view from a stored procedure
that would use a variable to include an orderby clause to
the existing view.
The data and programs where in MS Access 2000 and I could
use Querydef to alter the query no problem. I am now
faced with converting the data to SQL Se... more >>
Help on sp_executesql and string formation
Posted by John Rajendran at 8/27/2003 6:03:20 AM
Hi there,
We are having an issue with strings and sp_executesql in
a stored procedure. we have declared the variable for the
STR1 as nvarchar(4000) and trying to add (concatenate
string) to STR1. But STR1 is getting truncated in 255
character length only. Is there any work around to get
a... more >>
Applying Service Pack 3a
Posted by Venkat Venkataramanan at 8/27/2003 5:50:16 AM
Hello:
I was trying to apply service pack 3a. When I ran the
setuup, it complained that "A previous installation
created pending file operations. You must restart the
computer before running setup."
Which I did and I got the same error message.
When I ran "Select @@Version", I got
... more >>
SQL Jobs failing with Token Error but code works fine in Query Analyser
Posted by Brett Levin at 8/27/2003 2:13:21 AM
Hi,
I am experiencing the strangest error. Every job is failing on the SQL
Server Agent engine but the sprocs that the jobs execute work fine from
Query Analyser. The jobs seem to hang and then error after a few minutes
with the following error code:
Unknown token received from SQL Serve... more >>
|