all groups > sql server programming > june 2004 > threads for tuesday june 1
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
DRI
Posted by Evandro Braga at 6/1/2004 11:59:21 PM
Hello all,
after select a user in the database (using Enterprise Manager
for SQL-Server 7.0), and click Permissions, all objects are listed. All
tables (only) have an option DRI to be selected. What is this column /
property for ???
best regards,
Evandro
... more >>
SQL WHERE clause on text field
Posted by mongphong28 NO[at]SPAM yahoo.com.au at 6/1/2004 11:58:59 PM
Hi,
This may be a simple question but can someone please tell me if/how I
can do the following:
SELECT TOP 10 Id, Name, Address FROM People WHERE Name > 'ADAM' ORDER
BY Name
The example scenario is a table with say 100 records of people ordered
by Id. I want to order by Name and grab 10 ... more >>
DRI
Posted by Evandro Braga at 6/1/2004 11:54:12 PM
Hello all,
after select a user in the database (using Enterprise Manager
for SQL-Server 7.0), and click Permissions, all objects are listed. All
tables (only) have an option DRI to be selected. What is this column /
property for ???
best regards,
Evandro
... more >>
Parse Data while selecting
Posted by jyothi_ee NO[at]SPAM yahoo.com at 6/1/2004 11:47:14 PM
Hi,
I have the following two tables in my database
Create Table A
(
aid int, aFunction varchar(40)
)
insert into A values(1, '''0'' + Code')
insert into A values(2, 'REPLACE(Code,'' '',''0'')')
insert into A values(3, 'RIGHT(Code, 4)')
create Table B
(
Code varchar(40),... more >>
Retrieving Huge Data From DB in steps of 1000
Posted by SSP at 6/1/2004 11:33:05 PM
Hello,
I am working on a application that involves processing
60,000+ rows of records from one table alone. This table's
child tables have probalby double the number of records
than that are present in the parent.My question is how can
I retreive records in say steps of 1000 process them , ... more >>
store procedure & return result ,How ?
Posted by Agnes at 6/1/2004 10:09:14 PM
I wrote a store procedure to return some data,
In SQL analyzer, I use the following code as testing, however, as I run it,
syntax is OK. but there is no result in the grid ..
Anything wrong ?
--------------------------------------
declare @name varchar(25) , @address1 varchar(50), @address2 v... more >>
Help! Error Attaching DB
Posted by Joao Pinto at 6/1/2004 10:04:31 PM
Hi!
When I try Attach a DB I have this error:
Error: 3624
Location: recovery.c:2440
Expression: seenCKptEnd
SPID: 51
Process ID: 1344
Any idea ?
Excuse my English.
Thanks in advance.
Joao Pinto... more >>
Partitioned View vs. SubQuery
Posted by mike at 6/1/2004 8:47:08 PM
Hi. can someone offer me some guidance on this one; i'm a
bit new to sql server so any help would be HUGE. i have a
table with 2-3M lines of sales data going back to 2002.
i'm trying to create a view that can "quickly" take a
table of invoices and group it be sales territory as rows
and un... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Need help !!!
Posted by Bryan Staggs at 6/1/2004 8:38:17 PM
Hi all...
I need to run the query below to insert leave information into the leave
table. My problem is that if the user does not have a record in the
table the insert fails. What I would is my current statement to insert
the data, but if I can't accomplish that I am thinking I might be able
... more >>
Is there any Hex() function available?
Posted by David Lightman Robles at 6/1/2004 8:04:52 PM
I need to do some calculations in hexadecimal for binary fields. Is there
any way to convert binary fields into char (range 0 to 255) or hex (0 to
255) so that I could operate on them?
In detail, I use a binary field to store a hierachy within some records on
the same table:
Hex ... more >>
spliting db files into multi-files
Posted by JJ Wang at 6/1/2004 6:53:22 PM
hi,
I have a sql server 2000 database which has only one file
and one file group (primary). This file has grow to be
over 40 gig, I want to have two db files for this db,
which should have 20 gig each. What's the best way to do
it?
I don't think 'DBCC SHRINKFILE' with 'emptyfile' com... more >>
MANY-to-MANY-to-MANY ....
Posted by SomSallyX at 6/1/2004 6:23:28 PM
I'm not experienced database designer and i've a academic project
I've a database design project which has the following things to lookk
1. There can be 'n' number of users
2. There can be 'n' number of groups
3. There can be 'n' number of roles (Similar to the situation in MS Sql
Server us... more >>
Passing a variable in Order By
Posted by Bill at 6/1/2004 5:28:52 PM
I am using SQL Server 2000 SP3 and am trying to write a stored proc that
allows a dynamic sort. I thought it would be easy by passing a variable
that would be used in the ORDER BY and pass what column I need to have
sorted (from the front end app). The problem is that when I attempt this I
rec... more >>
Need Help With Pivot/Cross-Tab Query Please
Posted by jj at 6/1/2004 5:26:06 PM
I've been writing (and learning from books, web articles, newsgroups,
etc..) T-SQL for SQL Server 2K for several years now, and have not found
a way to run basic queries that return pivot-like (or Cross-Tab like)
results. Here is a simple example of what I would like to do, but the
solution... more >>
How can i update all relationships in one go?
Posted by Benny at 6/1/2004 4:48:29 PM
Hello experts,
Assume I have created 3 tables in MS SQL 2000:
table A
* a_id (PK)
* name
table B
* b_id (PK)
* a_id
* name
table C
* c_id (PK)
* a_id
* name
Both table B and C have a cascade delete relationship with table A.
Question, now I want to cancel all cascade delete... more >>
How to read a file
Posted by João Melo at 6/1/2004 3:16:49 PM
Hello there,
I have a problem. I need to have a set of files on my server drive, but they
must have a path that indicates where they are in an SQL Table.... I managed
that... my problem is that i was "asked" to return those files in a select
as a binary so that i can send it to users thru web ... more >>
Restoring just the table?
Posted by Lee at 6/1/2004 3:13:10 PM
Hi,
What's the best method in backing up and restoring just a
table, column names and data included?
Thanks
Lee
... more >>
MS Sql server, stored procedure, order by
Posted by Neven Klofutar at 6/1/2004 2:42:20 PM
Hi,
Is it possible to use variable in the ORDER BY part of the SELECT query?
Thanx, Neven
---------------------
@sortName nvarchar(10)
..
..
..
SELECT *
FROM tblPerson
ORDER BY @sortName
... more >>
user-defined function in aggregate query
Posted by Assaf at 6/1/2004 1:56:34 PM
Gotta be a beginner problem...
Ggetting an error when including UDF in any aggregate query: "GROUP BY
expressions must refer to column names that appear in the select list."
UDF:
CREATE FUNCTION dbo.CountProfiles ()
RETURNS int
AS
BEGIN
Return (select count(member_id) from Prostate_profi... more >>
osql and variable output file names
Posted by Joan at 6/1/2004 1:36:09 PM
Is there a way, using osql, to create the output file name dynamically? I've got a job that will run monthly and the output file created w/osql needs to be dynamically created based on month/year combination.... more >>
Stored Procedure doesnt work
Posted by Maik Siegel at 6/1/2004 1:21:05 PM
I´ve wrote a stored procedure, but if i try to insert in into sql server i get an error in the last line
The Joke: If i delete the last line, then the error again in the last lin
But i cannot find an error
Here ist the sp (quite long
SET QUOTED_IDENTIFIER ON
G
SET ANSI_NULLS ON
G
Create ... more >>
Converting hex-string to decimal
Posted by Runar Myklebust at 6/1/2004 1:17:12 PM
Hi all.
I have an urgent problem i hope anyone could help me solve:
Ive got a string representing a large hex-value, e.g 00ae011aba18a028
Im trying to convert this into a string representation of this number om
decimal-format, e.g 48977860250607656
Ive tried to use different convert-thi... more >>
How to use the WRITETEXT command - newbie question
Posted by Sunshine at 6/1/2004 12:54:04 PM
Hello all and please excuse me if I am in the wrong group.
I am very new to sql server and I am trying to update a ntext field. Of
course I realized I couldn't do a normal update statement and I found online
that I would have to do a WRITETEXT statement. However, I can't figure out
how to do... more >>
Output
Posted by Joan at 6/1/2004 11:36:01 AM
Is there a way to not have the field name output when executing a select statement? I'm calling a stored procedure from a job using osql where a select statement is using to return records to a .txt file. The problem is the field name(s) are also output - which I don't want. I simply want the dat... more >>
Duplicate Indexes ...?
Posted by rick at 6/1/2004 11:32:54 AM
I have inherited a database which has been designed and supported by app.
developers.
During which time, they have built several repeating indexes on many of the
tables.
Before I go and drop them all, does anyone know a good reason for having
more than many identical indexes on a specific tab... more >>
Slow stored procedure compared to ad hoc query
Posted by PaulW at 6/1/2004 11:16:02 AM
Hi,
I have a stored procedure which takes about 14 minutes to execute. If I copy
it to Query Analyzer, commenting out the procedure declaration and running
it as an ad hoc query only takes 18 seconds. I run sp_updatestats and
rebuild (compiled) the stored procedure, but that made no diffe... more >>
Help - Linking to an Oracle database
Posted by Ray at 6/1/2004 11:11:11 AM
Hi al
I need to link to an Oracle database from my SQL Server and don’t have any clue how to do this. Any help would be appreciated
Thanks in advance
Ra
... more >>
Null Test
Posted by Stacy Hein at 6/1/2004 10:51:14 AM
I have a table with 3 columns:
CREATE TABLE [tblTrgTest] (
[id] [int] IDENTITY (1, 1) NOT NULL ,
[o_id] [int] NULL ,
[i_id] [int] NULL ,
CONSTRAINT [PK_tblTrgTest] PRIMARY KEY CLUSTERED
(
[id]
) ON [PRIMARY]
) ON [PRIMARY]
GO
I want to check for NULL value in 1 of the colu... more >>
Version Control for SQL Server
Posted by sfibich at 6/1/2004 10:35:56 AM
Good Morning,
I have a indirect sql server programming question. I am looking for
best practices for maintaining version control within a production MS
SQL Server environment. We have multiple production SQL Servers with
both Test and Development environments each with more then one SQL
... more >>
Deleting Duplicates
Posted by Jerry at 6/1/2004 10:09:20 AM
Hi,
Assuming the following table structure:
CREATE TABLE sales2
(RecordID int not null identity,
CustomerID int not null,
ItemID int not null,
Textcol varchar(20) not null)
I have duplicates rows for CustomerID and ItemID. There should only be one
record for the unique combination ... more >>
Ree: SQL Server 4.2 -- no cursors -- any ideas?
Posted by kevcof NO[at]SPAM yahoo.com at 6/1/2004 9:40:57 AM
"David Portas" <REMOVE_BEFORE_REPLYING_dportas@acm.org> wrote in message news:<RqadnfIdHKsOIyvdRVn-uw@giganews.com>...
> > Traverse TABLE2, checking the value of Column1 in each record, and if
> > the value is equal to one of the 20 distinct values in
> > TABLE1..Column1, then <do something>.
> ... more >>
ROLLUP needs to Rolldown!
Posted by DBAL at 6/1/2004 9:29:31 AM
Hey everyone,
Thanks to David Portas' recommendation, I have replaced
COMPUTE with ROLLUP which is Awesome. The only problem
is that it is totalling everything at the top instead of
the bottom. Is there a way to change this?
Please advise:
DBAL,
Code Excerpt:
GROUP BY Inprod.f... more >>
function call in a subquery
Posted by Oleg Ogurok at 6/1/2004 9:18:30 AM
Hi all,
I'm trying to get the list of all tables, columns and descriptions.
Here are 2 queries.
1. To return all tables and columns:
select TABLE_NAME, COLUMN_NAME
from INFORMATION_SCHEMA.COLUMNS
order by TABLE_NAME, ORDINAL_POSITION
2. To get a description of a column
SELECT * F... more >>
SQL Query and Temporary Table
Posted by Joel at 6/1/2004 8:52:47 AM
Hi! I have a problem, I want to use a Stored Proc to generate Cyclic
transaction in the begining of the year. So basically I have a table with
all the the Cyclic and once a year I want to generate them by example: If a
cyclic Bi-Annual it will be generated twice, if a Cyclic have a frequency of
... more >>
Stored Procedure Help
Posted by Peter Newman at 6/1/2004 6:31:05 AM
Sys = SQL 200
I have created a stored procedure that creates 5 temporary Tables using the followin
SELECT * INTO #TempTableName
FROM Table
at the end of the Sp i do a select on all the temp tables into a final temptable. This works fine when calling the procedure from SQL... more >>
Resultset as output-parameter
Posted by Klaus at 6/1/2004 6:22:28 AM
Hi all
Is it possible to create a stored procedure, that returns
a resultset (from a select contained in the sp) as a
output parameter.
If yes, could anyone please provide me with a simple
example.
TIA
Klaus... more >>
Pros/Cons of Command Object
Posted by Gerard at 6/1/2004 5:57:58 AM
Hey all,
Can someone just give me a quick overview of the pros
and cons of using Command Objects in ADO to connect to SQL
2k. Most situations you can get away with not using one,
and I want to know if there is any reason to use one at
all. Thanks in advance,
Gerard
P.S. I have a... more >>
Join Ordering
Posted by venkat NO[at]SPAM anonymous.com at 6/1/2004 4:36:03 AM
hi
i had the opinion that be it (SELECT * FROM BIGTABLE JOIN SMALLER) or ( SELECT * FROM SMALLER JOIN BIGGER ) the performance wouldbe the same and the query optimiser would decide on the way 2 table could be joined and also that its a good practise to follow the same ordering in all SP
Howeve... more >>
Input parameters to Stored Procedure
Posted by Alex at 6/1/2004 4:30:25 AM
I=B4m using SQL Server stored procedures and MS Project VBA.
=20
I have created a stored procedure in my SQL Server=20
database and would like my input parameters use the value=20
of variables instead of constants from MSP VBA code.
I would like to set the values of the variables in my VBA=20
... more >>
Finding the date a record is created
Posted by Shathish at 6/1/2004 4:21:02 AM
hai there
could anybody help me out with this proble
i need to find out when a record is first created in a tabl
is there any way to find this ou
-N.Shathish... more >>
Multiple sessions when using ADO
Posted by Maryam Teimourian at 6/1/2004 3:51:06 AM
H
I have an application that uses an ADOConnection named CONNECTION1 and an ADODataset.The dataset fetches a record for editing it.This dataset has no ConnectionString and its connection is the CONNECTION1.After opening the dataset and editing record (befor posting it) I execute a Stord Procedure t... more >>
Problem in Select Query
Posted by Babz at 6/1/2004 2:31:08 AM
H
I am facing a peculiar problem, my data are stored in the db as follow
OrderId OrderItem
------- ----------
1 Itm1,Itm2,Itm
2 Itm4,Itm6,Itm7, Itm
But I need output lik
OrderId OrderIte
------- -------------
1 Itm
1 Itm
1 Itm
2 Itm
2 Itm
2 Itm
2 Itm
Actually I have... more >>
Constraint problem
Posted by Sheetal at 6/1/2004 1:46:10 AM
Hello
I am in the process of altering data types in my database programmatically.I am following the steps
1. Create a temp table, and fill it with all the concerned tables and columns
2. Open a cursor on tab.1, use a stored procedure, to extract all the constraints and store them in another temp... more >>
URGENT : Maximum number of Unions
Posted by Roshan J at 6/1/2004 1:21:02 AM
Dear All
Can someone tell me what is the maximum number of Select queries that can be combined with UNION in SQL server.( Eg : Maximum number of Unions that can be in a SQL statement
IS there any limitation or is it possible to have any number of union selects
Roshan J ... more >>
URGENT: Maximum number of Unions in a query
Posted by Roshan J at 6/1/2004 1:06:03 AM
Dear All
What is the maximum number of Selects that can be added with Unions ( Eg : Max. No of Unions for a query )
The query structure will be
(Select Count(Int_Key) As Int_Key From fAdrBook) UNION (Select Count(int_Key) As Int_Key From fInbox1
Roshan J.... more >>
isolation levels
Posted by nikos kantzelis at 6/1/2004 12:46:03 AM
hello there folks!!
My name is Nikolaos Kantzelis and I am e-mailing you from Athens,Greece
I am a developer developing web applications using ASP.Net, PHP and SQL Server
I also develop 32-bit window applications using Delphi 7.0 and Sql Server
I would like to ask you a question regarding a p... more >>
NULL
Posted by toylet at 6/1/2004 12:14:31 AM
is the NULL value really meant for the use by OUTER JOIN?
In general, one could always avoid the use of NULL by creating a column
to tell the difference.
--
.~. Might, Courage, Vision. In Linux We Trust.
/ v \ http://www.linux-sxs.org
/( _ )\ Linux 2.4.26
^ ^ 12:12am up... more >>
any faster solution?
Posted by toylet at 6/1/2004 12:11:01 AM
ALTER procedure chang_test4
as
set nocount on
create table #hst_info ( id_no char(1), hst_no char(1), period char(1) )
insert into #hst_info values ( 'A', '1', 'D' )
insert into #hst_info values ( 'A', '1', 'N' )
insert into #hst_info values ( 'B', '2', 'D' )
insert into #hst_info values ( '... more >>
|