|
Jesal,
thank you so much for a response. I have posted this question on four different websites, including "the" Progress database defacto website with no responses. It is saturday morning and I am at home. I will follow up on your recommendations on Monday and respond.
By the way, have you had this same experience? do you have much experience with Progress databases?
thanks!
|
|
|
|
|
Jesal,
I am trying to connect to a Progress database within a vb.net or asp.net (either one will work for me) application. There is no Microsoft SQL Server involved.
If I don't have Driver={MERANT 3.70 32-Bit Progress};
within the connection string, the error messages are:
Found ObcException type error - ERROR [HYC00][MERANT] [ODBC PROGRESS driver]Optional feature not implemented
ERROR [HY000][MERANT] [ODBC PROGRESS driver] msgOpen: Unable to open message file: PROMSGS
ERROR [IM006][MERANT] [ODBC PROGRESS driver] SQLSetConnectAttr failed.
So clearly, I will get less messages if the connection string contains Driver={MERANT 3.70 32-Bit Progress};
|
|
|
|
|
i have sql server2000 i create datbase on it when i try to attach that database again on sql server this error appear
"error 602 "could not find row in sysindexes for database id 12 ,object id 1,index id 1.run dbcc checktable on sysindexes"
* what is the soulation to attach that database
* how i run checktable on datbase that are not connected to sqlserver
* when i try to connect that database to sql server2005 it's work
p;z answer me quickly
it's emeganecy
ma_refay
|
|
|
|
|
|
how i check the sysindexs table of database doesn't connected to sqlserver
i need to work with that database on sqlserver2000 not sqlserver 2005
ma_refay
|
|
|
|
|
|
How could I add a new record to a table (Using a stored procedure) that has only one column(ID column) that has the Identity property enabled with Seed=1 and Increment=1?
For example if the table has two columns where the second column is CustomerName we should use INSERT INTO to add only a value to the second column because the first column (ID column) will have a new value automatically because of the Identity properties mentioned above.
"I am too late but i will never give up"
-- modified at 13:48 Friday 7th July, 2006
|
|
|
|
|
In your stored proecdure write the following:
SET IDENTITY_INSERT [TableName] ON
BEFORE inserting new record
Sincerely,
Elina
Life is great!!!
Enjoy every moment of it!
|
|
|
|
|
That is exactly what I needed but in the following code:
--The Identity column name: FieldNO
SET IDENTITY_INSERT [ProjectField] ON
INSERT INTO ProjectField_Locale (FieldNO,CultureID,FieldName,FieldDescription)
VALUES (@@Identity,dbo.GetCultureID(@CultureName),@FieldName,@FieldDescription)
The ProjectField_Locale has another ID column (FieldCultureID) with the same Identity properties(I didnt write its name in the INSERT INTO statement because it will be added automatically too) so which Identity value I will get from @@Identity(the one from [ProjectField] table or the new one in ProjectField_Locale table?).
"I am too late but i will never give up"
|
|
|
|
|
I have this from the msdn Help:
"You can set the identity properties on only one column per table"
So, how can you have two columns with the same Identity property?
Sincerely,
Elina
Life is great!!!
Enjoy every moment of it!
|
|
|
|
|
I didn't mean in the same table.I meant FieldNO(Primary Key) in the first table(ProjectField) and FieldCultureID(Primary Key) in the second table(ProjectField_Locale).
The FieldNO in the second table has the Identity Property Disabled and it is a Foreign Key.
Sorry if I could't explain my question because it is complex.
"I am too late but i will never give up"
|
|
|
|
|
I think, it will be the identity of the ProjectField_Locale, but i am not 100% sure.
You can always test it with print statement.
Sorry, for not being able to help too much
Sincerely,
Elina
Life is great!!!
Enjoy every moment of it!
|
|
|
|
|
I am the one who should say Sorry...
I didnt understand the statement :
SET IDENTITY_INSERT [table name] ON
But after viewing several articles through the internet I understood it and then I found a solution for my problem and it worked perfectly:
DECLARE @AA INT
DECLARE @bb INT
SET @AA=(SELECT MAX(FieldNO) FROM ProjectField)+1
SET IDENTITY_INSERT [ProjectField] ON
INSERT INTO ProjectField (FieldNO)
VALUES (@AA)
SET @BB=@@Identity
INSERT INTO ProjectField_Locale (FieldNO,CultureID,FieldName,FieldDescription)
VALUES (@BB,dbo.GetCultureID(@CultureName),@FieldName,@FieldDescription)
INSERT INTO ProjectField_Locale (FieldNO,CultureID,FieldName,FieldDescription)
VALUES (@BB,dbo.GetCultureID(@CultureName2),@FieldName2,@FieldDescription2)
Ofcourse your first respond helped me to go in the right way..Thank you very much..I hope that we meet again in another exciting conversation
"I am too late but i will never give up"
|
|
|
|
|
|
I have a stored proc which populates a drop-down box in an ASP.NET datagrid. The user enters a part number and the datagrid populates based on that part number. The datagrid is already in edit mode using template columns.
What I would like to do on the SQL side if possible is the following:
a) If the part number does not exist, populate the drop-down box with all part types, and order by description. (Okay, this is no problem.)
b) If the part number DOES exist, populate the drop-down box with all part types, but list the saved description first, then list the rest by description.
This is what I have thus far:
CREATE PROCEDURE [dbo].[GetPartDescriptions]<br />
<br />
@PartNumber varchar (60)<br />
<br />
AS<br />
if NOT EXISTS (Select * from Parts where PartNumber = @PartNumber)<br />
BEGIN<br />
SELECT ID as ptID, Description from PartTypes pt ORDER by Description<br />
END<br />
<br />
GO
|
|
|
|
|
Sorry for not answering your question, but I have to ask you this question: Why would you have parts with the same part number? I would think that would be unique for each part type. No?
“Profanity is the attempt of a lazy and feeble mind to express itself forcefully”
|
|
|
|
|
Jerry Hammond wrote: Why would you have parts with the same part number
Parts is the table leckey is using and partnumber is the field.
Yes, the partnumber field ought to be unique for each part type.
|
|
|
|
|
Maybe I'm the confused one. Part b of your requirements seem to imply multiple parts (or part types) with the same part number.
“Profanity is the attempt of a lazy and feeble mind to express itself forcefully”
|
|
|
|
|
Sorry for wording my question poorly. The part number is indeed unique. What I am looking for is if the user enters a part number that already exists in the database, the dropdown list populates with the part type first, then the remaining part type choices alphabetically. If the part does not exist, just order alphabetically. I had a friend help me last week and got this:
CREATE PROCEDURE [dbo].[GetPartDescriptions2]<br />
<br />
@PartType varchar (60)<br />
<br />
AS<br />
<br />
SELECT PartTypes.ID, PartTypes.description,<br />
CASE when PartTypes.ID = @PartType then 1<br />
else PartTypes.ID<br />
end as order_by<br />
from PartTypes INNER JOIN parts p on p.PartTypeID = PartTypes.ID<br />
<br />
ORDER BY order_by<br />
<br />
But I was getting confused and the bolded parts are not right. I am passing in the part number so it should be something like this:<br />
<br />
<code>CREATE PROCEDURE [dbo].[GetPartDescriptions3] <br />
@PartNumber varchar (60)<br />
<br />
AS<br />
<br />
SELECT PartTypes.ID, PartTypes.description, Parts.PartNumber, Parts.PartTypeID<br />
CASE when PartTypes.ID = Parts.PartTypeID then 1<br />
else PartTypes.ID<br />
end as order_by<br />
from PartTypes INNER JOIN parts p on p.PartTypeID = PartTypes.ID<br />
<br />
ORDER BY order_by<br />
GO
But enterprise manager doesn't like that. Asked my friend and she sent me this:
You could get the Part Type by
Declare @PartTypeId int
select @PartTypeId = PartTypeId
from PartTypes where Partnumber = @PartNumber
I'm now having trouble figuring out where to stick this new select statement in the entire code.
GO
|
|
|
|
|
leckey wrote: ORDER BY order_by
Aren't you missing either ASC or DESC to tell it how you want to order the fetched recordset?
What do you mean by order_by ?
Usually it is a field or column name that comes after the ORDER BY .
|
|
|
|
|
hey, guys. i'm trying to build a generic usp, which i dont think is possible, so i may end up just making several different usp's that take the same parameters...what i'd love to do is
select @returnColumn
from @table
where @searchColumn=@searchValue
i know the above code wont work, but does anyone know some nifty trick to make something like that work?
Thanks
John
|
|
|
|
|
Something like this will work:
CREATE PROCEDURE GetColumn
@returnColumn varchar(100),@table varchar(100),@searchColumn varchar(100), @searchValue varchar(100)
AS
exec('select ' + @returnColumn + ' from ' + @table + ' where ' + @searchColumn + ' = ' + @searchValue)
But be sure to check out this article: SqlInjectionAttacks[^]
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
Thanks i never would have thought of that...i've been thinking about Sql Injection Attacks since i was told that i'd have to add this kind of functionality to the app...luckily this is only going to be run by a handfull of people in our office, and can only be run in our office...so all i should need to do is make sure that the input is alphanumeric characters only, no puncuntation(sp?) or spiecal characters i.e. *,%, etc.. and i should be ok...mabye.
thanks again for your help
john
|
|
|
|
|
i have sql server 2000 DATABASE i want to add columns to store sounds and another to store video files what type of column for each one (sound files&videos files)
ma_refay
|
|
|
|
|