all groups > sql server programming > august 2004 > threads for thursday august 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 31
DB Growth
Posted by Harcharan Jassal at 8/12/2004 11:22:20 PM
I would like to know the advantages and disadvantages of using nvTEXT in
place of Text. The main concern is with respect to database growth.
Regards,
Harcharan
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!... more >>
SQL2000/ASP.Net performance question
Posted by Bill Cohagan at 8/12/2004 10:47:20 PM
I'm building an ASP.Net app that will process a web form containing a few
hundred (~300) fields, the results going into a SQL database. Each field
from the web form will generate a record in a single table in the database.
I've got to be able to handle a few hundred users submitting these forms a... more >>
Hierarchy Stored Procedure Performance Appraisal
Posted by mblacky2000 NO[at]SPAM hotmail.com at 8/12/2004 10:43:08 PM
Hi I'm the report writer for a maintenance management team and have
been asked to create a workorder hierarchy spreadsheet with the costs
against each workorder. The costs aren't stored correctly against
each workorder in the system(Outside of my control) so I have to
calculate them with numer... more >>
Someone write a BankersRound UDF...
Posted by Ian Boyd at 8/12/2004 10:03:35 PM
Bankers Rounding, where if you're exactly on the "5", you round to the even
digit.
For example:
BRound(2.49) = 2
BRound(2.5) = 2
BRound(2.51) = 3
BRound(3.49) = 3
BRound(3.5) = 4
BRound(3.51) = 4
There are some posts by Gert-Jan from 2001 but they are incorrect... more >>
how to restore all my data files including master.mdf to my new SQL server
Posted by Michael at 8/12/2004 9:19:58 PM
Hi,
I know this is not a right place for my problem, just hope can someone can
help me,
I need it very urgently!
Win2000+SQL2000,
I have just had a hard disk failure on my I have installed the new Hard
disks, and ,I have to reinstall all both OS and SQL Server 2000. But all my
database... more >>
Inserting a column in the middle of a table using Transact SQL
Posted by Don Miller at 8/12/2004 9:01:29 PM
Assuming that I have a table with columns A, B and C in that order, how can
I add a new column called D between A and B from an SQL script?
Thanks!
dm.
... more >>
SQL SELECT Question
Posted by Jav at 8/12/2004 8:55:02 PM
I am now having a little problem SELECTing. The little problem is massively
difficult to explain - the following is only an example.
Suppose I have a table (tbl) with with 3 fields:
ID int PK
StateBrev varchar(2)
Areacode varchar(3)
I ... more >>
xp_cmdshell: Filename created dynamically
Posted by SOPONL at 8/12/2004 5:21:02 PM
I am attempting to create dynamically a filename each time I execute this
statement. However, for some reasons the file does not get created... I have
administrative priviledges on the computer that runs the statement. Any
ideas...?
set nocount on
Declare @dt datetime, @s varchar(30)
se... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
User defined function or How Do I Do This?
Posted by Calvin X at 8/12/2004 5:06:39 PM
Hi All,
I have a problem. I am attempting to collect data from a query I have that
contains various tidbits of information. It is data orgainized in columns
named HDD_1, HDD_2, etc to about HDD_30.
I built a used defined function to gather this information not realizing
that I cannot run ... more >>
fetch performance
Posted by Hubert Rétif at 8/12/2004 4:56:09 PM
Hello,
I am using the FERCH command in the following way:
DECLARE c_PROD CURSOR
LOCAL
FORWARD_ONLY
FOR SELECT *
FROM V$UPD_PERF_PRODUCT
WHERE .....
OPEN c_PROD
SET @v_DO_LOOP = 1
WHILE @v_DO_LOOP = 1
BEGIN
FETCH c_PROD INTO .....
... more >>
Create Index continue...
Posted by aoxpsql at 8/12/2004 4:55:23 PM
Hari,
I altered the view to include with SCHEMABIDING, and when I try to create an
index now it gets:
16:52:05.875 DBMS MSHFSQL2 -- [Microsoft][ODBC SQL Server Driver][SQL
Server]Cannot index the view 'Axapta.dbo.MSHF_HourTotal'. It contains one or
more disallowed constructs.(42000,1936)
... more >>
sql order by
Posted by Darren Woodbrey at 8/12/2004 4:55:20 PM
I would like to order my query by my status column. I am familiar with:
ORDER BY wo_status ASC
But I nned to order this query by specific words. That is I want the
records to show in a specific order that I set
Backlog
In Yard
In Shop
At Paint
In Billing
The problem is alphabetic... more >>
Adding an extra record to a result set
Posted by Khurram Chaudhary at 8/12/2004 4:40:25 PM
Hi,
I'm trying to add an extra record to a result set that doesn't exist in the
DB. For example, if I return the results, I get:
BookCategory Count
Fiction 50
Careers ... more >>
Reading default values
Posted by Star at 8/12/2004 4:40:12 PM
Hi,
I have a default value like this:
create default [MyDefault] as 255
Is there anyway to read this value from a SP?
I would like to do things like these:
print MyDefault
insert MyTable (C0) values (MyDefault)
Thanks
... more >>
Catching time taken / records affected by query?
Posted by Kim Noer at 8/12/2004 4:15:51 PM
Hi there ...
Is it possible after a query has been completed to grab the time taken and
the records affected and stuff it into a custom made tabel? I'm specifically
looking for at way to include all operations/transactions etc in a stored
procedure (ie. the time counter starts in the top of... more >>
recurse Folder table
Posted by Pezkel at 8/12/2004 4:07:41 PM
Hi there,
My first post. Here goes. I have a table with folders with three fields:
folderId, parentId and FolderName. The folders can go 8 levels deep. So
folder with folderId 1 has parentId 0. Folder with folderId 53 has as a
parent 1 etc. I would like to know how to write a query to find out... more >>
Can I disconnect users programmatically
Posted by Michael Beck at 8/12/2004 4:03:36 PM
I am running a bunch of updates and database maintenance stored procedures
on Sundays. Everyone if supposed to close their front ends at the end of
each working day, but many don't.
Is there a way to disconnect all connections from inside a stored procedure?
It would make the Sunday maintenan... more >>
Control Connection Pooling
Posted by Pedro at 8/12/2004 3:49:02 PM
Hi there:
I built a navigator in vb.net (vs2003) witch let's me view records extracted
from a database. After some navigation (about 7 forwards/backwards) I get the
following message:
"Timeout expired. The timeout period elapsed prior to obtaining a connection
from the pool. This may hav... more >>
create inex in a view
Posted by aoxpsql at 8/12/2004 3:43:32 PM
Hi,
I am trying to create an index in a view, using:
USE Axapta
go
SET NUMERIC_ROUNDABORT OFF
go
SET
ANSI_PADDING,ANSI_WARNINGS,CONCAT_NULL_YIELDS_NULL,ARITHABORT,QUOTED_IDENTIF
IER,ANSI_NULLS ON
go
CREATE CLUSTERED INDEX I_10_Vw1
ON
dbo.Vw_Summary_Reports(projid,Date,dimension3_,d... more >>
Should I use # or '
Posted by Brian W at 8/12/2004 3:17:12 PM
As a programmer new to .Net, I have recently read a couple of books about
..Net. In all the books, it says to encapsulate dates in # (i.ei #3/4/2004#)
to insert into a SQL database. I have not had any success getting this work
work this way. If I insert with single quotes ' (i.e. '3/4/2004') will... more >>
TRANSACTION question
Posted by Rob Meade at 8/12/2004 3:14:38 PM
Hi all,
I have used this once before, but not in the way I'm contemplating using it
now.
Can anyone tell me the answer to the following.
If I have say 6 stores procedures, each of which get called in one 'parent'
stored procedure once, in turn, if I place the begin transaction / rollback
... more >>
Modifying User Defined Data Types
Posted by Charlie at 8/12/2004 2:56:16 PM
Hi:
Once you have created a UDT, how do you change it without first dropping all
columns using it? For example, if I have a UDT of char(3) and later I would
like to change it to char(4), how do I do so without dropping columns that
are dependent on and losing data?
Thanks,
Charlie
... more >>
Deleting Duplicates based on Null fields
Posted by Nuve at 8/12/2004 2:43:20 PM
Hi I'm trying to write T-sql code to delete duplicate rows in a table based
on almost every field except the ID fields. However, if both fields from the
duplicate rows are NULL then the "WHere T1.COL5 = T2.COL5" statement doesn't
work.
Is there a way of getting around this?
here is the c... more >>
Doubling the order
Posted by simon at 8/12/2004 2:26:35 PM
When user clicks SAVE button, it creates a new order with some products.
I open connection, set isolation level on adXactIsolated(1048576) - because
I have trigger on tables,
and then begin transaction. (For all other isolation levels trigger is not
rolled back!)
I then execute couple sql s... more >>
select highest 20% and bottom 80% value
Posted by vibs at 8/12/2004 2:21:02 PM
How can I create the above SQL for a table which has 90 rows of different
companies and I want to get a profit value for the top 20% and bottom 80%
Thanks ... more >>
Date Problem
Posted by Ed at 8/12/2004 2:19:02 PM
Hi all,
Every time when I use the Insert Statement in the front end program like
VB/.Net/Access, when I save the date with the value of Null, it will be
01/01/1900 in the server, how can i keep the value of null in the server...
thanks
ed... more >>
Question about how to differentiate between user functions and stored procedures when using OLE DB to connect to SQL Server
Posted by Mac Dyer at 8/12/2004 2:18:25 PM
Hi I am not 100% sure if this is the correct group to post in but.....
I was just wondering if there was an easy way( if one at all ) to be
able to tell the differnce between stored procs and user functions through
OLE DB connecting to SQL Server 2000. I am building an application that
conn... more >>
Denormalization.
Posted by Akhil at 8/12/2004 2:11:42 PM
Hi,
When do we need to Denormalize?
Cheers,
Akhil
... more >>
Reverse last name first name
Posted by Fox at 8/12/2004 1:28:30 PM
Hi,
Can someone set me on a course to be
able to change the following.
I have a field where I saved names as
lastname, firstname
It turns out that I now need this to be
firstname lastname
How might I approach using Enterprise to
make the needed change to
firstname lastname
?
Tha... more >>
DBCC using SQLDMO?
Posted by Ron Hinds at 8/12/2004 1:26:04 PM
I'm trying to simplify tasks like Bacup, Restore and Check/Repair by using
SQLDMO in my Access front end for the benefit of users who know nothing
about SQL Server and it's Tools. I can't seem to find a way to do the
Check/Repair using SQLDMO objects. Any suggestions?
... more >>
use db-lib to update data directly
Posted by carlochung NO[at]SPAM hotmail.com at 8/12/2004 1:15:01 PM
How to use db-lib to update/insert database records without using SQL
language. I want to change the value of the data individually without
plugging in the new values in the SQL language then execute it. The
perfect situation for me is loop through the retrieved records then
edit the values indi... more >>
news from the trenches
Posted by Shailesh Humbad at 8/12/2004 12:50:26 PM
We are a small ISV intent on using SQL server in our web-based
application. Microsoft has a program that seems like it would fit us
called the "Microsoft ISV Royalty Licensing Program".
http://members.microsoft.com/partner/competency/isvcomp/royaltylicensing.aspx
It says to contact the lo... more >>
Sum()
Posted by Carl at 8/12/2004 12:30:36 PM
Hi,
I have a SQL Server database with two tables, the first table, tblMembers,
has fields Name, memArea , memCode, memAddress etc. The other tblPayments,
has fields memArea, memCode, paySeq, payAmount. tblPayments holds records of
payments that the member made, linked on memArea and memCode. T... more >>
alter column but setting the default value
Posted by Sam Martin at 8/12/2004 12:30:12 PM
hi all,
to add a new column to a table that has a default value of "getdate()"
is .........
alter table dbo.mytable
add mydatecolumn datetime null
default getdate()
however I want to alter table and set the default value for a column which
is not possible using the DDL commands in SQL? ... more >>
SQL Average Hourly Value within Time Period
Posted by Mark at 8/12/2004 12:24:54 PM
I would like to modify the SQL statement listed below to
output the average value for FullScan_Sec over the
date_time interval BETWEEN '20040711' and '20040801'
with a single value for each hour. Each average hourly
value over the 3 week interval.
Thanks,
Mark
Output Wanted:
Da... more >>
Command Substitution
Posted by Claude Hebert Jr. at 8/12/2004 12:13:59 PM
we are migrating data into a sql server and have a lot of cleanup to do
we have close to 100 stored procedures to convert, fix, and suck in the data
each stored proc uses a where clause on a specific id field
i dont want to keep changing every script every time we expand the scope of
data ... more >>
How to discover the caller's IP address?
Posted by faustino Dina at 8/12/2004 11:34:44 AM
Hi,
I need to know the IP addresses of the PCs that are connected to my SQL
Server. The master.dbo.sysprocesses table contains the field net_address.
This is supposed to be the MAC address of the client interface, but the real
problem is to map this MAC address to the actual IP. I've tryed by ... more >>
Query help...
Posted by Kim at 8/12/2004 10:59:48 AM
I have duplicate records in a table based on say
OrderNum, I would like to copy 1st record for each
OrderNum from this table into a new table and then update
the OrderNum record in the 2nd table with values from
rest of the records in the 1st table, can someone help me
in doing this?
Ex.
... more >>
Inserting Results of Dynamic SQL statement
Posted by Khurram Chaudhary at 8/12/2004 10:57:05 AM
Hi,
I have an SP using dynamic SQL that returns some results. I want to take
those results and insert them into another table, not display the results.
How can I do that?
Khurram
... more >>
Script for importing data from a file into a table
Posted by Antonin Koudelka at 8/12/2004 10:18:52 AM
I am looking for an example of a script for importing data from a textfile
(fields delimited by tabs) into a table.
Thanks
Antonin
... more >>
Opinions on procedural language being introduced into SQL Server 2005
Posted by Mike Lerch at 8/12/2004 10:10:32 AM
I'd especially like to hear what Joe Celko thinks of this.
"Many tasks that were awkward or difficult to perform in Transact-SQL
can be better accomplished by using managed code...You can now better
use the knowledge and skills that you have already acquired to write
in-process code."
http:... more >>
Updating SUM value
Posted by Tor Inge Rislaa at 8/12/2004 10:09:12 AM
I have posted the question earlier (10. august) but am still searching for a
solution to my problem.
The query below gives me the result of the calculated prices for all the
invoice_units Where the invoice_id = 2025. This invoice_id equals with a
invoice_id in the table invoice. What I want is... more >>
Period To Date Function
Posted by MANDLA MKHWANAZI at 8/12/2004 9:56:31 AM
When looking at the SQL online books the Period To Date Function Topic is
disable and would like to see what this function does, cause i am looking in
to calculation the sales figures in SQL using the Period To Date Function
and The Year To Date, but both this functions are disable, is there a wa... more >>
complex insert command
Posted by Brian Henry at 8/12/2004 9:52:09 AM
Hi,
I am hoping for an easy solution to this so I don't have to do this update
by hand..
I have a list of ID's from a table i am selecting with this sql statement
select accountid from accounts where accountid not in (select accountid from
ConfidentialityAgreements)
which returns to ... more >>
Insert trigger
Posted by james at 8/12/2004 9:37:26 AM
How can I write an insert trigger that would insert the
same record entered into another table.... more >>
return a list of all rows affected
Posted by ChrisR at 8/12/2004 9:36:21 AM
sql2k sp3
I want to return a list of all the rows affected by an
update.
create table #temp
(c1 int identity(1,1),
TheDate datetime
)
insert into #temp(TheDate) values (getdate())
insert into #temp(TheDate) values (getdate())
insert into #temp(TheDate) values (getdate())
update #... more >>
How to reseed identity key???
Posted by Akhil at 8/12/2004 9:27:04 AM
Hi,
How would you do this in C#.
How would you regenerate (reseed??) a Identity key in a table?
and
What is the difference between primary key and unique key?
Regards,
Akhil
... more >>
Mail Merge with SQL Data
Posted by Nitin Rana at 8/12/2004 9:25:19 AM
Does anyone has an experience with Word Doc Mail Merge
using SQL Data at run time. What I want to do is when user
is viewing a customer record online, I want to merge
customer field into a word doc template that I have set up
on the server. Once user click on Merge Button, it should
do fol... more >>
Transactions
Posted by Akhil at 8/12/2004 9:22:00 AM
What is the philosophy of putting transaction code in the middle tier vs DB
stored proc?
... more >>
Current Lockout time setting?
Posted by Akhil at 8/12/2004 9:19:59 AM
In T SQL command line how do you find out the current lockout time setting?
... more >>
How to pad numbers with leading zeros
Posted by MJB at 8/12/2004 8:53:20 AM
I am trying to find a SQL function that will allow me to format integers
with leading zeros. I have a query that returns the day of the month (ie
1->31 ) and all numbers below 10 I want to have a leading zero. Any help
will be appreciated.
Thanks.
... more >>
Profiler / Trace
Posted by Joe Horton at 8/12/2004 8:32:58 AM
Besides using the tools that come with Profiler - is there anything else =
or other tools I can use to analyze a captured trace and determine DB =
tuning needs? =20
=20
My main focus is to catch long running queries and better indexing =
analysis.... more >>
Cascade Null on Delete
Posted by XCog at 8/12/2004 7:41:05 AM
I have tblA related one-to-many to tblB.
tblA -->tblB
I would like to enforce this relationship for INSERTS and
UPDATES and Cascade Updates but not Deletes.
Upon deleting a row from tblA, I would like SQL Server to
set corresponding FK in the tblB to Null.
Is this possible via the rela... more >>
Getting Time from Date/Time
Posted by Tod at 8/12/2004 6:52:18 AM
I have a view from a SQL database with a field that is in
Date/Time data type. I only want the Time portion of the
value. Pardon my newbieness, but how do I structure my
query to get that?
tod... more >>
How to extract any text from a column which are within double quot
Posted by Sathya at 8/12/2004 4:21:01 AM
Hi,
I have a column whick has values like example..
"I can do it"-u too
""achieve":want
I want to have the string within double quotes in a variable.
It is really urgent. Please help me in this regard.
Thanks and regards,
Sathya... more >>
Autonomous transaction handling
Posted by Ajay at 8/12/2004 3:49:01 AM
Hi,
I am having the following procedure:
<start>
create procedure load
as
writelog 'Started proc1_load'
exec proc1_load
writelog 'Ended proc1_load'
writelog 'Started proc2_load'
exec proc2_load
writelog 'Ended proc2_load'
.... -- other load procedures
....
....
...
GO
c... more >>
wrong scenario for partitioned views?
Posted by alex at 8/12/2004 3:12:17 AM
i have 2 tables: Invoices and Orders
i need to have a generic list with all the common info from invoices and
orders (date, serial number, etc). and i want this list to return in
some cases only the invoices or only the orders.
this sounds like a good scenario for local partioned views to me. ... more >>
alter table
Posted by toylet at 8/12/2004 12:34:44 AM
create table #temp ( f1 char(1) )
Now i want to make the column to have a default column.
how could I do with tSQL? I couldn't figure out the grammar.
Tried the following but failed:
alter table #temp
alter column f1
add constraint df_temp_f1 default ''
--
.~. Might, Courage... more >>
|