all groups > sql server programming > april 2006 > threads for wednesday april 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
Problem while accessing sysprocesses table
Posted by Archana at 4/12/2006 9:48:13 PM
Hi all,
I am facing one wired problem with sysprocesses table of system table.
What i am doing is executing some stored procedures though code written
in dot net.
What i want is to check those stored procedure's id in sysprocesses
table and then update status in one user defined table.
... more >>
unicode to dbcs
Posted by Mahesh at 4/12/2006 9:18:02 PM
How can we convert unicode to dbcs character... more >>
SQLDMO - where to find documentation for Server->ConfigValues values?
Posted by Mark Findlay at 4/12/2006 7:49:57 PM
My SQLDMO C++ app uses ConfigValues to fetch various properties from a SQL
Server:
SQLDMO::ConfigValuesPtr spConfigValues = NULL;
spConfigValues = spSQLServer->Configuration->GetConfigValues();
But finding specific values has been a hit and miss proposition since I
don't have any docs tha... more >>
temp table
Posted by jcvoon at 4/12/2006 7:06:52 PM
Hi:
The following code will result in error:
Server: Msg 2714, Level 16, State 1, Line 5
There is already an object named '#tem' in the database.
if 1=1 begin
select 0 as a into #tem
end else begin
select 1 as a into #tem
end
select * from #tem
drop table #tem
Why ? Please a... more >>
SQL Server on WinXP faster than Win server OS?
Posted by Homam at 4/12/2006 5:14:02 PM
I have a program written in .NET 2.0 that imports a text file with some
elaborate rules. It basically calls a stored procedure in the database to
process each row sent from the app.
I found out that importing into SQL Server 2005 by calling this stored
procedure is much faster on a Windows ... more >>
Casting question
Posted by Colin Smart at 4/12/2006 5:09:50 PM
HI all,
Quick question about a trigger i am developing.
I need to take a varchar string variable and convert it and store it in an
integer variable.
How do i write that statement.
Pls keep in mind that this is inside a trigger not inside a SQL statement.
Thanks in advance,
Colin
csm... more >>
adding identity column
Posted by Andre at 4/12/2006 4:59:50 PM
I'm adding an Identity column to a table like this:
SELECT DISTINCT
T.NAME_LAST,
T.NAME_FIRST,
T.DOB,
RowID = IDENTITY(INT, 1, 1)
INTO #TempResultSet
FROM #TempPopulation T
LEFT JOIN #TempDateOfService B
ON B.KEY_ID = T.KEY_ID
ORDER BY NAME_LAST, NAME_FIRST
The problem I'm hav... more >>
.NET Windows Forms Application VS MS Access client Application
Posted by Jordan S. at 4/12/2006 4:09:39 PM
SQL Server will be used as the back-end database to a non trivial client
application.
In question is the choice of client application:
I need to be able to speak intelligently about when one client (MS Access vs
..NET Windows Forms) would be preferred over the other. While I have some
go... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Query to rerun missed jobs after a backup and restore.
Posted by Matthew at 4/12/2006 2:53:21 PM
Does anyone know of a Query I can run after restoring a db that will go
though and rerun all the jobs that were missed between the time of the
final differential pulled and the time the differential was restored. I
have about 50 jobs and it's really annoying to go through each job
and run it man... more >>
INSERT INTO multiple rows from one SQL statement - possible?
Posted by Carl Imthurn at 4/12/2006 2:40:41 PM
/*
I would like to insert multiple rows into a table from one SQL
statement, and am encountering resistance, to put it mildly . . .
Here's the table setup and population:
*/
if exists (select * from dbo.sysobjects where id =
object_id(N'dbo.SeniorSignoutSecurityTEST') and OBJECTPROPERTY(id... more >>
pwdencrypt vs sql server 2005
Posted by shwac at 4/12/2006 2:08:02 PM
Hi,
I store application passwords in a sql server 2000 table. The passwords are
encrypt with the pwdencrypt function.
I have to migrate the database to sql server 2005. I would like to use the
new crypt function in sql server 2005
(EncryptByPassPhrase/DecryptByPassPhrase).
How can I ... more >>
Grant alter procedure kind of thing
Posted by Tejas Parikh at 4/12/2006 12:21:01 PM
Hey guys. I need to let a developer alter procedures but not create any new
procedures. Is there a way i can do it?
I don't want to
grant create procedure to accountName
Instead I want to
grant alter procedure to accountName
Please let me know if it's Possible. Thank You.
... more >>
Reporting Records in groups of 10
Posted by prenfrow at 4/12/2006 12:03:02 PM
I have a SQL 2000 table with the following fields:
Order_id
cust_pn
Seq_nbr
chassis_nbr
Qty
The cust_pn ends with an "R" if it's a right-hand part otherwise it's a
left-hand part.
For a given order_id, I need to report the part numbers in groups of 10
lefts, 10 rights, 10 lefts and so one... more >>
Max date from three different columns
Posted by Eric Stott at 4/12/2006 11:29:02 AM
I have a query that returns three different columns
ex: select a.date1, b.date2, c.date3
from table1 a,
table2 b,
table3 c
I need to return the result of the largest of the dates
I thought something like this would work, but it doesn't
select max([thisdate])
from
(select... more >>
Like operator in ASP
Posted by ngan at 4/12/2006 11:09:01 AM
I have a asp page where it list orders placed by several providers.
Currently, I have each provider only seeing their own orders. The filter is
based on the PUArea.
Prov1 sees only "Northern" region
Prov2 - "Southern"
Prov3 - "Western" or "Southern"
Prov4 - "Eastern"
I need the follow... more >>
problem selecting desired rows
Posted by Rich at 4/12/2006 10:42:02 AM
I need to select all rows from tbl1 (below) except for the rows where
fld1 + fld2 In ('cd', 'ef') and paidamt = 0
Anu suggestions how to exclude these rows appreciated.
create table tbl1(
fld1 varchar(10),
fld2 varchar(10),
paidAmt int)
insert into tbl1(fld1, fld2, paidamt) values ('a... more >>
sp_spaceused Question
Posted by Matthew at 4/12/2006 9:37:06 AM
Is there a way to get sp_spaceused to return all its information in KB,
and without it KB marker. Basically return the value as an integer?
... more >>
VIEWS are actually FASTER?
Posted by rmg66 at 4/12/2006 9:32:59 AM
SQL Server 2000:
I've done some testing and discovered that querying view on a table is =
consistantly 25% faster than performing a query directly on the table =
itself.
Even with nested views (tested up to six levels deep) it is still faster =
than a direct table query
Example:
- a... more >>
EXECUTE and @@Error questions
Posted by Dave at 4/12/2006 9:26:03 AM
If I call a stored procedure from another stored proc using the EXECUTE
method, does checking the @@Error after the call work the same as the other
statement?
BEGIN TRANSACTION
EXECUTE usp_DeleteTableName @Id
IF @@Error = 0
COMMIT TRANSACTION
vs...
BEGIN TRANSACTION
DELETE... more >>
Query Question
Posted by Gary T. H. Novosel at 4/12/2006 9:25:19 AM
SQL 2000
I have a query that has me stumped.
Assume the following:
Limits Table
Criteria NVARCHAR(2)
Limit INT
sample data:
Criteria Limit
1 100
2 120
3 80
4 125
Samples Table
ID Int
1 Int
2 Int... more >>
Retrieving all Child and Grandchild and Great Grandchild etc Nodes
Posted by Jordan S. at 4/12/2006 9:19:14 AM
Given this table:
CREATE TABLE Nodes (
[NodeID] [int] IDENTITY (1, 1) NOT NULL ,
[NodeName] [varchar] (50) NOT NULL ,
[ParentNodeID] [int] NULL ,
[SequenceUnderParent] [int] NULL
)
I would like to have one SELECT statement, if possible, that returns [all of
the descendent nodes] of ... more >>
XML Data Type in SQL 2005
Posted by george at 4/12/2006 9:09:05 AM
Hi,
I am doing some research for a web application that will be using web
services and xml. The application will be using web services to retreive
data from other web applications in the form of xml. I will need to perist
the xml doc in a db but I will not need to map the xml doc into the... more >>
MSDN and Sql Server
Posted by kw_uh97 at 4/12/2006 9:03:02 AM
Pardon my ignorance. I am a newbie student and I was thinking about getting a
MSDN Library Subscription. I would like to know how this subscription may
help me in my learning the T-SQL language (SQL Developer)? Is there
real-world examples/samples provided in the MSDN Library? Are the sample
... more >>
Store hierarchical data on database
Posted by enzo at 4/12/2006 8:47:03 AM
Hi,
I have 2 tables Category and Procedures. Under Category there are one o
more procedures. So there is a relation (one to many) among the 2 tables.
The question is : if an entity category is a subcategory of another category,
how can I build the relations among the 2 tables (Category an... more >>
Q: How to let users modifiy this ...?
Posted by Art at 4/12/2006 7:48:02 AM
1. Order must have a Status,
2. Order table is linked to the Status table via a FK (PK in Status table),
3. Users want to be able to change (add [no problem], modify [no problem]
and delete [big problem]) definition of what Status is.
4. For example (Status table and then Order table)
Status... more >>
"Hit Highlighting" on SQL Server 2005
Posted by Mac at 4/12/2006 7:42:02 AM
Hello,
What is the best way to do "Hit Highlighting" on SQL Server 2005 with full
text search?
Good luck,
David McRae
www.datanetzs.com... more >>
HOW TO JOIN TABLES AND GIVE A RESULT INTO 1 ROW PER RECORD
Posted by heri at 4/12/2006 7:30:56 AM
Hello,
I have this select statement and the LEFT OUTER JOIN doesnt work it
only display the records from first select statments. I need to
combine both select statments to produce an output into one row. My
Second select statment gets the the value of the OLD and NEW Benefits.
Please help m... more >>
SQLCmd Utility
Posted by c_shah at 4/12/2006 7:03:47 AM
What is the use of SQLCmd utility?
OK I read it in the book online it will be a replacement of osql and
use oledb instead of native SQLClient but why any one ever wanted to
use command prompt utility?
... more >>
Fulltext Thesaurus
Posted by T Mann at 4/12/2006 6:25:01 AM
My understanding of the fulltext search using the thesaurus function is that
it will not work until the TSxxx.XML file is populated (in my case the
tsENU.xml file.)
Is this true?
We rae migrating from SQL 2000 and I could have sworn this was working there.
Maybe I am mistaken.
I do see ... more >>
Get uniqueness of a column from the system tables or information_schema
Posted by tbergNoSpamPlease NO[at]SPAM insight-system.co.jp at 4/12/2006 4:10:20 AM
I'm trying to write a query which, from a given table name, will
produce a list of column names with an indicator as to whether it is
unique. By unique, I mean it a) is the column in a single-column
primary key, b) is the column in a single-column unique constraint, or
c) is the column in sing... more >>
Query Remote Excel File
Posted by fayzal.balu NO[at]SPAM gmail.com at 4/12/2006 3:31:53 AM
Hi..
Hope someone can help, I am trying to connect to a remote Excel file on
a HTTP site ie http://somesite.com/excel.csv.
Now do I use Linked Servers, OpenRowset or Opendatasource and how ?
Thaks in advance.
... more >>
SQL Server 2005 not exits vs not in
Posted by Panos Stavroulis. at 4/12/2006 3:04:02 AM
Hi,
I've got the following 2 queries on SQL Server 2005.
1. select distinct E.col_id, E.CompanyName from Table_A E
join Table_B K on E.kmvid = K.kmv_id
where isnull(col_id,0) not in (select isnull(col_id,0) from Table_c C)
2. select distinct E.col_id, E.CompanyName from Table_A E
join T... more >>
Visio file into SQL table
Posted by enzo at 4/12/2006 2:58:01 AM
Hi,
I must save Microsoft Visio file into SQL Server 2000 table.
Which must be the column DataType ?
thanks... more >>
code getting progressively slower within a transaction
Posted by Will at 4/12/2006 1:30:33 AM
Hi guys,
I've got a stored proc running in a transaction, it does a lot of
complicated processing in terms of selecting from just about every
table in the db, and making a variety of updates. I can't post the DDL
or code, but hopefully it will suffice to say that it selects, updates,
deletes ... more >>
The performance for compare string
Posted by Grant at 4/12/2006 12:46:01 AM
declare @tmpstr
Set @tmpstr = 'B'
if @tmpstr <> 'A'
begin
End
the data almost 1,500 every second, if use this string compare, does it will
effect the speed obvious? pls help me, thks
Then how about the string compare?
Grant
... more >>
Query help...
Posted by ashvsaod at 4/12/2006 12:00:00 AM
Hi all,
I have a table with two columns...
Inital Number, End Number
(sample data)
1, 1
1, 3
2, 4
1, 5
3, 2
etc
I want to make another column that provides the following information..
1-1
1-3
2-4
1-5
3-2
I figured I could make hundreds of case statements... eg:
case when i... more >>
Bill of material (SQL2000)
Posted by Soren S. Jorgensen at 4/12/2006 12:00:00 AM
Hi,
Does anyone got a really good/fast example on how to do a BOM with unlimited
levels in SQL2000
- without using cursors :)
2 tables (one for items, one for parent/child relations)
In SQL2005 we of course are blessed with the new CTE, not in SQL2000 :-/
In advance, thanks...
Kr. ... more >>
SQL Problem
Posted by Joris De Groote at 4/12/2006 12:00:00 AM
Hi,
I have a problem, I have an INSERT statement:
"INSERT INTO TBL_Bestanden_Zoeken (Id,docnr,klnr,klnaam,datum,bedrag,type)
VALUES('67548980-fabc-4e99-905f-3cd89f8be9e4','VF-0601338','80162','CENTREHOSPITAL.DEL'ARDENNE','15-01-2006','99,62','Verkoopfactuur')"
However, I get an error. The p... more >>
Best practice
Posted by Robert Bravery at 4/12/2006 12:00:00 AM
HI all,
I'll try one more time, if no answer then I gather no one has an opinion
either way.
I have a claims database, which has a header table, details table and
otherinfo table. The header table will contain claim header info, ie
claimnumber date of loss etc., the details would contain clai... more >>
Proc timeout
Posted by Soren S. Jorgensen at 4/12/2006 12:00:00 AM
Hi,
We have a very simple proc, containing only one select statement, that
sometimes timeout (mostly it does not)
We would like to know why this happens, so we have put some logging into the
proc. So the proc looks something like:
create proc SomeProc
(
p1 varchar(10),
p2 varch... more >>
Literal value with "IN" clause
Posted by John Smith at 4/12/2006 12:00:00 AM
Howdy,
Is it okay to use a literal value with the IN clause. E.g.
SELECT somefield, anotherfield
.....
WHERE ...etc.
AND 1234 IN (SELECT userid FROM tblUsers)
I was told it wasn't valid, but I'm pretty sure it worked for me. Just
seeking clarification.
cheers
... more >>
Number of seconds Between 2 Dates
Posted by David Lee at 4/12/2006 12:00:00 AM
Hi,
Can anyone tell me a way of calculating the number of seconds that have
elapsed between 2 date time fields e.g. I would to know the total number of
seconds
between GetDate() and GetDate() - 1
Thanks,
David.
... more >>
error while working with dynamic query in report
Posted by supriya at 4/12/2006 12:00:00 AM
Hi all,
I am trying to add report parameter to my report.I am getting "cannot
set the command text for dataset ''dataset_name " this kind of error. I am
working with sql server 2005.I found this tutorial in Books Online->sql
server tutorials - >Reporting Services Tutorials - >Using a d... more >>
listing all rows in a database
Posted by Robert Bravery at 4/12/2006 12:00:00 AM
Hi all,
I have a test databsae, I would like on occasion to list all rows in the
whole database. Is there a quick and easy way of doing so.
Thanks
Robert
... more >>
|