all groups > sql server programming > february 2004 > threads for wednesday february 11
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
Regular maintenance
Posted by Lasse at 2/11/2004 10:21:44 PM
Hi all,
Are there any regular maintenance that should be done on a database on a
regular basis, someone asked me if I "re-indexed" the database regulary.
Thanks,
Lasse
Using MS SQL 2000
... more >>
CLOSE connection
Posted by EMW at 2/11/2004 10:08:42 PM
When I use con.Close() where con is my connection to the sql server, it
closes the connection, but how come I cannot drop the database?
It keeps telling me that the database is still in use, while it isn't.
rg,
Eric
... more >>
IDC Linux study
Posted by RayMetz100 at 2/11/2004 9:51:05 PM
I'm a SQL Server DBA and more skilled with SQL Server than any other database platform. I wish Microsoft all the best with their product, but I feel that the IDC study they have posted at http://www.microsoft.com/sql/evaluation/compare/Linuxtco.asp is a joke. First, they don't name the Linux RDBMS... more >>
HOW TO ....
Posted by RENWEI at 2/11/2004 8:10:14 PM
MY DATA
NO QTY
5 25
7 22
3 17
8 15
1 13
6 9
2 8
4 6
OUTPUT ....
NO QTY GROUP
5 25 A
7 22 B
3 17 A
8 15 B
1 13 B
6 9 A
... more >>
java date format
Posted by nelsonchang at 2/11/2004 8:01:05 PM
Hi,
I wrote a java program to get a date in String format and would like to insert it into a date datatype in SQL server. Have someone know if there is a SQL server's function to convert the string into date?
sql = "insert into xxx values ('" + dateString + "' )";
sqlSession.execut... more >>
Going haywire with transactions and triggers
Posted by JollyK at 2/11/2004 7:26:18 PM
Hello all...
I am really confused. First of all I am inside an active transaction in my
stored procedure. The value of @@trancount is 1. Now I am updating a record
in a table that has an update trigger. So when I am entering the trigger,
internally another transaction is created. Now if the trig... more >>
HOW TO...
Posted by RENWEI at 2/11/2004 7:05:12 PM
MY DATA
EMPNO QTY
2 100
7 99
3 90
5 90
4 85
1 80
8 75
6 50
HOW TO OUTPUT MIN TWO GROUP BY SQL PROCEDURE ...
THANKS!!
... more >>
Bad performance in wireless Network (802.11b)
Posted by Al at 2/11/2004 6:41:06 PM
Hi,
Although my application perform nicely in wired network, the performance in wireless network is very bad (I have tested in 802.11b). Would appreciate if anyone could suggest how I can improve the performance in the wireless network. Any one has tried running application in 802.11b vs 802.11g? ... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
how can I debug triggers?
Posted by haode at 2/11/2004 6:27:43 PM
I want to trace some values in triggers.
... more >>
Retrieving Maximum Acceptable Numeric Values of data types ?
Posted by Luqman at 2/11/2004 4:50:36 PM
Is there any system stored procedure in sql server 2000 to get maximum
acceptable numeric values of numeric data types something like this.
Data Type Maximum Acceptable Value
Bigint 9,223,372,036,854,775,808
Int 2,147,483,648
Tinyint 255
I tried using sp_d... more >>
scalar user-defined function without input params???
Posted by Daniel Walzenbach at 2/11/2004 4:36:51 PM
Hello,
Does anybody know if it is possible to create a scalar user-defined function
without input params?
Thank you!
Daniel Walzenbach
... more >>
for update cursor declaration error
Posted by guest at 2/11/2004 4:35:37 PM
The simple script got errors 16957 at the declare cursor
part while execution. I tried all SQL-92 and Transact-SQL
Extended Syntax but all in vain. Removing the "FOR UPDATE
OF col2" will cause errors on "UPDATE tbl SET col2 =
@SeqNo WHERE CURRENT OF MerCursor".
Thanks in advance.
==>
... more >>
Link server Insert with Identity
Posted by Chedva at 2/11/2004 4:21:06 PM
How can I insert a record to a far linkserver (sql) to a table with identity
coloum. when I try to run set identity_insert on the far db I get an error
"The object name 'SERV.db_V1.DBO.' contains more than the maximum number of
prefixes. The maximum is 2."
I tried with the OPENQUERY and faild.... more >>
Simple T-SQL Script that compiles but won't execute
Posted by sieloff NO[at]SPAM artronix-solutions.com at 2/11/2004 4:06:47 PM
This simple script will compile fine but not execute the alter table
statement. What is wrong with this?
IF (SELECT [Version] FROM [Preferences]) < '5.10a'
BEGIN
/* Invoice table */
ALTER TABLE dbo.Invoice ADD
ShipperPalletsIn int NULL,
ShipperPalletsOut int NULL,
ShipperPalletsRec b... more >>
Identity Column
Posted by Toeen at 2/11/2004 4:00:36 PM
I have an identity column in a table.Now I want to remove the Idenity
property of the column and make it simple Numeric column through T-SQL
Script.
Could anybode tell How?
Thanking You
Toeen
... more >>
Listing indexes and index columns in SQL
Posted by Henrik Skak Pedersen at 2/11/2004 3:59:47 PM
Hi,
How do I list all indexes with type 'Index' and index columns on a specific
table.
I have tried something like:
SELECT * from SysIndexes where Id = object_id('CONTACTTYPE')
for the indexes, but I also receive 'Unique' and 'Primary key'. I would like
only to receive indexes with type 'I... more >>
USE statement in Stored proc.
Posted by mangaraju NO[at]SPAM yahoo.com at 2/11/2004 3:51:17 PM
How do I 'set default' to a different database, since we cannot use
USE statement in an SP ? Is there any system stored procedure ?... more >>
When are stored procs not the best solution?
Posted by Jason Evans at 2/11/2004 3:42:05 PM
Hi there.
I was disucssing with a colleague of mine about the usage of stored
procs vs dynamic SQL statements. His argument was that setting up a
stored procedure call in one of our .NET apps seemed like overkill,
since all that would be returned is 1 record. Using dynamic SQL would
be a lo... more >>
BULK INSERTing a file with Quoted Identifiers
Posted by Eric Phetteplace at 2/11/2004 3:23:53 PM
I am having trouble figuring out how to allow quoted identifiers using the
BULK INSRET command. I've browsed google and msdn but haven't seen anything
helpful.
Please help :)
Eric
********source file - bdrecords.txt:*******
"my, name", "my,Address"
"your ,name", "your, address"
****... more >>
QueryValue returns wrong value?
Posted by Neil W. at 2/11/2004 3:17:46 PM
When calling QueryValue, SQL 2000 Enterprise seems to return 4, where the
docs seem to say that 4 is MSDE. Any ideas about this?
Thanks.
Neil
... more >>
Is this a bug?
Posted by Mogens Olesen at 2/11/2004 3:14:44 PM
Below is 3 queries.
The first query is just to show, that the view 'Availableitems' returns what
is expected and especially to verify that the
'Available' column is actually 0.
The ItemID is the same (340613) in all three cases.
The next two queries are identical except for the first, which... more >>
Key(Row) Locks with UPDLOCK and READPAST
Posted by Donna D. at 2/11/2004 3:11:05 PM
I am trying to write a stored procedure that picks the next row out of a work queue table, changes it's status, and assigns it to an agent. Multiple agents can call the stored proc so I need to prevent two agents from grabbing the same row. I've implemented a proc (see the repro scripts below) us... more >>
Getting Time in SmallDatetime
Posted by kbarz at 2/11/2004 2:31:06 PM
I'm working on getting some other software to output a smalldatetime into Sql. This software is capable of outputting a string. It seems that if I just have a date, or if I have a date and a time with a space between them, SQL will accept the date, but will chop off the time. If I try adding sing... more >>
Creating Databases
Posted by Scott at 2/11/2004 2:26:27 PM
I need to be able to create new company databases
programmically. Most companies have the same objects
(tables, views, sprocs, etc.) One option I looked at was
creating all the common objects in the Model database.
Unfortunately this won't work because I also create other
databases on the ... more >>
IDENTITY column ?
Posted by Wayne Sheffield at 2/11/2004 2:21:30 PM
Is there a way to change an integer column into an IDENTITY column without
having to build a new table and reload the data?
Thanks,
Wayne
... more >>
Error handling
Posted by Jeremy Ames at 2/11/2004 2:02:26 PM
I am trying to catch an error thrown by a unique constraint on a table. I
have written an sp that will copy records from one table to another. This sp
is called once a bunch of records have been deleted and there are less than
10 records left (trigger). The problem is that the sp will copy all of... more >>
Prompt in SQL Script?
Posted by Gregor Anton at 2/11/2004 1:59:20 PM
Is it possible to prompt for variables in a sql script, for example what
database to use, what values to update.
Something along the lines of
Update <TABLENAME> SET <FIELD> = <PROMPTUSER>
... more >>
Update problem using self-join criteria
Posted by mblacky2000 NO[at]SPAM hotmail.com at 2/11/2004 1:54:30 PM
Hi
I am trying to replace a select statement I have written to Identify
specific records within a table with an update statement to modify the
identified records. I am not having alot of success.
The query is as follows
select t1.eqnum, t2.eqnum , t1.classattribute, t2.classattribute
... more >>
Primary keys on temperory tables
Posted by harsh at 2/11/2004 1:43:20 PM
hi,
I have a couple of variables of table datatype which hold about 8 to 10
records each.There are a few updates and selects on these variables. Now my
question is whether it will be fine to add primary keys to these variables?
I tried adding primary keys to these variables and found the relativ... more >>
Subquery returned more than 1 value Error!
Posted by davidf NO[at]SPAM webnet-x.com at 2/11/2004 1:27:07 PM
I can't see it being that hard...
----------------
Update Quotes
Set Updated = 1
From WorkLog
Where Quotes.QuoteID = worklog.quoteID and
worklog.StepNum = 1 And
Not Quotes.QuoteID is null
----------------------
Basically I'm just trying to set a bit based on whether or not this
other t... more >>
Counting Rows
Posted by JMNUSS at 2/11/2004 1:03:43 PM
I know this is easy and I am fairly certain I have done it
before but for the life of me I cannot get it to work. How
do I implement a count of similar rows resetting the count
when the value changes...i.e.
Row count ID
--------- -----
1 16
2 16
3 1... more >>
Insert using view - performance
Posted by kevin at 2/11/2004 12:54:11 PM
I have a view which meets all the BOL specified
requirements for an updateable view. The base tables
have the check constraint. I can do multiple inserts but
the performance is terrible. I insert many rows and the
CPU and read counts are good. Many inserts get high read
counts and high... more >>
Managing a huge table with blob data
Posted by Tobin at 2/11/2004 12:21:06 PM
I have developed a project for a company that stores scanned images for web access. The table is quickly growing to fill the 1/2 terabyte sqlserver2000 server (running on win2k server)
After researching my options, I am questioning simply truncating old records. The way the binary pic data is st... more >>
Identifying Distinct Values
Posted by J. Joshi at 2/11/2004 12:20:55 PM
I have a TEST field datatype with 1 character as width.
The values in the field are c, C, h, & H. However, when I
run the following query, I get the following results:
QUERY:
======
select distinct piph.CurrentOrHistory,
count(Distinct piph.CustID)
from tblxxx piph
group By piph... more >>
Another query problem: Lockup
Posted by Jochen Daum at 2/11/2004 12:12:07 PM
Hi!
I have a query which consistently locks up when I run it:
The problem occured, since I entered the marked (>>) part into it.
Without it, it runs fine.
CREATE VIEW dbo.XXOSPReport
AS
SELECT dbo.JobReference.Reference AS XXReference,
dbo.XXOSPDates.ActualStartDateTime AS OSPActua... more >>
Column update
Posted by Ravi at 2/11/2004 12:10:40 PM
Hi,
I have a strange issue with Sql server 6.5. I have an
applicaiton running in VB updates the tables. Recently I
have dropped and re-created few tables with column
changes. Now I am able to update the table through ISQL
but not through the VB app.
Can someone please shed light on thi... more >>
latest service pack
Posted by Nikhil Patel at 2/11/2004 11:54:53 AM
Hi all,
What is the latest service pack for SQL Server 2000. Can somebody give me
a link where I can download it?
Thanks...
-Nikhil
... more >>
User Defined Functions and the Optimizer
Posted by news.microsoft.com at 2/11/2004 11:25:05 AM
I'm interested in how the optimizer in Sql Server handles code in User
Defined Functions.
I have a number of UDF's that include complex select statements and return a
table with data.
The UDF's is then used from a number of stored procedures.
Does anyone have information about how this affe... more >>
insert select
Posted by Alex at 2/11/2004 11:11:07 AM
I have the following tables
create table midlet
midlet_id integer
spec intege
create table compatibility
device integer
fk_midlet_id integer
I have the following data
insert into midlet(midlet_id,spec) values(1,1
insert into midlet(midlet_id,spec) values(2,0
insert into midlet(midlet... more >>
Error converting data type DBTYPE_DBDATE to datetime.
Posted by john Smith at 2/11/2004 10:44:36 AM
I get the above error message when I query an odbc FoxPro table from sql
server 2000 sp3. The query seems to run ok except when I use UNION or
DISTINCT. Any ideas? This seemed to work fine under sql7.
Thanks,
John
... more >>
Determining success or failure with EXECUTE(@string)
Posted by BarryDudley at 2/11/2004 10:36:06 AM
I am invoking EXECUTE(@string) to execute dynamic SQL from within a Stored Procedure. I cannot find in any documentation how I can determine if the dynamic SQL succeeded or failed
How can I do this?... more >>
Group By limitations
Posted by jchin NO[at]SPAM vansco.ca at 2/11/2004 10:33:43 AM
I have a table and would like to query using the Group By
clause. Some rows have the same SerialNumber field but
will always have a different TestNumber field. I just
want to select the row with the highest TestNumber, heres
a sample of the data that I would like to query
SerialNumber T... more >>
Trigger + Access + Sql -- different values?
Posted by Debbie Morrow at 2/11/2004 10:20:19 AM
I've got an odd question ..
I have an application with an Access 2002 front end with
linked tables to a SQL 2000 backend. Users have always
been able to edit the SQL tables via access linked
tables/forms with no problem. I have now created an audit
table and using triggers to register eac... more >>
question about "where 1=1"
Posted by Utada P.W. SIU at 2/11/2004 9:56:33 AM
any affect in query speed if i added "where 1=1" in the sql statement?
... more >>
number formating
Posted by Shailesh Patel at 2/11/2004 9:48:51 AM
Hi:
I like to format number in sql.
e.g. display 0.24 as +.24
i.e. remove leading 0 and show + or - sign.
Thank you for help.
Shailesh
... more >>
Cannot sort a row of size 8397, which is greater than the allowable maximum of 8094.
Posted by koho at 2/11/2004 9:45:59 AM
Hi all
It seesm that we have reached a sql limitation with a complex query.
Any one have any ideas how to resolve this is sql 2000?
Greatly apprecoated.
Sample query
Select SectionID, Section, Description, QuestionID, Question, DisplayType,
Designation, Orientation, ResponseID, 0 As NoOf... more >>
PRINT in transact SQL
Posted by Tom Groszko at 2/11/2004 9:37:08 AM
Is there a way to force the results of a print statement to immediately be
sent to the client? It seems like it waits for a buffer to get full before
it does the send.
Thanks
Tom G.
... more >>
selecting recordsets and setting variables
Posted by jt at 2/11/2004 9:23:51 AM
i have a procedure that does a select on one table - if
that select comes up empty, then i want to select from a
different table. this works fine, but the problem is that
i need to return the values as a recordset for my ASP
pages. so naturally, rather than getting one recordset i
get ... more >>
How do i reset a failed job icon
Posted by Don Johnson at 2/11/2004 9:10:09 AM
When a SQL Server job fails, a white X within a red circle
is the icon displayed next to the job in Enterprise
Manager. After the errors causing code had been corrected,
how do i reset the icon to one indicating no errors.... more >>
Moving a database diagram to another database...
Posted by Roz at 2/11/2004 9:06:07 AM
Hello, all. Was wondering if I can move a diagram I've created in Database A to Database B, which is on the same SQL SERVER....with different db names of course. I'm running SQL 2K. If this possible, please let me know
Tia
Roz
... more >>
Removing Rows in table
Posted by AHS at 2/11/2004 9:06:06 AM
I am trying to remove rows in a table, using a schedule job, without logging to the Transaction log file. Previously, I was using the "delete from" statement to delete rows that were older than a day, however, the transaction log was getting too large. Is there a statement that would work in this... more >>
duplicating a row in a table
Posted by adam NO[at]SPAM twv.org at 2/11/2004 8:51:05 AM
H
Is there an easy way of duplicating a row in a table without manually doing every column
I trie
INSERT INTO t_task
SELECT
FROM
t_tasks
WHER
id =
but this fails as there is an identity column and obviously I want the new row to have a new identity
Ada
... more >>
Listing all columns with with tables and key status
Posted by confused NO[at]SPAM dodgeit.com at 2/11/2004 8:45:11 AM
Hi,
I'm looking for a script to list names of all the columns in my DB,
together with the name of the table they belong to, and whether or not
they have Primary Key or Foreign Key status.
I found lots of scripts in the archives of this group which do the
first part already, but nothing that... more >>
nolock hints
Posted by kgoodrich at 2/11/2004 7:56:09 AM
What is the definitive answer on using nolock hints in select queries? Does sql 2000 ignore the hint and process the query as it sees fit? Is it good programming practice to use nolock hints? I am a developer working on an application that must perform Insert, Update, and Delete operations on the... more >>
Convert hex string to bigint
Posted by natalie.marak NO[at]SPAM tvguide.com at 2/11/2004 7:31:14 AM
I have a function which converts a hex string to a bigint. See below.
I have run across a few which are too big to fit into a bigint so I'm
getting an arithmetic overflow error. Does anyone know any way to do
this? An example hex string that is causing this problems is
'0x800000000000000000'... more >>
Monitor Server
Posted by brian at 2/11/2004 6:38:04 AM
I am very new to monitoring server performance. I am
familiar with setting up profiler or system monitor but
my main problem is what to track. I have tracked a lot
of stuff but then don't really know how to interpret it.
For example- I have an intranet site set up and users
access all r... more >>
Optimising Queries
Posted by Simmo at 2/11/2004 6:36:36 AM
Hi,
I have a Web-Based application running against a
SQLServer 2000 backend. Some of the queries are very
complicated / large / in loops which get repeated a lot
and I'm looking at ways of optimising them. I was
wondering if anyone could offer some advice on the
following:-
1) Is a u... more >>
RollBack
Posted by JP at 2/11/2004 4:31:04 AM
Hi All
I updated few records in a table with a update command. How do I rollback and get the previous data.
Please Help
Thank
JP.... more >>
Table Definitions
Posted by Peter Newman at 2/11/2004 4:01:08 AM
Is there a way to get the following information for each table in a databas
Table Nam
Field Nam
Field Typ
Field Lengt
Allow Nulls ( Y or N
Indexed ( Y or N )... more >>
Help need to migrate a sql server db to a MSDE database
Posted by G B at 2/11/2004 3:40:13 AM
I have a sql server database with sps,populated tables ,indexes and so
on.
I need to move the lot to a MSDE database.
Could somebody give some suggestions or script or tool to do it.
Thanks
vbnetuk
*** Sent via Developersdex http://www.developersdex.com ***
Don't just partici... more >>
Avoiding Rowguid as PrimaryKey, is my idea workable???
Posted by Russell Mangel at 2/11/2004 3:20:00 AM
I have two SQL2000 tables which will be published using merge replication, I
need a rowguid columns.
I have heard that using a rowguid column with an index will affect
insert/update performance.
I wish to create a design that avoids lengthy insert/updates, if possible. I
am using ADO.net and C#... more >>
Copy a database
Posted by paolo.riba NO[at]SPAM email.it at 2/11/2004 2:39:21 AM
Hi!
I have to copy a sql server database (tables, views, stored
procedures, ... in a word ALL the database).
I tryed to use the SQLDMO "transfer" method, but I had some troubles,
pricipally it takes a lot of time (a VERY lot of time), but sometimes
it don't copy the database (actually, I don't ... more >>
Please help with check constraint
Posted by paulsmith5 NO[at]SPAM hotmail.com at 2/11/2004 1:44:15 AM
Hi,
I'm want to place a check constraint on a field to make sure that the
value entered in the field is either null or if not then the value is
greater or equal to 1 (i.e. not 0). The field is of type int and allow
nulls is true. I've not used constraints before and am not sure of the
syntax.... more >>
CreateObject("MSXML.XMLHTTP")
Posted by dnad NO[at]SPAM itex.ge at 2/11/2004 12:12:45 AM
Hi
Can anybody help me?
I need to execute following vb script using sql agent job:
dim myRequest
set myRequest = CreateObject("Microsoft.XMLHTTP")
.. . . . . . . . . . . . .
set myRequest = nothing
but it fails.
same time I'm executing this script from command lines. All user
per... more >>
|