|
i think you have set up the relation between the two tables in the dataset memory, hence your parent table which contains is taken as the primary key.
Please check out this.
|
|
|
|
|
Thank you guys for helping me ... jesus ... like i said i'm novice in .NET, i've used VB6 before, but it's completly different, and i've used with Ms ACCESS ... please, can you guys give me just a little example using the code that i'm using or just the code that is missing to resolve that, please!!!
|
|
|
|
|
I am using sql-server 2000 database. i am trying out document managment . can anybody tell me How do i store an MS-OFFICE document into a database table. i have created a table with the the column name as "document" datatype as varbinary.
Any help would be welcome
anil g
-- modified at 11:41 Wednesday 14th December, 2005
|
|
|
|
|
varbinary is unlikely to be large enough (unless you are using SQL Server 2005) as its maximum size is just under 8K. You need to create the column as an image (the 2Gb limit should be sufficient for office files.)
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious
|
|
|
|
|
thanks for the tip. Also can you guide me with the sql statements for storing
it as an image ?
|
|
|
|
|
Ok im sure this is simple but im new to SQL and dont want to mess things up so your assistance please.
Im using a MS SQL server, which holds client contact details. However in the email field some contacts do not contain properly formatted email adresses.
eg www.somewhere.com rather than someone@somwehere.com
So what sql statement would i run to delete these fields?
Is it as simple as:
Delete * From table WHERE email NOT LIKE %@%
(im looking for records without a '@' symbol)
Thanks!
|
|
|
|
|
try this
delete from table where email not like %@%
--this query deletes all rows in which doesnt exists character @
|
|
|
|
|
Yeah,
Thought so!
Thanks for confirming.
|
|
|
|
|
u are welcome
|
|
|
|
|
OK all. I installed VS2005 Pro with SQL Express. No problems. I went to the Microsoft Learning Center[^] web site for the Visual Web developer and started watching the videos. However, when I try to follow the Lesson 8 video, I can't get the Advanced SQL Connection options to show themselves (they are all greyed out). So when I try to add a control that allows data editing to an ASPX page, I can't turn on the editing feature. Is this something in SQL Express I have to configure?
Regards,
Brigg Thorp
Senior Software Engineer
Timex Corporation
|
|
|
|
|
Help!
I installed VWD 2005 with SQLEXPRESS 2005 and the management tools. Now when I try to create a new DB in VWD I get a error "Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance."
Please help.
Illegal Operation
Making Computer Software Talk
|
|
|
|
|
|
update command for interchanging to field values
ex.
f_name L_name
--------------------------
a b
c d
by mistake f_name went to l_name and vise varsa
|
|
|
|
|
Hi,
Why don't u try with cursors......
e.g
DECLARE authors CURSOR FOR
SELECT au_id, f_name, l_name
FROM authors
OPEN authors
FETCH NEXT FROM authors
INTO @au_id, @au_fname, @au_lname
WHILE @@FETCH_STATUS = 0
BEGIN
Update author_master
SET f_name = @au_lname,
l_name = @au_fname
WHERE au_id = @au_id
FETCH NEXT FROM authors_cursor
INTO @au_id, @au_fname, @au_lname
END
CLOSE authors
DEALLOCATE authors
GO
I hope this will help u....
Regards,
Ritesh
|
|
|
|
|
|
Simply run the update command. Below is a sample.
CREATE TABLE dbo.ctm
(
id numeric(18,0) IDENTITY,
col1 varchar(20) NULL,
col2 varchar(20) NULL
)
go
INSERT INTO dbo.ctm ( col1, col2 ) VALUES ( 'aa', 'bb' )
INSERT INTO dbo.ctm ( col1, col2 ) VALUES ( 'cc', 'dd' )
SELECT T.id, T.col1, T.col2 FROM dbo.ctm T
update ctm
set col1 = col2, col2 = col1
SELECT T.id, T.col1, T.col2 FROM dbo.ctm T
|
|
|
|
|
Hi experts,
I have the following problem when saving data from an XML-file to a database using the OleDbDataAdapter:
I'm using a typed dataset, derived from the xml-schema.
I load the xml-file into the dataset and try to save the data to the database. (the dataAdapter has all the commands (select, insert, update, delete) properly configured.
When it's all new data, there's no problem, all data is saved correctly.
But it's also possible that the xml-file contains data that is already in the database (primary key already exists), so this data needs to be updated (instead of re-inserted)(this is what a dataAdapter takes care of, right ?)
I tried 2 approaches:
1) Only loading the xml-data into the dataset:
When i use the update-method of my dataAdapter and there is data that is already in the database (primary key already exists) i get an oleDbException.
2) First load the database-data in the dataset, and then load the xml-file in the dataset:
I get a ConstraintException while loading the xml-data because primary key already exists in the datatable of the dataset.
How can I fix this problem so that I get 1 table with updated old data and inserted new data ?
Any help is much appreciated... Thanks in advance...
John
|
|
|
|
|
I need to Get data from my Sql Server 2000 database from my web site host to my local dataserver. I need to do this in a way that the data is secure. I can use Enterprise manager to import data but this is not secure or is it?
Thanks
|
|
|
|
|
You could use ASP.NET and encryption. See this.[^]
Farhan Noor Qureshi
if (this == this) thow this;
|
|
|
|
|
Here is the situation:
The user logs onto the database and calls a sql server extended stored procedure. I wrote the extended stored procedure in C/C++. How do I call another stored procedure from the C/C++ code? I want to do this without connecting to the database again (the extended stored procedure is already running within the sql server process). What is the API I should use (if there is any)?
My articles and software tools
|
|
|
|
|
|
|
When creating a StoredProcedure (listed below) in Microsft SQL Server Express, I receive the following un-expected error:
Error 195: 'SUM' is not a recognized function name.
The listing of the StoredProcedure is as below:
CREATE PROCEDURE GetProductUnits
@ProductID AS int
AS
BEGIN
SELECT Products.ProductID, Products.ProductName,
Products.UnitsInStock, UnitsOnOrder,
SUM([Order details].quantity AS UnitsSold)
FROM
Products INNER JOIN [Order details]
ON Products.ProductID=[Order details].ProductID
WHERE
Products.ProductID=@ProductID
GROUP BY
Products.ProductID, Products.ProductName,
Products.UnitsInStock, UnitsOnOrder
END
Any suggestion is highly appreciated.
|
|
|
|
|
R. A. Abbasi wrote: SUM([Order details].quantity AS UnitsSold)
try
SUM([Order Details].quantity) as UnitsSold
|
|
|
|
|
Thanks Al Ortega - you got an eagle's eye.
Regards.
|
|
|
|