all groups > sql server programming > august 2006 > threads for thursday august 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
TIP:How to Eliminate duplicate rows??
Posted by jsfromynr at 8/3/2006 11:35:32 PM
Hello Newsgroup readers,
Most of the time I had seen people looking for some solution to remove
duplicate rows where table is not having any key ( by defination it is
not a table).
Let's say I am having a table EMP (with two columns for illustration)
EMP
*****************
Name City ....... more >>
-- Freelance Developers Community, who wants to help? --
Posted by Freelancer_To-Go at 8/3/2006 9:45:29 PM
Hello All,
I am in the process of putting together a website that allows freelance
developers of all (programming) languages to create a base for sharing
files, articles, links, methodologies and interacting with other
freelance developers through forums and chats.
At this stage I have a lo... more >>
Tricky Stored Procedure Question
Posted by ricardo.dapaz NO[at]SPAM gmail.com at 8/3/2006 8:40:52 PM
Hi there, I would like to create a simple search form to allow users to
search for a job number based on a number of parameters. I think I
understand how to use parameteres associated with Stored Procedures
with a data reader to add various parameters.
However, if I have a stored procedure ... more >>
Left (or Right) Anti Semi JOIN
Posted by Arnie Rowland at 8/3/2006 7:44:06 PM
How do I get one?
From:
http://msdn.microsoft.com/library/?url=/library/en-us/tsqlref/ts_tsqlcon_6lyk.asp?frame=true
--
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
... more >>
Timeout - max pool size reached
Posted by tshad at 8/3/2006 5:46:44 PM
I got the following message on my Sql Server 2000:
Timeout expired. The timeout period elapsed prior to obtaining a connection
from the pool. This may have occurred because all pooled connections were
in use and max pool size was reached.
I understand what this is when dealing with Web A... more >>
decimal column to PIC9(09)V99
Posted by wnfisba at 8/3/2006 3:53:01 PM
We have to extract an amount column defined as decimal9(11,2) to a COBOL
defined PIC 9(09)V99...The "V" indicating an assumed decimal place. So,
100.00 needs to be extracted as 10000.
Can someone help me with this???
Thanks in advance for your help.
wnfisba... more >>
deleting comments
Posted by Rick at 8/3/2006 3:47:01 PM
How can I eliminates comments about the numers of rows affected
from a stored procedure? (see below)
(3719 rows afffected)
(5 rows afffected)
(100 rows afffected)
CustomerId Customer
----------------------------
1 John
2 Fred
3 ... more >>
deriving DB properties
Posted by Andrew at 8/3/2006 3:46:18 PM
Using SQL SVR 2005 Express, when I right-click on a DB, a Properties dialog
appears,
with a default selection of 'General'. The second section of the grid that
appears is labeled
'Database', and shows properties including 'Size' and 'Space Available',
which I am interested
in monitoring vi... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
simple insert query
Posted by sintral at 8/3/2006 3:25:37 PM
insert into locationcatalog (cat_id, cat_id, cat_id, cat_id) values
(117, 118, 51, 45)
where catalog.cat_id = 44 in (select locationcatalog.cat_id from
catalog.cat_id inner join locationcatalog
on catalog.cat_id = locationcatalog.cat_id)
This is what I have. What I'm trying to do is insert th... more >>
Cursors
Posted by Robert Bravery at 8/3/2006 3:07:42 PM
HI all,
I need to loop throu a cursor and then insert rows.
But I need the cursor to be populated from data retrieved via a SP with
Params
how can thin be done
Thanks
Robert
... more >>
SMO Login and User Creation Fails SQL2005
Posted by JP at 8/3/2006 3:04:03 PM
Hi,
I need to create a Login and then a user for a couple of databases
programmatically. I can create the Login but not the user. IT complains about
a parent and when I try to set the parent I got another error. Below is my
code and the exact error messages. Any help is appreciated.
Pri... more >>
Import Filemaker Pro data into SQL Server
Posted by brian at 8/3/2006 2:53:02 PM
I could not find an import/export SQL Server newsgroup so I am posting here.
I need to import data from Filemaker Pro into SQL Server. Any information
would be appreciated such as links, etc.
thanks
Brian... more >>
Concatenate with UPDATE?
Posted by Don Miller at 8/3/2006 2:43:27 PM
I guess I'm missing the trick to append characters (varchar) to an existing
text column.
I want to do something like this:
UPDATE Notes
SET NoteText = NoteText + '******' + @varchar
WHERE NoteID = 99999
And I keep getting "Invalid operator for data type. Operator equals add,
type equals... more >>
CLR and Insert
Posted by Curtis at 8/3/2006 2:33:01 PM
Is it possible to insert records into the database from a CLR function?
I need to insert thousands of records based on For Each loops. I have my
function done except for the inserting part. I was hoping to complete the
task inside SQL, so I can schedule the task using Agent.
If I can't con... more >>
Performance problem with SQL Server 2005
Posted by Kostas at 8/3/2006 2:26:02 PM
Hi all
I am trying to optimise a number of slow running stored procedures and I'm
having a strange problem. As soon as I create or alter a stored procedure it
runs really slowly. Then at some point it suddenly speeds up. The problem is
that I can't tell when and if it's going to speed up; i... more >>
sql server 2000 sample scripts
Posted by Jon Paal at 8/3/2006 2:10:56 PM
I installed
Northwind and pubs Sample Databases for SQL Server 2000
but it didn't say where they were installed. How can I attach them to the database without knowing their location ?
... more >>
Recover .DBD files from LTO tapes
Posted by roberto.moreno NO[at]SPAM gmail.com at 8/3/2006 1:41:01 PM
PLEASE HELP!!! I have an LTO tape backup that contains Database files,
im not sure what software was used to backup these files neither the
software database from where the files came from. When i try to recover
the data using (OS server 2003)Symantec BackExec 10d, the log reads
that 20GB of dat... more >>
Update with Where Exists problem
Posted by Phill at 8/3/2006 1:35:02 PM
I'm running the following query to update some rows. The problem is it is
updating rows that are not met in the Where Exists clause. Does anyone see
where I've gone wrong? Thanks.
UPDATE OUPT_PRD.REQUEST_LINE
SET OUPT_PRD.REQUEST_LINE.STATUS = 'FO'
WHERE EXISTS
(SELECT DISTINCT OUPT_PR... more >>
where download full version of report service 2000
Posted by ITDUDE27 at 8/3/2006 1:19:02 PM
Can anyone point me to a link where I can download a full version of report
services 2000? not the 120 days trial version.
I would think this is out there on the web somewhere.
R... more >>
Fastest way to translate data for normalization in MS SQL
Posted by sdwebguy at 8/3/2006 1:18:05 PM
I am running SQL 2005.
I am importing data from a 3rd party that contains categories and
subcategories. The data looks like this (the :: are just for visual
purposes, representing the different columns in my table):
categoryPathID :: categoryLevel :: categoryName :: categoryPath
1 :: Cat1 :... more >>
How to do a restore a .BAK database - SQL 2005
Posted by Henry Jones at 8/3/2006 1:09:47 PM
I did a backup of a database using SQL 2000 about a year ago. I have two
files. general.BAK and general.TRN.
I created a blank database in SQL 2005 called general.
I tried to restore in SQL 2005 this backup but was unsuccessful. I got an
error saying, "The backup set holds a backup of ... more >>
Converting DateTime
Posted by Scott at 8/3/2006 1:09:42 PM
There maybe a more efficient way to write this, but I normally use the
CONVERT() function like CODE 1 to transform a DATETIME field,
dtMyDateTimeField, so it gets rid of the time part as shown. I do it this
way so when I query from Excel, I only see 1/3/2006 for this example inside
Excel.
... more >>
problem using date in UNION query
Posted by Dan D. at 8/3/2006 1:06:01 PM
Using SS2000. Here is my query:
select tblTasks.numTaskId, tblFranchise.numFranchiseId AS LicenseNumber,
tblFranchise.numEnterpriseId, tblTasks.numCompanyId,
tblFranchise.varFranchiseName, tblCompany.varCompanyName,
tblTaskDetails.numTaskDetailsId,
tblTaskDetails.numTaskId, tblTaskDetails.d... more >>
How to caught unknown exceptions when parsing the XML in stored procedures
Posted by jayanth.vishnuvardhan NO[at]SPAM gmail.com at 8/3/2006 12:46:40 PM
Hi
How can we find out that there is some problem like invalida data type
or data is null or some data type errors occured when parsing the XML
in OPENXML.
Basically what I want is , Is there any way to find out in the SQL
Server 2000 stored procedures to catch exceptions that are occured
... more >>
server name woes
Posted by airwalker at 8/3/2006 12:06:02 PM
I just got bought a used computer, and Im trying to change the server name,
I've changed the computer name and restarted the computer, I've also used
query analyser and changed the server name, but when I try run an c#
appication that connects to a sql database I get a server does not
exist/... more >>
BCP error - "Unexpected EOF encountered" when using native format
Posted by ScottC at 8/3/2006 11:54:34 AM
Hi all,
I am getting the ol' EOF encountered error when trying to BCP into a
table using native format. It works great using character format but
unfortunately I need to use native format due to replication
restrictions (trans replication uses bcp behind the scenes and allows
you to specify p... more >>
Database performance question
Posted by SAM at 8/3/2006 11:48:02 AM
Does anyone know of any utility to stress test a database without causing
more overhead to the performance?
I have a database that suspectingly is running slow or is being accused of
running slow. I am not sure if it is the web servers, the web application or
the database.
I cannot run ... more >>
VS 2005 and SQL Server 2005 Remote Debugging Issue
Posted by inkyuser NO[at]SPAM gmail.com at 8/3/2006 11:33:36 AM
I am having quite a bit of problems getting this to work properly. I
am on a Windows XP Professional SP2 machine trying to connect to
Windows Server 2003. I have Sql Server 2005 installed on the Server
machine. I also have a local instance on my developer machine.
I can use remote debugging... more >>
Selecting the Top Nth Record and the Value of N increments by 1 Everytime
Posted by rishabhshrivastava NO[at]SPAM gmail.com at 8/3/2006 10:59:11 AM
Hi All,
I want to Select the MAX of TOP Nth Record and this Value of N should
be incremented by 1, I am using WHILE LOOP but getting an error Please
let me know what am I doing wrong..
I am doing this because I am inserting the Values in another table
after I find the MAX Nth
Record...
... more >>
Help with query please
Posted by bill NO[at]SPAM internetbazar.net at 8/3/2006 10:51:32 AM
Hi all. Can anyone help me? I have 2 tables, typical one to many
relationship related by id.
t1
id
cola
colb
with a row like this:
1 xxx yyy
t2
id
colc
with rows like this:
1 zzz
1 jjj
I need a query to return all rows from t1 with all related values in
colc from t2 in one row.
... more >>
Inserting row into view???
Posted by Ted Locke at 8/3/2006 9:21:24 AM
This is kind of a repost. Is it possible to insert data into a view using
case?
Example would be:
case when status = 'Fall-Off' then insert (select statement) else 'normal
line' end
I currently have this all posted from two days ago and I am under the gun to
get this figured out, so I ap... more >>
views - necessary to index if underlying tables are indexed?
Posted by KJ at 8/3/2006 8:45:27 AM
Hello,
Just a general question:
If I access a view using the same kinds of queries as I would the
underlying tables, and the underlying tables are indexed, is it
necessary to index the view, or are the table indexes used?
TIA,
-KJ
... more >>
Join??????
Posted by Curtis at 8/3/2006 8:43:02 AM
Select Distinct t1.ClientID, t1.ScanJobHeaderID, t1.SearchEngineGroupID
From dbo.table1 t1
INNER JOIN
dbo.table2 t2 on (t1.ScanJobHeaderID != t2.ScanJobHeaderID)
Order by t1.ScanJobHeaderID
I only want the rows from table1 where they don't equal any of the rows from
table2. My sta... more >>
Finding if SQL is 32-bit or 64-bit.
Posted by Matthew at 8/3/2006 8:23:32 AM
I know that Select @@Version works, but is there a better more reliable
way to tell if its x64 or x86 that i don't have to parse the string.
... more >>
Recovery model
Posted by David at 8/3/2006 8:18:02 AM
Hello,
How can I find the type of recovery set to a database from the system tables?
Thanks in advance... more >>
Retrospectivly apply a default constraint
Posted by Russell at 8/3/2006 7:48:02 AM
I have the code below which will add the default constriant I want. Is there
anyway to make it apply retrospectivly to the existing records?
ALTER TABLE JOB WITH CHECK ADD CONSTRAINT [Setpermanent] DEFAULT 'P' FOR
USR_VB_JOBTYPE ... more >>
How to Copy a DTS Package to Another Server in Enterprise Manager?
Posted by Emily at 8/3/2006 7:45:27 AM
I'll need to copy (or move) a DTS (Data Transformation Services)
package to another database server. I want to know what steps I should
follow in order to accomplish the task in Enterprise Manager.
In Enterprise Manager, the package is located , under the current
database server, "Data Transfo... more >>
Trigger. Check update on multiple columns
Posted by davethomas92 NO[at]SPAM hotmail.com at 8/3/2006 7:24:57 AM
Hi,
I have a table with 65 columns and a trigger to react one way when
column 3 is updated and react another way when column 3 and any of the
others are updated.
Is there a quick way to check what has been updated. I know I could do
If (Update(Col1) or Update(Col2) etc which seems long winded... more >>
SQL Server 2005 timestamp
Posted by geir.forsmo NO[at]SPAM abeo.no at 8/3/2006 7:16:13 AM
Hi!
Is it possible to use comparisons sql server 2005 timestamps, like
operators greater than, less than on two sql server timestamps?
We want to compare two fields in a record to see what is the latest,
and so on. If you know how, please give me an example on how to do it?
Thank you.
... more >>
Date Conversion to YYYYMMDD
Posted by wnfisba at 8/3/2006 7:11:03 AM
I have to convert a datetime column to YYYYMMDD format in an extract I'm
performing.
I checked SQL Server Books Online and there does not seem to be a conversion
style for YYYYMMDD.
Can anyone help me with the SQL here? Is there any way to convert this date
to YYYYMMDD format? Should I b... more >>
Incorrect Syntax
Posted by robken at 8/3/2006 5:39:31 AM
I've have written the following piece of code, but it keeps saying
theres something wrong with the syntax near the last "END" can anyone
see what I've done wrong..
DECLARE @eu3 AS Varchar(5), @sup3 AS DECIMAL(5,2), @indid AS INT, @ind
AS Varchar(12),
@minid AS INT, @maxid AS INT, @sumpop AS D... more >>
How to load a list of Integer into temp table by SP
Posted by mullin at 8/3/2006 5:27:47 AM
hi, i have a sp and one of the input parameters is a list of integer,
i.e. '2181440,2183149,21221111'.
how can i convert it into temp table at sp?
create table #table1 (
AccountCode int
)
... more >>
Recognizing a function name without the Database and Owner
Posted by rmcompute at 8/3/2006 5:23:02 AM
I created a function as: Create Function u_fnSRWorkDayCalc
And then used in a stored procedure, however, the only way I could get the
stored procedure to recognize it was to code it with the Database and Owner:
SvcReports.dbo.u_fnSRWorkDayCalc. I would like to port the stored procedure
to 15... more >>
using parameter for filename in stored procedure
Posted by Netherxx at 8/3/2006 4:00:57 AM
Hi there,
I am trying to use a filename from a vb.net application as a parameter
in a stored procedure. However, i don't know exactly how to put the
parameter into the stored procedure. I know how to configure the stored
procedure with 'normal' parameters, but with a filename as a stored
pr... more >>
Check permission to run a statement
Posted by cold80 at 8/3/2006 2:52:29 AM
Do you think there's a way in SQL Server 2000/2005 to check if you have
the permissions to run a specific SQL statement without running it? I'm
trying to write a small application that executes SQL scripts, but I
would like to check if the user has the rights to do all the operations
of the scri... more >>
Interpreting query execution plan in sql2000
Posted by Deva at 8/3/2006 1:53:02 AM
Hi,
I could not understand 100% (fully) about the details displayed in query
execution plan, server trace and client statistics. I am interested to learn
the information covered in query analyzer about the following areas :-
Show Execution Plan
Show Server Trace
Show Client Statistics
... more >>
sp_recompile for user defined functions
Posted by Y. NAKAGAWA at 8/3/2006 12:00:00 AM
Hello,
I have to rerun a 'create function' script on the management console to
renew stale references in the user defined function to external objects
which had been changed. I am looking for a counterpart of sp_recompile or
sp_refreshview for user defined functions (without schemabinding).... more >>
SQL Server 2000 (8.0) update stats doesnt work
Posted by Steve Cartwright at 8/3/2006 12:00:00 AM
keywords:
sp_updatestats
auto update stats
statistics
sql server 2000 8.0
8.0.0.760
Windows 2003 SP1
We experience following problems on our SQL-Server 2000 SP3a (SQL Server
8.0.0.760) running on OS Windows 2003 SP1:
It doesent seem that the statistics are auto updated on databases whe... more >>
Strange bug in linked servers
Posted by Panda at 8/3/2006 12:00:00 AM
hi all
In my SQLServer 2000, i have a linked server "lnksrv" to another SQLServer
2000.
Into lnksrv there is a table "test" with the fields:
- I_ID int (prymary key)
- I_Integer int
- T_Text text
When i try the query:
SELECT isnull(I_Integer, 0) as I_Integer, T_Text
FROM lnksrv.database... more >>
Inheritance of related objects in a tree
Posted by Robert Bravery at 8/3/2006 12:00:00 AM
Hi all,
How does one go about creatig the correct inheritence of a tree structure
If I have a table containing a tree structure. The parent table could be
related to a cild table with some aditional related properties. Under normal
circumstance this is easy.
But take a tree structure where it... more >>
Date manipulations
Posted by ricky at 8/3/2006 12:00:00 AM
Hi
I am trying to write :
SELECT
CAST(CAST(YEAR(GETDATE()) AS CHAR(4)) + RIGHT('0' +
CAST((MONTH(GETDATE())-1) AS VARCHAR(2)), 2) + '01' AS DATETIME)
but instead of hardcoding the DAY to '1', I wish to use the GETDATE(), as
follows:
SELECT
(CAST(CAST(YEAR(GETDATE()) AS CHAR(4)) + R... more >>
Date manipulations
Posted by ricky at 8/3/2006 12:00:00 AM
Hi
I am trying to write :
SELECT
CAST(CAST(YEAR(GETDATE()) AS CHAR(4)) + RIGHT('0' +
CAST((MONTH(GETDATE())-1) AS VARCHAR(2)), 2) + '01' AS DATETIME)
but instead of hardcoding the DAY to '1', I wish to use the GETDATE(), as
follows:
SELECT
(CAST(CAST(YEAR(GETDATE()) AS CHAR(4)) + R... more >>
Could not find stored procedure 'master.dbo.xp_smtp_sendmail'.
Posted by Anderson at 8/3/2006 12:00:00 AM
Hi, all
I execute the following statements
declare @rc int
exec @rc = master.dbo.xp_smtp_sendmail
@FROM = N'MyEmail@MyDomain.com',
@TO = N'MyFriend@HisDomain.com'
select RC = @rc
go
but complier tell me the following error information,
... more >>
|