all groups > sql server programming > may 2005 > threads for friday may 27
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
Display pictures in Northwind on the VB form
Posted by §Chrissi§ at 5/27/2005 10:10:23 PM
Hi,
In Northwind , there is an employees table which store photos. It seems =
the pictures are linked to the picture files because there is a =
photopath field containing the path. When I try to display the photos =
on the VB form, it give me a error. I used the same way to display the =
l... more >>
finding the letters
Posted by rodchar at 5/27/2005 7:37:23 PM
hey all,
if i have a field that contains values like these:
BOC123
MC123
FIN123
How do i just get the letters?
thanks,
rodchar... more >>
extended procedures
Posted by Brad White at 5/27/2005 4:44:46 PM
I'm finding lots of code samples for writing extended procs, but *all* of
them
do nothing with SQL. Hello or calculating free disk space are common
examples.
I'm writing a sp because I want to work with SQL data. How do I do
that from an xp?
Do I have to go back around through ADO?
I woul... more >>
Improving performance of SPs
Posted by EggsAckley NO[at]SPAM Last.com at 5/27/2005 4:19:12 PM
Hi:
Can people please post general guidelines for improving the
performance (speed) and/or efficiency of Sql Server stored procedures?
Thanks for your attention.
EA... more >>
Why Output
Posted by tshad at 5/27/2005 3:48:57 PM
I as looking at a book about asp.net and was curious, why do we need
"Output" parameters?
In the example from the book:
***************************************************************
Create Procedure GetLastName
(
@firstname varchar(20),
@lastname varchar(20) Output
)
As
Sele... more >>
Recursive rows in table and deletion problem
Posted by J-T at 5/27/2005 2:40:53 PM
I have a table with the following schema.As you can see it stores questions
of a survy and each question can have child questions which are related to
their parents by "Parent_ID".I'm using IDENTIY for the Question_ID which is
the primary ley of my table.My problem is that when user deletes on... more >>
Newbie: UPDATE a Table
Posted by steve at 5/27/2005 2:37:09 PM
Hi,
I want to insert some new data in a Table. There is a possibility that there
are duplicate rows .
An Insert is obviously not allowed due to PK violatons.
The new data reside on a temporary Table and there are NO duplicates!
Will an Update do?
I simply want to :
"If the row exis... more >>
"Insufficient key column information for updating and refreshing"
Posted by bagman3rd at 5/27/2005 2:37:01 PM
"Insufficient key column information for updating and refreshing"
What does this message mean. All that I am trying to do is manually update
2 rows in one table with one join to another table with the updated values.
Thanks.
Archer... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Possible to drop IDENTITY from a column?
Posted by Snake at 5/27/2005 1:57:14 PM
I have several tables with the IDENTITY attribute (my problem now!) and I
need to remove the IDENTITY attribute from some of those tables/columns. Is
there a sane way of doing it? If so, could you share it with me?
Thanks!
Michael ... more >>
Drop all indexes
Posted by Mike Labosh at 5/27/2005 1:48:31 PM
I have been assigned to do some heavy duty index re-engineering on a
database.
EXECing a few sp_HelpIndex calls demonstrates that there are gobbles of
useless, unused, haphazard and redundant indexes all sort of kludged
together and don't even have consistent names.
I am allowed to have ... more >>
Return always 0.
Posted by tshad at 5/27/2005 12:26:22 PM
I am trying to find out why my return from my ASP.Net page is always 0.
I have the following code:
****************************************************
Dim objCmd as New SqlCommand("AddNewResumeCoverTemplate",objConn)
objCmd.CommandType = CommandType.StoredProcedure
objCmd.parameters.ad... more >>
Hoping not everyone is gone the Friday before Memorial Day!
Posted by REM7600 at 5/27/2005 12:05:18 PM
Hey Guys n Gals...
Looking to see if someone can give me an efficient means of populating a
table with a complete set of dates for each of the values in a selection
set.
I've done it using cursors and it's horrid SLOW... I'm no expert so I
thought I would ask...
here's the data set
... more >>
Simple Question (I hope)
Posted by vul at 5/27/2005 12:02:07 PM
I have a smalldatetime field with the name BidDate in a table Sopa.
I need to build Crystal Report which will display all other fields grouped
by Year and Month. I'm going to do grouping in the report. The first is to
create a select statement which returns all required fields, plus
Year(BidDate... more >>
Getting Strange Execution Plan w/ DBCC
Posted by BDB at 5/27/2005 11:46:47 AM
Hi,
I'm running this:
DBCC CHECKDB ( '<database>', REPAIR_FAST ) WITH ALL_ERRORMSGS, TABLOCK
And I'm getting this:
Server: Msg 8649, Level 17, State 1, Line 2
The query has been canceled because the estimated cost of this query (13451)
exceeds the configured threshold of 10800. Contac... more >>
Substring with text datatype column in BOL - typo??
Posted by Mark at 5/27/2005 11:13:42 AM
Below is a excerpt from BOL about using Substring with text/ntext columns.
Shouldn't it read "return the first 10 characters"? Perhaps my BOL has not
been updated ...
Thanks in advance.
Mark
B. Use SUBSTRING with text, ntext, and image data
This example shows how to return the first 2... more >>
how to aduit database access?
Posted by === Steve L === at 5/27/2005 10:53:36 AM
background: sql2k on win2k3 server
i have an application which no longer has further development on it (so
that means no changes will be done thru front end interface of the
application). but new business policies require the aduit for database
access, such as who accesses the database at ... more >>
Implementing natural keys
Posted by Chris Lieb at 5/27/2005 10:37:13 AM
After reading a thread about the 'merits' of natural keys, I decided that I
would play around with them a little. A database that I am working on needs
to have the ability to repopulate some of its tables from a flat file. By
doing this, however, the foreign keys that exist in other tables w... more >>
ANSI NULLS performance impact
Posted by dave at 5/27/2005 10:14:03 AM
Could someone explain why having the ANSI NULLS database option off causes
the following piece of SQL to run substantially slower. When the option is
on, in my applications ODBC settings, the query will return in less than a
second; however if the option is off then the query will take 28 seco... more >>
backup and restore script
Posted by Craig HB at 5/27/2005 9:45:38 AM
I want to be able to create a development database based on our live database
-- on an ongoing basis. I think the easiest way is to backup the live
database, and restore it as a different name. Because I will be doing this
often, I would like to run this as a script.
Does anyone have a scr... more >>
Arithmetic overflow error converting numeric to data type numeric
Posted by hazz at 5/27/2005 8:40:04 AM
Column 'Grade' in table is-
numeric length 5
Precision 4
Scale 2
Declare @Grade decimal
Set @Grade = 19.5
Insert into table (Grade)
Values(@Grade)
Arithmetic overflow error converting numeric to data type numeric.
Do I need an explicit convert for this? Thank you. -hazz... more >>
Mode and Median functions in SQL 2000
Posted by Krishnaprasad Paralikar at 5/27/2005 8:28:06 AM
I would like to know whether statistical functions like Mode and Median are
available for use in SQL 2000?
If Yes, what's the syntax?
If No, what do I do now?
... more >>
Copy Database
Posted by -Ldwater at 5/27/2005 8:21:03 AM
Hi all,
In our system, were using quite a primative method of copying one database
to another, but renamed (like a live version & a play version).
At the moment, we do a simple backup to a physcial file, and then restore it
using a different name.
The problem is that at some clients, th... more >>
Last Function in SQL Server ?
Posted by Oded Dror at 5/27/2005 8:18:10 AM
Hi there,
--Access Query that Doesn't work in SQL
SELECT Last([FirstName]) AS First_Name, Last([LastName]) AS Last_Name
FROM Employees
--Access Query that work with SQL if we have an EmployeeID
SELECT TOP 1 FirstName,LastName
FROM Employees
ORDER BY EmployeeID DESC
--SQL only if we do... more >>
Multiple FK or "TableName" column?
Posted by David Parenteau at 5/27/2005 8:07:09 AM
Hi!
I have a table "addresses". Address can be associate to a customer, an
employee, a supplier or a consultant. Every of these 5 have a table with an
identity primary key. My question is simple: Which of the 2 ways is the best
to link the "Addresses" table to other tables?
A- By adding ... more >>
ORDER BY before UNION syntax error
Posted by Italian Pete at 5/27/2005 4:08:06 AM
I have a list of Nationalities which I want to sort alphabetically except
for the value of Nationality which is "not disclosed" which I would like to
put at the top of the list.
I'm trying to do this with the following query but there seems to be a
problem with putting the ORDER BY in fro... more >>
Row size increase....
Posted by Milind at 5/27/2005 3:45:16 AM
Hi,
I have large test data. I have face problem with row size greater than 8060
then it give me warning/error. If i want to store in row greater than 8060
then how to do? Is it any possible way? I try with ntext and sp_tableoption
but it gives me upto 256.
And i read in theory BLOB and a... more >>
Indexes on SQL Server
Posted by Stimp at 5/27/2005 3:23:20 AM
Hi all,
I'm not au fait with indexes as much as I should be...
If a table has a lot of indexes (circa 18) and an insert is carried out
on this table roughly every 5 seconds, this is a bad thing isn't it?
i.e. you should only use this many indexes on tables where SELECT
statements are used... more >>
Migrating from RMS III
Posted by B NO[at]SPAM rney at 5/27/2005 2:58:01 AM
We're migrating a production database (mission critical) from RMS on Aplha to
SQL
Server 2000.
The data is static, it only gets updated once every 24 hrs. Some tables only
once a week. Apart from the updates this is a read-only database with rather
tight performace requirements.
The da... more >>
left join
Posted by wireless200 NO[at]SPAM yahoo-dot-com.no-spam.invalid at 5/27/2005 1:02:34 AM
I'm doing the statement below which takes some cell numbers an
matches them with their text names
It works fine but the thing is if a cell name is missing it doesn'
return anything from that row.
In Oracle I could simply have simply done the join like this cell
acell(+) with the plus after ... more >>
Audit Trail - getting the current username.
Posted by cc900630 NO[at]SPAM ntu.ac.uk at 5/27/2005 12:49:33 AM
Hi, I have a couple of questions on writing an audit trail/last updated
feature for my database.
First, How can I programatically get the current user in SQL when
executing a stored procedure.I have tried using sysusers table and
CURRENT_USER but only get the value dbo. I am using integrated
... more >>
Problems with identity column
Posted by Michael C at 5/27/2005 12:00:00 AM
I was working on a program recently that had a bit field called 'completed'
which recorded when a certain event was complete. I was removing this field
because it was possible to tell that the event was complete through other
means so the field was a duplication and a violation of good data de... more >>
SQL Query with Current date + 30 days
Posted by JP SIngh at 5/27/2005 12:00:00 AM
I need to find out all the records where a particular field is within 30
days of current date.
Can someone help me with the SQL please
I am new to SQL programming. The statement below used to work with Access
2000
sql = "SELECT top 4 Contracts.Id, Contracts.ContractNumber,
Contrac... more >>
How to be quickest
Posted by Bpk. Adi Wira Kusuma at 5/27/2005 12:00:00 AM
How to be quickest to restructure table master? If i have set "Relationship"
on a database.
My willingnes is When I resize key field on table master, so all Dependent
tables will also change. Can I Do it?
... more >>
Change Unicode to MBCS
Posted by Win at 5/27/2005 12:00:00 AM
How can I change a chinese word (unicode) to MBCS?
... more >>
file operations
Posted by Bob Castleman at 5/27/2005 12:00:00 AM
I'm writing a proc to do tlog backups. I want to validate the path before
attempting to issue the backup command but I don't see any documented file
handling funtions in T-SQL. What's the best approach for this?
Thanks,
Bob Castleman
DBA Poseur
... more >>
attach/detach db by user with no priviliges
Posted by Frank at 5/27/2005 12:00:00 AM
Hello,
I am looking for a way to have users with normal security (= not system
admin and so on) to attach and detach a specific database. Maybe via a
stored proc. Does anyone have an idea?
Thank you
Frank
... more >>
|