all groups > sql server programming > december 2004 > threads for friday december 3
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
SELECTing constant range
Posted by Stephen Howe at 12/3/2004 8:30:49 PM
If I do
SELECT 2
I get back
2
How do select, say 2 to 10 ?
Is it possible?
thanks
Stephen Howe
... more >>
avg and null values
Posted by Hassan at 12/3/2004 8:04:16 PM
When you do average of a column that includes null values, does it ignore
the rows with null or does it not ? If it does not, how can we include it
...i mean if we have 5 rows with one null value, how can we avg with 4 and
also average with 5.. Thanks
... more >>
Invalid object name
Posted by Ron Sellers at 12/3/2004 7:03:01 PM
I have a stored procedure that creates several temporary tables. When I call
this procedure from the Query Analyzer, it works just fine.
When I call the stored procedure through the DTS or from a query from the
reporting services, I get the error: Invalid object name '#NSLP'
#NSLP is the ... more >>
COALESCE(DateCreated,GETDATE())
Posted by John A Grandy at 12/3/2004 6:54:03 PM
is this legal t-sql ?
COALESCE(DateCreated,GETDATE())
DateCreated is a non-nullable DateTime column
... more >>
SQL Server Performance on XP
Posted by David Mohandas at 12/3/2004 6:34:15 PM
Our application on Windows XP SP1 with SQL Server 2000 SP3a takes 3.5hours
to complete. If i change the SQL Server memory option from "Dynamically
configure SQL Server Memory" to "Use a fixed memory size" the same process
completes in less than an hour. This machine has 1GB RAM.
The same p... more >>
Triggers - How can I get a field value?
Posted by BonGee at 12/3/2004 6:18:02 PM
I have Three Triggers for Ins, Upd, Del, How can I fetch Field values from
Trigger table ? What I have to do is to Insert Inserted or Updated or
Deleted row's Key value to another Table..
Thanks.
=========
CREATE TRIGGER INSERTTRIGGER ON [dbo].[TBL_PRO]
FOR INSERT
AS
INSERT INTO TBL_... more >>
trigger specs
Posted by ChrisR at 12/3/2004 4:50:05 PM
Im trying to design a trigger that will:
1. Allow people to Update a column in our TsysQueue.ResponseDate column from
a NULL value to a real value.
2. Allow people to Update a column in our TsysQueue.ResponseDate column from
a real value to a NULL value but only 1 row at a time.
--would be ... more >>
How to read the value of timestamp column
Posted by Kina at 12/3/2004 4:49:02 PM
Hi,
I have data in a dataset.
One of the column in the table is of type Timestamp.
How do i get the actual value of it.
when i assign value like string x = row["rowtimestamp"];
it gives value as "System.Byte[]"
it gives the same value if string x = row["rowtimestamp"].ToString();
Is there a... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Read/Export Binary Data
Posted by Bill Nguyen at 12/3/2004 4:34:39 PM
I have the need to read/export Binary data (Text BOG).
Using SELECT @@TEXTSIZE, I found the size is 64512.
What do I need to do next?
Thanks
Bill
... more >>
Does the SQL Server 2005 ADO/OLEDB provider support adSeek and adIndex?
Posted by Greg Doherty at 12/3/2004 4:28:58 PM
I know the SQL Server 2000 didn't support adSeek and adIndex, but I was
wondering, is it possible to select an Index in SQL Server 2005 and Seek for
specific key values?
e.g.
....
_RecordsetPtr rs("ADODB.Recordset");
rs->Open("Facil", vtConnectionString, adOpenDynamic, adLockOptimistic,
a... more >>
DATEDIFF with weeks always starts on a Sunday?
Posted by Sarah Clough at 12/3/2004 4:09:51 PM
I have the following statement:
SET DATEFIRST 1;
SELECT DATEDIFF(week,'20041202','20041205')
It returns 1, but I expected it to return 0. I have set the week to start
on a Monday, which means that the two dates (2nd Dec 2004 and 5th Dec 2004)
should be on the same week, therefore returni... more >>
Any ideas for reusing long table variable definitions?
Posted by glevik NO[at]SPAM gmail.com at 12/3/2004 4:01:25 PM
Hello,
In MSSQL 2000:
For my project, it would be great to have one centralized function or
procedure return a result of a huge join, and have other
functions/procedures process this result set further - summarize it,
filter it, etc.
Unfortunately this result set contains more than a 100... more >>
How can I Pass an array into a Stored Procedure from Visual Basic?
Posted by Ian at 12/3/2004 3:32:53 PM
Hi
How can I Pass an array into a MS SQL Server Stored Procedure from Visual
Basic?
Thanks
Ian
... more >>
problem with procedure :(
Posted by iain via SQLMonster.com at 12/3/2004 3:20:29 PM
i'm getting this back from query analyzer:
Server: Msg 156, Level 15, State 1, Procedure Totalnews, Line 15
Incorrect syntax near the keyword 'SET'.
Server: Msg 156, Level 15, State 1, Procedure Totalnews, Line 37
Incorrect syntax near the keyword 'BEGIN'.
for the following procedure:
CREA... more >>
BULK INSERT by non Builk Admin
Posted by Eric at 12/3/2004 3:05:21 PM
Hello,
I need to allow a user to execute a BULK INSERT command, but I can not add
them to the Bulk Admin server role.
The import table determined at run-time.
So, I have a procedure like so:
create procedure dbo.importfile @file varchar(255), @table varchar(100) as
EXEC "BULK INSERT ... more >>
Japanese to Unicode characters
Posted by Vital at 12/3/2004 3:01:30 PM
I have to migrate a Japanese application from Oracle-Rdb to SQL2000
database. I use an Oracle driver to get the japanese strings. To be sure I
read correctly the values from the source database, I display the strings in
a VB textbox with MS Mincho (Japanese script) font and this is fine.
Now I... more >>
Best practice kinda question
Posted by Michael C at 12/3/2004 2:44:05 PM
Say I've got a database that stores the standard Customer, Invoice and
InvoiceLineItem info in tables something like this (this isn't what it
stores but getting into the specific details of my database would just
confuse things)
CREATE TABLE Customer(ID INT, Name VARCHAR(60))
CREATE TABLE ... more >>
Basic question about Updating
Posted by JasonNW NO[at]SPAM i-55.com at 12/3/2004 2:41:24 PM
ok...i am writing a program that makes a report...and then after that
report is ran the user is asked if it should be accepted. If the user
chooses to accept then a table is suppose to be updated. What would
be the most appropriate method for updating the table through the
program...
what i... more >>
Backup Database
Posted by Preeta at 12/3/2004 2:35:07 PM
If i do a backup database,will the stored procedures also get backed up?... more >>
how to know if a trigger is firing ?
Posted by John A Grandy at 12/3/2004 2:32:03 PM
my trigger *should* create a row in a secondary table on any update of
column(s) in a primary table ...
however, no rows show up in the secondary table ...
what is the best method to ascertain whether or not my trigger in fact is
firing when i update the column in the primary table ?
... more >>
Apply script to multiple databases.
Posted by David D Webb at 12/3/2004 2:01:58 PM
Hi,
I have about 50 databases on a single server. They are all identical in
structure. I have a long SQL script that contains DML that I need to apply
to each database. I am looking for a simpler way to apply it to all
databases, since I do this about weekly. I need to see the results o... more >>
Is there a tool/util/script to do syntax check of all stored procedures?
Posted by Bret Pehrson at 12/3/2004 1:39:25 PM
Is there a tool/utility/script that will do a syntax check of all stored
procedures in a database?
After doing some table maintenance, I occasionally have the need to verify the
associated stored procedures, and have resorted to the (very manual) process of
opening a stored procedure and press... more >>
SQL Server UDT Performance Hit
Posted by dwilliamson NO[at]SPAM ivsi.com at 12/3/2004 1:26:08 PM
Has anyone measured the performance hit that a user-defined data type
imposes as compared with a native data type?
Specifically a Numeric(38,0) versus a UDT of a Numeric(38,0) but any
comparisons are welcome information.... more >>
newbie int date/time conversion
Posted by CGW at 12/3/2004 1:03:03 PM
I'm working with the integer values for next run date and time in
sysjobschedules from msdb. Is there some easy way to convert those values to
a datetime?
--
Thanks,
CGW... more >>
Newbie question with stored procedures
Posted by Coban at 12/3/2004 12:39:09 PM
Thank you in advance for any and all help/advice. How do I execute/activate
a stored procedure from an Access 2000 front end?
Thank you very much, Ari
... more >>
UniqueIdentifier, offline data: clustering key choice? ... (indexing+performance question)
Posted by Joergen Bech at 12/3/2004 12:28:20 PM
Scenario:
Central SQL Server database with multiple tables holding millions
of rows each.
Multiple clients, each having an arbitrary subset (say, 10%) of
the server data each in a local MSDE database for offline use.
The clients should be able to make modifications to the data and
sync... more >>
Need help to modify my query
Posted by mitra at 12/3/2004 12:23:01 PM
Hi,
After learning how to do the query statement shown below, of course with
help from this newsgroup, I now need to modify the statement to return all
the email addresses once as well. I tried but I could not get it to work.
Query below returns results like:
=============================... more >>
Only constants, expressions, or variables allowed here. Column names are not permitted.
Posted by John A Grandy at 12/3/2004 12:13:38 PM
I have a change-history table that duplicates all the columns in a primary
table. I have an AFTER UPDATE trigger that records before/after snapshots
of the data-rows in the primary table.
The primary table contains an Identity column. In the change-history table,
I declare this column with t... more >>
help needed
Posted by Da Vincy at 12/3/2004 11:54:04 AM
How can i create a Store Procedure in Run Time with VB.NET?
... more >>
Key
Posted by mwm at 12/3/2004 11:41:12 AM
How do I set the primary key on a field in a table that is in ms sql
thanks... more >>
Newbie Questions
Posted by Ed_P. at 12/3/2004 11:39:11 AM
Hello,
I am currently learning to use SQL 2000 and like it's many features it has,
however I have two questions to ask:
1. Can any one provide me with some information as to what types I should
use for my data (names, addresses, numbers), maybe there is web page out
there that can show m... more >>
Trigger Question
Posted by vul at 12/3/2004 11:38:23 AM
I have a trigger:
CREATE TRIGGER Ordr_Delete ON [dbo].[Ordr]
FOR DELETE
AS
DECLARE @OrderID int
SELECT @OrderID=OrderID FROM deleted
DELETE FROM OrderDetail WHERE OrderDetail.OrderID=@OrderID
If I delete a record from table Ordr directly in EM or run delete statement
from VB6 application... more >>
Trees?
Posted by Justin Drennan at 12/3/2004 11:29:49 AM
workign with hierarchies. Here's the table.
CREATE TABLE [dbo].[Tree] (
[ID] [int] IDENTITY (1, 1) NOT NULL ,
[ParentID] [int] NULL ,
[Lineage] [varchar] (50) NULL ,
[Name] [varchar] (50) NOT NULL
) ON [PRIMARY]
GO
Here's som... more >>
Update text filed error
Posted by Patrick at 12/3/2004 11:07:23 AM
Hi Freinds,
SQL 2000
I am trying to Update text filed and getting an error
create table tbl_a (col_a text, col_b nvarchar(10), col_c int)
go
update tbl_a
set col_a = (select col_a from tbl_a where col_b = '989' and col_c = 9)
where col_b = '991'
go
error :
Server: Msg 279, Level 16... more >>
INSERT INTO SELECT FROM Problem
Posted by msnodgrass NO[at]SPAM cciservices.com at 12/3/2004 10:44:53 AM
I am trying to build an insert statement that will take data from one
table and dump it into another. I am all set except for one field
called trans_id. It is an integer field that does not allow nulls, but
is not an identity column. Primary key non-clustered for this field is
what I get when I ... more >>
Field Exists
Posted by Justin Drennan at 12/3/2004 10:34:48 AM
How would you check if a field in a table exists?
... more >>
deadlock question
Posted by ChrisR at 12/3/2004 10:24:11 AM
I was told that unless Profiler is running when a deadlock occurs, you cant
tell which 2 procs are involved. What Im confused about though is that Im
looking through my TLog and I see about 25 messages that I beleive (could be
wrong on this one) are related to the Deadlock I just had. 2 of them g... more >>
Update text filed from QA
Posted by Patrick at 12/3/2004 10:17:01 AM
Hi Freinds,
SQL2000
I know this is a redundent question, but I was not able to find my answer.
How can I update a text or ntext field from query analyser. I have a text
about 3000 chr that needs to be update on a field.
Thanks in advance,
Pat
... more >>
creating a DTS package
Posted by shank at 12/3/2004 9:34:21 AM
I created a DTS package to backup my online SQL objects down to my local
SQL. There's one table [ORD] online that has an added user "bob". I am the
owner. The package downloads a few objects properly, then stops with the
error "no such login bob". I assume the DTS got to table [ORD] and stoppe... more >>
Newbie Server Load Question
Posted by CGW at 12/3/2004 8:25:07 AM
I'm still new to SQL programming and have been tasked with writing a
procedure that tests and forecasts server load for the purpose of running
procedures who's forecasted run time would fit in available chunks of server
time/resources.
Can anyone point me to an example of a procedure that d... more >>
Optimizing query
Posted by Sandy at 12/3/2004 8:09:08 AM
How can I optimize this query.Can anybody help.can anybody plzzz convert
subquery into left join.
select sAccountManager AS Engineer, cFullName, cCompany.cKey,
(SELECT Max(sBilling.sPO) FROM sBilling with (NoLock)
WHERE sBilling.sKeyCompany=cCompany.cKey
AND sBilling.sModule IN(''SourceHR... more >>
Search text field for all 1's
Posted by keaneconsultant NO[at]SPAM hotmail.com at 12/3/2004 8:01:24 AM
I have a field which is varchar. I need to find the values in the
field that are all '1's. Meaning if the value is '1' or '111111' or
'111111111111111111'
I need to select the value. I haven't been able to track down any
suggestions via the groups so thought I would post to the experts.
Tha... more >>
How to know when a stored procedure was last changed ?
Posted by Toto at 12/3/2004 7:59:09 AM
Hi. Sorry for the newbie's question.
I have a SQL 7 database, with some stored procedures coded in it.
I'm looking at them with Enterprise Manager and only have the "Creation
Date" for each one.
How can I know when any of these stored procedures was last modified ?
Thanks a lot in adva... more >>
update multiple columns
Posted by Jason at 12/3/2004 7:43:32 AM
Hi,
Somebody knows a way to update multiple columns without typing each column?
I'm cleaning up a database where i have one table that shouldn't have double
records. The thing is, that those records should be merged into 1 record.
I would like to do something where the value is null in one... more >>
xp_cmdshell -- I must be missing something obvious
Posted by AW at 12/3/2004 7:05:05 AM
I have a trigger that calls a console application with the below code. When
I hard code the parameter to 99999.0, it works perfectly. When I try to use
a variable coming from the INSERTED row, it fails and gives me an error
(below). I know the @AN8 variable is correct because I have passed ... more >>
Case Change Query
Posted by jpferr119 at 12/3/2004 6:49:06 AM
Would like to change an entire colum of alphanumeric charecter to all upper
case. Currently it is mixed case. Would appreciate the assistance. Thanks.... more >>
From weekday calculate next date
Posted by AshleyT at 12/3/2004 6:49:03 AM
In my sql query I am finding orders that are still due, and on what weekday
they are due (1,2,3,4,5,6,7). From that weekday number I would like to show
the what the due date will be. So for weekday of 2, when the query is ran
today (12/3/2004) the due date is 12/6/2004 (monday, 2).
Any id... more >>
Returning System Date (Without the time)
Posted by Marek at 12/3/2004 6:07:04 AM
Hi,
Am using the GetDate() function in a sproc I have created. Works fine.
But, I just want to record the current date, not the time as well. Any
ideas??
--
Many thanks in advance for any assistance... more >>
How to get table statistic
Posted by Solli Moreira Honorio at 12/3/2004 5:39:13 AM
Hi,
I'd like now if can I get the statistic information like last access, delete
and update, or how many accesses, deletes and updates on a table.
Thanks,
Solli... more >>
Capturing All tables in a SQL server Instance.
Posted by Eder F. Dias at 12/3/2004 5:09:02 AM
I need capture all tables or objects of all databases in SQL Server instance.
How do this?
I can do this with any View in master database?
thanks
Eder F. Dias... more >>
identitycolumn as pk
Posted by Ivo Grootjes at 12/3/2004 5:03:02 AM
Hi NG,
This would be my first post on a newsgroup so bare with me :)
I'm working on an existing application which uses a database with tables
which have identity columns as primarykeys. The webapplication needs new
functionality which requires 4 tables to be copied from one database to
a... more >>
Order of clustered index
Posted by Mal at 12/3/2004 4:15:03 AM
Hi
If you create a unique clusterd index , your table is recreated and the
data is ordered according to you index.
I've got a question about this,
Let say I applied the index and my ID col (unique clustered index) looks
like this now
1
2
3
4
5
So if I query the table it goes f... more >>
Date query
Posted by Stuart at 12/3/2004 1:39:02 AM
Hello there
This could be beyond the realms of a query - I have not been able to find a
way to do this and thought I would ask...
I have an .asp application that uses a lot of stored procedures in SQL
I have a new requirement whereby I want to retrieve records based upon
status of money... more >>
Looking for good T-SQL book
Posted by Mark Huebner at 12/3/2004 1:20:57 AM
I'm looking for a well organized book on Transact SQL and SQL Server 2000
Programming. I'm especially looking for one that gives a nice tabular,
short summary of all the commands, functions, variables, etc. organized into
categories like data types, operators, Data Definition Language, Data
Man... more >>
|