all groups > sql server programming > may 2004 > threads for tuesday may 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 30 31
Returning records alphabetically
Posted by Chris at 5/11/2004 10:34:09 PM
I have a customers table with CustomerID, LastName and FirstName fields in
it. If I have a disconnected recordset is it possible to create a query
that returns the next customer based on a query supplying the one I am
currently on. For example:-
2, Evans, Frank,
4, Jones, Paul
3, Smith, Ia... more >>
SQL log file size. Pls help
Posted by Jijo David at 5/11/2004 10:21:01 PM
Dear All
How can I restrict the growth of my SQL log file ? The size of my database logfile is 15 GB, the data file size is only 3 GB, is there any free tool wich I can use for vewing the database logfile
Please help
Thanks & Regards
Jijo N. David
... more >>
Char and Varchar
Posted by Prabhat at 5/11/2004 9:55:34 PM
Hi All,
How internally SQL Server Stores Data in a Char and Varchar field. Like I
think there will be an extra bit of data which will store for Varchar -
Which is for Number of Characters in the field. Is something similar in Char
also?
Also How Does SQL Server Retrive records from both typ... more >>
Is it ok to call stored procedure in a trigger
Posted by Lasse at 5/11/2004 9:47:13 PM
Hi,
Is it ok to execute stored procedure from inside a trigger, I am doing that
because I find it easier to maintain and get better overview of the code.
Thanks
Lasse
... more >>
Optimising stored procedure
Posted by DJ at 5/11/2004 8:50:46 PM
The following stored procedure takes about 10 seconds to run. We need to try
to speed this up because we have several agents who run this several times
an hour. We thought about maybe somehow populating a table with the info
every 5 minutes (dunno how to make it run on the server automatically
t... more >>
Stored Procedure
Posted by Marcelo at 5/11/2004 8:44:33 PM
Hi,
I need to make a stored procedure with accepting one
parameter for the following case:
Here's my situation:
I open a recordset according to a sqlstring. This
sqlstring depends on several parameters so I choose one
out of ten sqlstrings I have written in my asp code.
Code:
d... more >>
INSERT EXEC and recursive sproc call
Posted by Puff Duggy at 5/11/2004 7:38:39 PM
Does anyone know of a workaround for the "An INSERT EXEC statement cannot
be nested" error that occurs when
the @CategoryItemType = 'CATEGORY' condition is met and a recursive call is
made
create procedure dbo.ContentCategory_ContentList
@CategoryId int
as
SET NOCOUNT ON
declare @Tu... more >>
Is it ok to call stored procedure in a trigger
Posted by Lasse at 5/11/2004 6:26:09 PM
Hi,
Is it ok to execute stored procedure from inside a trigger, I am doing that
because I find it easier to maintain and get better overview of the code.
Thanks
Lasse
... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Push in the right direction
Posted by Fredrick A. Zilz at 5/11/2004 5:19:35 PM
CREATE TABLE [dbo].[IHSResponseDetail] (
[ID] [int] IDENTITY (1, 1) NOT NULL ,
[Question] [char] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Response] [int] NULL ,
[Result] [int] NULL
) ON [PRIMARY]
I have a simple table that is used to hold the results of a survey.
Each questio... more >>
Database context changed !!!
Posted by SomSallyX at 5/11/2004 5:15:42 PM
Hi
I'm facing a strange problem while connecting to SQL Server 2000. I'm
getting the error "Database context changed to <database>" while opening the
connection to ANY database thru DSN.
I checked username, password etc.. and it looks ok. also <database> is the
database specified in the DSN... more >>
oracle case??
Posted by Fab at 5/11/2004 3:52:57 PM
Hello,
would anyone know why this does not work in oracle.
CASE PROBLEM_CATEGORY WHEN '%CSCO%' THEN 1 ELSE 0 END AS OTHER_CASE
trying to use a LIKE in a case function.
Thanks.
... more >>
Insert or Trigger
Posted by Jim Abel at 5/11/2004 3:25:09 PM
I'm trying to decide which is the best way to go. Here's
the situation.
I have a DTS that runs weekly. It pulls servers from
another database into a table on my database. I then run
delete update and insert scripts to modify the server
table in my database. The delete and update parts a... more >>
optimizing subqueries with in operator
Posted by Richard Gjerde at 5/11/2004 3:00:51 PM
Can anybody help me with the following problem?
I have a table A with columns A_1, ..., A_n and I want to select those rows
where A_i has the same value as it has on those rows where A_k has a certain
value. I have tried the following query:
select * from A where A_i in (select A_i from A wh... more >>
A Conceptual question - regarding using Statistical functions
Posted by Learner at 5/11/2004 2:09:29 PM
Hi,
I want to use functions like Standard Deviation, Variance, and other
forms of these (StdDevp, Varp) but am not clear about what these really
do. All I know is that if I am clear about these functions, I can really
put these to good use. BTW, maybe there are many more functions in
addi... more >>
Question about performance of an update statement
Posted by Learner at 5/11/2004 2:09:18 PM
Hi,
I have a simple update statement but it seems to be taking forever in
Query Analyzer. My questions are:
1) Shoudl there be any performance difference if I execute the above
update statement from Query Analyzer or via a DTS (i.e. by executing a
'SQL TASK')
2) How is the execution t... more >>
Help request with UPDATE/CASE
Posted by Learner at 5/11/2004 2:09:10 PM
Hi,
I have a table as follows:
CREATE TABLE [MyTable] (
[SaleYear] [smallint] ,
[SaleMonthNum] [smallint] ,
[SaleMonthName] [nvarchar] (20) ,
[TotalSale] [money] NULL
) ON [PRIMARY]
GO
What I want is to update the field 'SaleMonthName' based on the
'SaleMonthNum' field using... more >>
SQL2000 - Crystal 10 Security problem
Posted by Craig G at 5/11/2004 2:03:54 PM
i have a security setting problem in SQL2000
i have a crystal report in that it wont connect to one of our particular SQL
Servers
it will connect fine to other SQL2000 servers using OLEDB Database Expert in
Crystal Reports, therefore i am assuming it is a server setting
each time i go ... more >>
SQLEM for SQL7 on W2003 fails to connect
Posted by Tim at 5/11/2004 1:37:55 PM
Can anyone help...
We have a server about to undergo an upgrade, but can't connect to the
instance of SQL Server 7 (SP3) on the system via SQL-EM (also SQL Server 7).
If we open SQL-EM and open the tree to open the server, the server appears
with the green arrow after a few seconds. When we ... more >>
Add new indexes combined with Transaction Log Restores??
Posted by caffreyl NO[at]SPAM bsci.com at 5/11/2004 1:22:17 PM
If I restore a full backup to a target database and subsequently
follow up with incremental transaction log restores throughout the
day, is it possible to apply (not clustered) indexes immediately after
the full restore so that the subsequent logs will overlay the full
restore AND be reflected i... more >>
Query for available DBs
Posted by Rick Mogstad at 5/11/2004 1:20:29 PM
How would I go about getting a list of databases that are available to the logged in user (and NOT
include databases that are not available to that user)? The sysdatabases table give me all of the
DBs back, and I dont see anything in there that would indocate permissions. I also havent found a
... more >>
SQL Results Problem
Posted by Astra at 5/11/2004 12:40:35 PM
Hi All
I submitted my schema last time and I think the verbose nature of my query
put people off.
In which case, I have simplified it into the below logic, which will
hopefully make sense.
I have one table (no special indexes or constraints - yet) that holds
different currency prices. I... more >>
Re: Especific Format Number
Posted by blackjack at 5/11/2004 12:37:05 PM
how to formating a number on especific format
format([var], "000.000.000.000.00") ????
please help me
my inglish is so poo
-
blackjac
-----------------------------------------------------------------------
Posted via http://www.mcse.m
----------------------------------------------... more >>
How do I avoid this corelated subquery?
Posted by pv_kannan NO[at]SPAM yahoo.com at 5/11/2004 12:22:50 PM
Hello,
I have a situation which would essentially use a co-related subquery.
I am trying to avoid using a co-related subquery due to its slow
performanc and use a join statement instead.
Here is what I am trying to do:
Tables:
========
Limit
-------
RelID ProdID Days Amt1 Amt... more >>
How read XML file on local File System
Posted by Jena at 5/11/2004 12:13:51 PM
Hi all,
I've tried to create a linked server that uses SQLXMLOLEDB 3.0. I wan't to
see a XML file on file system but I can't configure proprerly the liked
server properties. I get an error 7303 could not initialize....
These my parameters:
product name: Test
Data Source: <none>
Provid... more >>
clustered index - heavy inserts
Posted by Zarko Jovanovic at 5/11/2004 12:00:29 PM
I have a table with clustered index which is NOT int identity. It's likely
that there will be many inserts between existing values. I know there's 10%
(default) free space for that but what's happening when that's used, does
SQL server "push" all data to make room for new inserts or what?
tia
... more >>
Indexes on a distant table
Posted by +The_Taco+ at 5/11/2004 11:55:32 AM
I have no problems creating any indexes:
CREATE INDEX Index1 ON [DessauDev].[dbo].[Groupe Dessau
Soprin$as400_jobLedgerEntry]([Entry Type]) ON [PRIMARY]
CREATE INDEX Index2 ON DEREVENU_Final(TransactionAS400) ON [PRIMARY]
But when I want to drop them..:
DROP INDEX DEREVENU_Final.Index2 --... more >>
Workload File
Posted by Dean at 5/11/2004 11:16:03 AM
I'm creating a workload file for the Index Tuning Wizard to analyze but there is no indication as to what the best events are to capture. Right now I'm getting SP:StmtCompleted.
Anyone have any recommendations
Dea
... more >>
Simple question concerning one-to-many relationship
Posted by Novice at 5/11/2004 11:06:02 AM
Hi all, I have a fairly simple question concerning capturing a one to many relationships in Databases
Let me use a simple example so that it is easier to ask my question. Let's say that I have multiple books for each publisher
In my book table, I can't see any reason to have a primary key (othe... more >>
Slow update - Is it normal?
Posted by +The_Taco+ at 5/11/2004 10:43:48 AM
Hey guys,
We have a table that contain about 600k row in it.
We have a stored procedure who does some update on the table (about 10).
It take about 13 hours to get the job completed. These update aren't really
complex, so I was wondering if this waiting time is normal for the ammount
of dat... more >>
select group by or crosstab...
Posted by hngo01 at 5/11/2004 10:04:43 AM
HI all
I have this table:
CREATE TABLE [dbo].[Table3] (
[PKID] [int] NOT NULL ,
[ItemName] [varchar] (50) COLLATE
SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[SchoolName] [varchar] (50) COLLATE
SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[Col1] [int] NOT NULL ,
[Col2] [int] NOT NULL ,
... more >>
Precompile and stay in cache
Posted by kurt sune at 5/11/2004 9:51:21 AM
I have a stored procedure consisting of about 7000 rows. It takes about 35
seconds to precompile. When precompiled it runs in about 1 second.
What options do I have to fix the response time?
Can I somehow keep it precompiled in cache?
Must I split it up?
etc etc
Any advices apreciated.
... more >>
more sp_executesql questions!
Posted by Craig G at 5/11/2004 9:49:00 AM
this time i wanting to put data into a temporary table
when i run the following i get no data returned whatsoever when just using
the fromdate & todate, even though there is data in tblIntervention
what am i doing wrong???
Cheers again,
Craig
@FromDate datetime,
@ToDate datetime,
@... more >>
About SSPI
Posted by Amol Kasbekar at 5/11/2004 9:42:37 AM
In our Powerbuilder application to connect to the DB, we use the following
connection string:
Dbparm=Provider='SQLOLEDB',DataSource='SQLSERVERX',IntegratedSecurity='SSPI'
,DelimitIdentifier='No',ProviderString='Database=xxx'
We use IntegratedSecurity='SSPI' as a configurable option for clients... more >>
Modeling for FACT tables with Different Granularity
Posted by Steven Wong at 5/11/2004 9:41:19 AM
What is the best approach in data modeling FACTS with
different granularity?
For instance, I have Volume measures (item count, item
amount) at daily intervals, but Cost measures (Processing
costs, service costs for those items) at monthly and
quarterly intervals.
How best to construct ... more >>
how to change server time
Posted by sudha at 5/11/2004 8:49:12 AM
Hi all,
Our server has its time settings 3 hours behind how can i
set it to right time.i don't have access to server
physically .is there any stored procedure which i can use
through query analyser.
thanks for any advice
sudha... more >>
Read from Registry
Posted by Konstantinos Michas at 5/11/2004 8:02:35 AM
Hello Experts,
I've created this key in my registry with a string value
named Version. I'm trying to read the value of "Version"
with the xtended stored proc. below, but an error occurs.
declare @Ver nvarchar(5)
EXEC
master.dbo.xp_regread 'HKEY_LOCAL_MACHINE', 'SOFTWARE\MyPr
ogram\Cu... more >>
Table Variables vs. Temp Tables
Posted by Dean at 5/11/2004 7:21:06 AM
I need some feedback from you folks. I've started using table variables to hold temporary recordsets instead of temporary tables. Based on the documentation the table variables use fewer system resources and logging, etc.
Oddly, I've noticed a degradation in performance though. For example, it take... more >>
Cross Tab In SQL 2K ??
Posted by AJACode at 5/11/2004 6:40:28 AM
How to Update from Single Row/Many columns to Single
Column/Many Rows
In SQL Server2000
Since I know there is no such thing as a Cross Tab Query
But....
I want to try to create a stored procedure that uses
the following select statement which pulls all the column
names from a s... more >>
Passing a parameter to a like statement
Posted by JOEF at 5/11/2004 5:42:05 AM
I am trying to pass a parameter but for some reason the
statement below does not return any rows. If I substitute
'%amtrak%' for @co it works.
Thanks,
Joe
declare @co varchar(50),@city varchar(50),@zip varchar(10)
select @co = '''%Amtrak%''', @city = 'sanford', @zip =
32771
select @c... more >>
retrieving generated ID value
Posted by LXKern at 5/11/2004 5:41:06 AM
my problem is that I'm inserting a new data record (with the insert statement) and the database/ the table generates a new id for that data record- an id that I need to retrieve right after inserting the data record... how can i do that?... more >>
Connection pooling
Posted by Carlos Garcia at 5/11/2004 5:16:09 AM
Can i manage a connection pooling directly with SQL Server 2000 ? o i have to manage it from an application
Thanks for your response... more >>
BCP / DTS / BULK INSERT, same server
Posted by plugwalsh NO[at]SPAM yahoo.com at 5/11/2004 4:03:40 AM
Hi
I have two databases on the same SQL2K box. The first (staging)
database has a table with 4.5 million rows in it. The second (target)
database has a table that I empty before I load from staging.
Currently (in DTS), I am emptying the target table, dropping target
table indexes, data-pumpin... more >>
Space consummed
Posted by DC at 5/11/2004 3:41:03 AM
Hi all,
I've an SQL Server table with a varchar column which allows nulls.
Is there any difference between this having a nulls value or an empty value (empty string). Does an empty string consumme more space than a null value?
TIA,
DC
... more >>
Newbie Question
Posted by Jaco at 5/11/2004 3:41:02 AM
Hell
I have a insert using max + 1. My problem is the table is empty and the column does not allow nulls so my isnull does not work. Any help greatly appreciated
Delete from QFMReportItem Where QFMReportsID=50
G
Insert Into QFMReportItem
QFMReportItemID
QFMReportsID
QFMDataItemID
InUs... more >>
Remote table hint example needed for simple join
Posted by maryamafzal NO[at]SPAM hotmail.com at 5/11/2004 1:59:52 AM
Could someone explain how an inner join can be rewritten to
incorporate a remote table hint in the select statement where a local
table is being joined to table on a linked server and the select needs
to run on the remote table.
original sql (all happening locally)
SELECT Books.Title, BookOrd... more >>
TSQL INNER JOINS and null fields
Posted by PMcG at 5/11/2004 1:36:02 AM
I have a inner join query, the following is put togethere to illustrate my query, if anyone can explain this i would appreciate it
Thanks in advance
Pa
/
If i have a table Table1 with the following content (Note SecondaryIdentifier is varchar and nullable
OGPT_PartyId OGPT_PrimaryIdentifier Se... more >>
nested transactions
Posted by toylet at 5/11/2004 12:39:12 AM
given
create procedure inner as
begin transaction
....
if @ok = 0
commit transaction
else
rollback transaction
create procedure outer as
begin transaction
execute inner
.....
if @ok = 0
commit transaction
else
rollback transaction
Now, if outer rolled back, will the cha... more >>
|