all groups > sql server programming > october 2003 > threads for friday october 10
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
Is there a good SQL/Stored Procedure writting/Editor?
Posted by jack at 10/10/2003 11:21:33 PM
Hello,
I am looking for a good SQL/Stored Procedure writting/Editor?
If anyone knows of one let me know.
Thanks,
Jack
... more >>
Reorging Tables and Indexes
Posted by paul reed at 10/10/2003 9:45:49 PM
Hello,
I can't find a way to reorganize my tables and indexes with the maintenance
plan wizard that allows me to run it right now. It seems like I have to
"schedule" this. How does one run those utilities immediately?
Regards,
paul
... more >>
script to create DB in SQL Server
Posted by Matthew Louden at 10/10/2003 9:29:48 PM
I have VB application that needs to connect to SQL Server database, and need
to send to the customer with the whole package.
I know I need to change the connection string in VB application. But how can
I send the SQL database? Export to a format to DTS? and ask the customer to
import using DTS... more >>
Stored Procedure Timer?
Posted by jack at 10/10/2003 9:10:20 PM
Hello,
I am looking for a way time a stored procedure to see if a change made a
speed differnce. Are there any tools I can use.
Thanks,
Jack
... more >>
Storing data to image field
Posted by j.m.autry NO[at]SPAM earthlink.net at 10/10/2003 7:34:33 PM
I have a very large array of floating point numbers which I am trying
to
store in an image type field. I am using the dataset class to
directly enter the data but am having trouble trying to get this type
into the image field. I guess the question is how do I get a large
floating point array ... more >>
Help with sp_who
Posted by Miguel MirĂ³n at 10/10/2003 7:07:00 PM
Hi I'm very new with SQL Server and I would like to Know how manage the way
that user log into the database. An example: if exits an account opened with
user UU and password XX, and another user try to conect using the same name
and password, I would like to tell the new user that there is a cone... more >>
TOP <n> against SET ROW COUNT <n>
Posted by Seal at 10/10/2003 5:40:29 PM
Hi all
Which one is faster for a SELECT Statement?
Thanks in advance
... more >>
incorrect SQL statement???
Posted by Milsnips at 10/10/2003 5:16:51 PM
I have an existing table with cityID as integer, and i want to alter the
column to be primary key with identity (auto incrementing number).
whats wrong with my code below???:
ALTER TABLE
tblCity
ALTER COLUMN
cityID INT IDENTITY
CONSTRAINT cityID_pk PRIMARY KEY
thanks,
P.
... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Table or not Table?
Posted by Tumurbaatar S. at 10/10/2003 4:50:10 PM
A database contains address info for members and
the address record consist of several columns where one
is something like state id (e.g. USA states). Actually,
the number of states is about 20 and fixed, of course.
And I need to choose from these 2 methods of
storing and manipulating state inf... more >>
can this UNION query be optimized?
Posted by K. Shier at 10/10/2003 3:41:48 PM
SELECT NameLast + ', ' + NameFirst as PatientName, employees.NameLast, 'A'
as SortPriority FROM employees WHERE SSN = XXXXXXXXX
UNION
SELECT ed.NameLast + ', ' + ed.NameFirst as PatientName, ed.NameLast, 'B' as
SortPriority FROM employeesDependents ed INNER JOIN employees e ON
e.EmployeeID = ed... more >>
previous month, quarter, year, start and stop date?
Posted by Fredrik Melin at 10/10/2003 3:23:29 PM
Hi,
How can I do the following:
I want to get the start and stop date for the last month or quarter or year.
If todays date is 2003-10-10 and I want the last month, it should return
2003-09-01 and 2003-09-30
Or If I would like the last quarter I would like it to return 2003-07-01 and
2003-... more >>
select from one table insert into two
Posted by Mike at 10/10/2003 3:20:21 PM
I have three tables sheet1 is imported from a xl spreadsheet. I need to
split this data up into two tables but I can't figure out how to write the
sql. I would like only the plate id from sheet1 in Tab_plate_info and
plate_id, location_well and compound_id in the Tab_compound_info table. I
al... more >>
Transactions & Schema Changes
Posted by Mike at 10/10/2003 3:16:10 PM
Our application is distributed to several locations around
the country, each of which has a standalone MSDE 2000
instance. We must periodically update the application's
functionality, which requires a change to the app itself,
and the underlying SQL Schema -- adding new columns to
tables... more >>
How to Execute a SP from a Function
Posted by Fernan at 10/10/2003 2:54:37 PM
Does any1 know how to execute a Stored Procedure within a user-defined
Function
--
Fernando Lopez Perez
... more >>
Sorting text string as numbers
Posted by Totto at 10/10/2003 2:34:48 PM
Hi,
I want to sort on a text string that are formed like this:
1.1
1.2
...
2.1
...
3.1
...
10.1
Sorting on this will plaze 10.1 at the beginning.
Anyone know how to sort this numeric and not as text ?
... more >>
What's wrong with this FOR UPDATE Trigger?
Posted by Venkat Venkataramanan at 10/10/2003 2:34:17 PM
Hello:
When this trigger is in place amd I made an update using
Enterprise Manager, the changes seem to happen but when I
refresh the data, all I see is the old data.
Can somebody tell me why so?
Venkat
CREATE TRIGGER updElem_Group
ON TranRules_sa.Elem_Group
INSTEAD OF UPDATE
... more >>
Stored Procedure save then slow first time
Posted by Kevin Jackson at 10/10/2003 2:31:23 PM
Can someone explain this?
When I change a stored proc in enterprise manager and then save it, the
first time I run it there is like a 20-25 second delay. After I run it that
first time it's very very quick to run after that.
I will also add the following. We use a tool called AdeptSQL Diff... more >>
SQL HELP
Posted by MS User at 10/10/2003 2:06:48 PM
I have a Order table with columns
orderid,orderprice,orderdate
I want an output which gives me orderprice for
ThisWeek , MonthToDate, YearToDate, 2002Sale ,2001Sale
So if I run the SQL today (10/10/2003),
Field "ThisWeek" should be sum(orderprice) starting from 'Monday' of this
week (1... more >>
IP (address)
Posted by Chave at 10/10/2003 2:01:05 PM
Hello !
I need to know how I can get the IP (address) of the user is connecting to SQL Server.
Chave
... more >>
Stored Proc Result (derived)
Posted by Ben at 10/10/2003 2:00:45 PM
I have a stored proc that extracts a hierarchy
relationship from a table. The procedure is called from
an .ASP page, and the results are written out via
Response.Write(recordset(col)).
By the way, as soon as I can get to the inetserver.asp.db
and/or inetserver.asp.general newsgroup(s)... more >>
Help with another SQL query please.
Posted by Lam Nguyen at 10/10/2003 1:57:23 PM
Hi all,
Anith,
Here is your query from previous post and I try to modify
to fix my need. I do another UNION but it's look ugly.
Do you have a better way to re-write the query. Thank you
very much.
Any suggestions would greatly appreciate.
DROP table #RateHO4Base
GO
CR... more >>
Using GetDate in a Function
Posted by Fernan at 10/10/2003 1:50:14 PM
Does anyone know how to use the getdate function inside a user-defined
function
The SQL only says 'Invalid use of 'getdate' within a function'
--
Fernando Lopez Perez
... more >>
Key Colum information is insufficient or incorrect
Posted by satya79 at 10/10/2003 1:11:04 PM
Hi All,
I am getting this message when ever i try to delete recors in a table.
Key Colum information is insufficient or incorrect. Too many rows are affected by update.
Can one help with this problem.....
Thanks in Advance.... more >>
Q: how to get top 4 ordered by field
Posted by evilninjax NO[at]SPAM yahoo.com at 10/10/2003 1:04:11 PM
i need to do a query where i get the top 4 entries for each of a
fieldname.
what i want is more than 4 results, though. i want 4 results for each
of the different field values.
I was thinking about
select top 4 Name FROM
tblFoo
ORDER BY Project, Date Desc;
but that's not quite it, ... more >>
bcp and FOR XML
Posted by Ruggero Rossi at 10/10/2003 12:48:26 PM
Hi all,
I have a problem exporting an XML view of a table using bcp.
I have a stored procedure wich produce my xml (that can be very large (300
mb)) using EXPLICIT option.
In another sp I build this bcp command:
bcp "exec <servername..sp_name>" queruout
\\<destination_file> -c -Sserverna... more >>
Stored Procedures
Posted by Harry at 10/10/2003 12:46:47 PM
Can Stored Procedures be compiled and link to, much like
DLL or MDE? How can I keep the procedues from unwanted
view who also have access to the same server?
Thanks in advance.... more >>
Users
Posted by EL PADRINO at 10/10/2003 12:46:35 PM
Hello;
I want to know how to capture the username of a user
who is connected to the database.
Thanks.-... more >>
Top x in a rank
Posted by landj.griffith NO[at]SPAM attbi.com at 10/10/2003 12:39:59 PM
hello,
I have a table that has a NUM_USED column... an integer
specifying how many times a certain excuse (example only)
was used.
Let's say somehing like...
EXCUSE NUM_USED
The Devel Made Me Do It 27
I Wanted To ... more >>
Problems with the Newsgroup
Posted by Venkat Venkataramanan at 10/10/2003 12:35:02 PM
Hello:
I am using the HTML interface to access this newsgroup.
For the last two days, it said "Newsgroup not available'
when I selected it.
Now, I am able to see the first page but if I try to
advance to other pages, I get the same error message.
What's going on?
Venkat... more >>
local packages
Posted by killer at 10/10/2003 12:22:15 PM
How can I export in one other server my local packages?(and scheduled job)
DTS go only for the objects in a database?
... more >>
Which SQL Stmt is better and quicker?
Posted by Vincent at 10/10/2003 12:10:44 PM
select s.staff_name from staff s, dept d
where s.dept_id=d.dept_id
or
select s.staff_name from staff s
inner join dept d on s.dept_id=d.dept_id
... more >>
Captura de usuario
Posted by El Padrino at 10/10/2003 12:05:25 PM
Si alguien sabe como capturar el usuario cuando uno se
conecta contra SQL2000, que me lo diga.
Pues resulta que quiero mediante un trigger grabar en una
tabla, el usuario que hace modificaciones, en el modelo de
datos que tengo.... more >>
Adding Users through code
Posted by James Napolitano at 10/10/2003 11:44:06 AM
i would like to be able to move through an entire table, retrieve an
employeeid field and add the value of that field as a new user. is their a
way completely in sql server, not using any client side apps to do this.
can i move through a recordset using transact-sql. also is their a way to
itera... more >>
How do I export my entire database schema into a XSD file?
Posted by Jeff Ayers at 10/10/2003 11:41:56 AM
How do I export my entire database schema into a XSD file? I have searched
the net, but I only see examples of extracting a table to XSD or XML. I want
the whole thing.
Sincerely,
Jeff Ayers
... more >>
SQL Reporting Services Beta Availability?
Posted by Alan Z. Scharf at 10/10/2003 11:32:27 AM
According to CNET News on 10/10, MS is releasing Reporting Services for wide
public testing.
Is this available for download anywhere, particularly to MSDN Universal
subscribers?
Thanks.
Alan
___________________________
Alan Z. Scharf
GrapeVine Systems
New York City
... more >>
How to get Views Collection using ADOX with SQL Server?
Posted by Andrei Sidoryk at 10/10/2003 11:26:20 AM
Hello.
Can anybody help me?
I use ADOX to get Tables Collection with SQL Server. It works. Bu now I need
to get Views Collection.
Microsoft says: "You Cannot Use ADOX Views Collection with SQL Server"
But how can I get Views? I also need to edit, add, delete them.
I use C++, but the sample cod... more >>
Date Output
Posted by Mark Norris at 10/10/2003 11:14:03 AM
Hi
Please help with the following scenario:
I have a table containing three columns: Reference nvarchar(10), StartDate
datetime, EndDate datetime. In this table I have one row containing the
following information: Reference - MYREF, StartDate - 01/01/2003, EndDate
04/01/2003 (times don't m... more >>
Importing Data From Within sproc
Posted by Don F at 10/10/2003 11:07:36 AM
Hi:
I want my stored procedure to create a table in SQL Server that copies all
of the data over from a Sybase table. Is this possible without using DTS
directly?
Thanks,
Blair
... more >>
T-SQL Multiple Cursor Question
Posted by joshfeingold NO[at]SPAM hotmail.com at 10/10/2003 11:07:10 AM
I am trying to pull data from a table and compare it to other data in
the same table. Here is my code:
-- clear table
delete from parentChildProgram
-- select all rows of ofp consistency table
select ofpID,orgNo,funNo,progNo,progParent,serviceCenter from
consistencyTable
-- compare eac... more >>
Reason for unusual pause?
Posted by Rick Genter at 10/10/2003 11:07:02 AM
I have an application that uses SQL Server 2000 (SP 3a) on Windows 2000
Advanced Server (SP 3). Every so often (a few times a day), we experience
unusually long query times. For example, the query:
update Queue
set ProcessStatusInt=9,
ProcessStatusText='ANSWERED',
Dispatched=2
where QueueId... more >>
CREATE table with tablename based on parameter
Posted by Don F at 10/10/2003 11:03:02 AM
Hi:
I am trying to create a table with a date appended. For instance, a user
enters "20031007" for Oct. 7, and it creates the table "CallData20031007".
My code is giving me a syntax error when I try to enter the variable in the
CREATE TABLE statement:
---------------------------------------... more >>
Help with sp_helprotect
Posted by Jeff at 10/10/2003 10:50:50 AM
How do I capture the return value from sp_helprotect?
Thanks,
J
... more >>
Insert a row at a specific location
Posted by Andy Williams at 10/10/2003 9:53:06 AM
OK, here goes...
CREATE TABLE Test (SeqID int NOT NULL, Letter varchar (50) NOT NULL)
GO
INSERT INTO Test VALUES (1, "A")
INSERT INTO Test VALUES (2, "B")
INSERT INTO Test VALUES (3, "C")
INSERT INTO Test VALUES (4, "D")
INSERT INTO Test VALUES (5, "F")
INSERT INTO Test VALUES (6, "G")
... more >>
Interested in learning more about SQL Server?
Posted by Tom Rizzo [MSFT] at 10/10/2003 9:32:25 AM
Attend PASS!
Attend the largest user-event dedicated to SQL Server! Join PASS for 100+
technical presentations by 80+ user-experts, MVPs and Microsoft developers.
And don't miss Pre-Conference Seminars focused on Microsoft SQL Server
"Yukon." PLUS!!! All PASS Summit attendees will receive a FR... more >>
Case-sensitivity question!
Posted by Ivan Demkovitch at 10/10/2003 9:31:26 AM
Hi!
As we know 99% of SQL installations case-insensetive. I use public host and
it is so.
I'm working on a website which allow users to register and login.
When it comes to login point I "Select WHERE UN = and PW="
User can use CAPS or not, doesn't matter. Record will be found.
What... more >>
Amazing self-deallocating cursor
Posted by rja.carnegie NO[at]SPAM excite.com at 10/10/2003 9:07:00 AM
I'm lazy, so I don't like to deallocate cursors and stuff.
Specifically, I'd prefer to get by without an error handler
that has to decide, "Did we GOTO here from where the cursor
was already allocated, or not?"
(Even though "all" that you havto do for that is,
IF ( CURSOR_STATUS('global', ... more >>
Two different "Not In" statements
Posted by London Developer at 10/10/2003 8:50:39 AM
I built a query in Enterprise Manager's query builder, and then exported the
SQL to Query Analyser for some final touches. I had two Not...In clauses in
the query and Enterprise Manager produced two different translations of
them:
They were both orignially written:
" where XX no... more >>
Cursors and Loops
Posted by JDP NO[at]SPAM Work at 10/10/2003 8:49:34 AM
I've poseted a solution to use a while loop select top 1 min(val)... where val >
@current_val rather than a cursor.
However it was suggested that even looping is not the most efficient. Well
although I see the time to process reduced using a while loop and temp tables
rather than a cursor, I'... more >>
SQL/VB.NET Error
Posted by scorpion53061 at 10/10/2003 7:58:35 AM
This is a windows vb.net app that is using SQL Server.
I have 1(one) customer who receives this error out of the 400 or so that use
this software. The error and statement are below. I also know this user has
a very slow internet connection but I dont think it is a result of this. Any
ideas?
... more >>
Tracking events
Posted by Dale Fye at 10/10/2003 7:48:08 AM
Thanks in advance for your help
I'm working with a database pulled from a commercial application.
This application records a variety of events associated (enter a room,
exit room, logon, logoff) with users, as well as some system events
(system reboot). What I'm trying to do is determine ho... more >>
Store text data in image field
Posted by Alex Chan at 10/10/2003 7:06:06 AM
Hi All,
Is it possible to store the text data into image field through adostream
write text method sicne I want to store the XML data into image field?
Thanks and Regards
Alex
... more >>
select cast error
Posted by u128845214 NO[at]SPAM spawnkill.ip-mobilphone.net at 10/10/2003 5:36:33 AM
name1 field is is nvarchar(40).
(1)select case when isnumeric(name1) = 1 then
cast(name1 as int) else null end as name
In (1) when name1 is not numeric, name is null and
its type becomes number not string(40).
And,
(2)select case when isnumeric(name1) = 1 then
cast(name1 as int) els... more >>
Multi Language Storage and Display
Posted by svercuski NO[at]SPAM neo.rr.com at 10/10/2003 5:31:42 AM
Hello All,
I'm having a problem saving/displaying multiple lanaguages on an
ASP page. Here's the general problem I'm having. I have an admin
area of a website that allows a user to enter items in multiple
languages. EX:
NAME LANGUAGE
Trade Show English... more >>
COLLATE Japanese / Japanese_Unicode
Posted by Yoshihiro Kawabata at 10/10/2003 5:03:01 AM
Hello,
About COLLATE,
There are two name 'Japanese' and 'Japanese_Unicode'.
select * from ::fn_helpcollations()
where name like '%Japanese%'
Where is the difference betwwen two collates ?
Charactor encoding ? Sort order ?
Regards,
---------------------------------
Yoshihiro Kawa... more >>
OpenRowSet
Posted by Joshua Tipton at 10/10/2003 4:56:26 AM
The follwoing statement when I try to use domain
authentication is returning an error. The error is:
Server: Msg 18456, Level 14, State 1, Line 1
Login failed for user 'us/orl1jdt'.
[OLE/DB provider returned message: Invalid connection
string attribute]
Yes the id works fine and has sec... more >>
mail with stored procedure and cdo
Posted by Fredrik at 10/10/2003 4:08:32 AM
Hi,
I'm trying to configure a stored procedure to send a mail
via a remote server. It works fine when I use the local
smtp-service but when i switch to the code below nothing
happens.=20
I would be thankful for any suggestions.
ALTER PROCEDURE dbo.sp_send_cdosysmail=20
@From varchar(1... more >>
max,min
Posted by u128845214 NO[at]SPAM spawnkill.ip-mobilphone.net at 10/10/2003 3:54:13 AM
Table (continent,country,city,district,score)
a aa a1 g1a 100
a aa a1 g2a 99
a aa a1 g3a 99
a aa a1 f4d 89
a aa a1 f43 77
a aa a1 f4f 88
a aa a1 f4s 88
a aa a1 h34 67
a aa a1 h35 56... more >>
Using CONTAINS on full-text search
Posted by nshala NO[at]SPAM gmx.de at 10/10/2003 3:02:52 AM
Well I'm trying to find how identifier CONTAINS works.
Can I give a CONTAINS identifier an empty string so that he should
look after ALL entries in a full-text catalogue.
Example:
<<<< normal case
SELECT *
FROM address
WHERE CONTAINS(name, 'smith')
I get all entries with the name s... more >>
Query Help Please??
Posted by Satish at 10/10/2003 3:00:18 AM
Hello All,
Please see the below scenario.
I have included the CREATE TABLE and INSERT STATEMENTS for
your convenience.
CREATE TABLE #tblTesting(ID INT NOT NULL IDENTITY(1,1),
Employee INT, Week INT, Year INT, Hours INT)
INSERT INTO #tblTesting(Employee, Week, Year, Hours) VALUES
(100,... more >>
Set Default Value
Posted by ysl_sun NO[at]SPAM yahoo.com at 10/10/2003 2:44:05 AM
Hi all,
I have a select statement which is something like this
"
SELECT a.Name, b.book AS Title
from User a, BookBank b
Where
a.bookID = b.bookID ANd
a.bookID = Null
"
I would like to fill in the Title Column with NA when a.bookID is null
cause it won't be returning anything from th... more >>
sending mail with a stored procedure and cdo
Posted by ryde NO[at]SPAM chello.se at 10/10/2003 2:28:42 AM
Hi,
I'm trying to configure a stored procedure to send a mail via a remote
server. It works fine when I use the local smtp-service but when i
switch to the code below nothing happens.
I would be thankful for any suggestions.
ALTER PROCEDURE dbo.sp_send_cdosysmail
@From varchar(100) , ... more >>
Rules and UDF
Posted by xanatos NO[at]SPAM geocities.com at 10/10/2003 2:23:55 AM
Now... I've a problem. I'm using SQL2000 with latest SP. I have a
quite complex RULE and so I've created an UDF to check the rule. The
function works perfectly, but I can't bind it to the rule, when I give
this command:
CREATE RULE Number AS dbo.DummyFunction(@MyNumber) = 1
I receive the er... more >>
|