|
Try EXEC MyTestDB.dbo.sp_tables
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
|
|
|
|
|
Hello,
The "EXEC MyTestDB.dbo.sp_tables" WORKED!!!
Thanks that is exactly what I needed.
|
|
|
|
|
Hi *.*!
I don't seem to figure out how to store an Image in the database. I have thumbnail-sized images (up to 5k) and need to store them. What db-datatype should I use? How can I effectively read and write the value?
Thanks in advance!
Matthias
In theory, there is no difference between theory and practice. In practice, however, there is.
(unknown author)
|
|
|
|
|
http://codeproject.com/cs/database/albumviewer.asp[^]
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
Thanks!
Matthias
In theory, there is no difference between theory and practice. In practice, however, there is.
(unknown author)
|
|
|
|
|
Hi, ALL. There is a small problem. A have two tables in master-detail relationships (farther-child). Master table is bound to DataView object. How can I apply filtering conditions on the child table. In other words, how can I refer to child table within RowFilter string.
|
|
|
|
|
Hello,
I was wondering what the best way to check if a database exists, so it can be created if it doesn't in SQL server?
Right now I just use a try catch block, and see if it fails, but is there a better way since the "_com_error &e" try catch shows the same hresult on all sql errors when using Visual C++ .Net.
Thanks in advance for any help!!
|
|
|
|
|
|
Excellant that is exactly what I needed!! Thanks, it worked great!
Thanks again!!!
|
|
|
|
|
Hi all,
I am trying to create a table in an MS Access DB, from my app. I want to set the "AllowZeroLength" property of a field in the new table to "yes". How can i specify that in the "Create table" statement ? Or atleast in an "Alter table" statement ?
Thanks
Smitha
It's easy to sit there and say you'd like to have more money. And I guess that's what I like about it. It's easy. Just sitting there, rocking back and forth, wanting that money.
|
|
|
|
|
I have an table like this:
Date | Priority | PrimaryKey
====== ========= ======
12/2/2002 101 1
12/3/2002 101 2
12/4/2002 101 3
12/5/2002 101 4
12/6/2002 111 5
12/11/2002 111 6
12/12/2002 111 7
12/13/2002 111 8
12/4/2002 121 9
12/14/2002 121 10
12/15/2002 121 12
12/16/2002 121 13
I want to make query command to get ONLY PRIMARYKEY of minimum date for each group of prirority:
12/2/2002 101 1
12/6/2002 111 5
12/4/2002 121 9
If I use this command:
select min(Date),PrimaaryKey from table3 where (Date< GetDate() ) group by Priority
I'll get two column but I have to only get PrimaryKey column because I want to use in WHERE of UPDATE command.
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
What database are you using? SQL Server 7.0, SQL Server 2000, MS Access, Oracle, etc...
If you are using SQL Server then you could do something like this:
Select a.Date, a.Priority, a.PrimaryKey
From table as a INNER JOIN
(Select Priority, Min(Date) as Date
From table
Group by Priority) as b
on a.Priority = b.Priority
and a.Date = b.date
Let me know if this doesn't work or if you are using a different database.
Jeremy Oldham
|
|
|
|
|
Thanks for reply.
joldham wrote:
What database are you using?
SQLServer 2000.
I'm not at my desk to test your command but I got the point from it.Thanks again.
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
I am playing around with a DataSet and a relational database. The following code does work...
MessageBox.Show (profileSet.Tables["Profiles"].Rows[0]["TextureID"].ToString());
My questions are:
Does the DataSet contain a table with the Text value for the TextureID key?
If yes, what would the code look like to access it?
Thanks
Paul
|
|
|
|
|
Paul Silvernail wrote:
Does the DataSet contain a table with the Text value for the TextureID key?
No.You have to cast to string.
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
Guess I should have been a little more clear. I wanted to look up the value that the TextureID identified in a Textures table. From what I can tell, I need to make another adapter to look up the value.
I know the dataset has a collection of tables and I thought (more like hoped) that tables were added for each column that was a key.
|
|
|
|
|
Hi All,
I was trying to read a memo field with the following code ....
string strComment = TestpitReader.GetString(4);
Could someone correct what I am doing wrong ??
Thanks
Paul
|
|
|
|
|
What kind of error are you getting? Return the field as an object and check the type. Is it possible it isn't what you expect?
|
|
|
|
|
I just found the error.
My database did not have an empty string for the default value. When I tried to read a memo with no value I got a "Specified cast is not valid" error.
Thank you for responding !!
Paul
|
|
|
|
|
Hi
I let SQL create me a create script for some stored procedures that has changed. The problme is how do I run this. I thought dropping this as CommandText for a SqlCommand would be OK, but this is not the case. Lotsa errors with GO statement. This what I get from SQL:
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[SelectUser]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[SelectUser]
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE dbo.SelectUser
@id bigint
AS
SET NOCOUNT ON;
SELECT ID, Username, Password, Email, Name, Sex, HomeTel, Language, WorkTel, CellTel, Address, City, Province, IDNr, PostalCode, JoinDate, Views,
HomeShow, WorkShow, CellShow
FROM Users
WHERE (ID = @id)
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
I have pasted this code in query analyser and it runs flawlessly. What am I doing wrong?
Cheers
DBHelper - SQL Stored Procedure Wrapper & Typed DataSet Generator for .NET
|
|
|
|
|
|
You should be calling a stored proc instead of trying build the script each time and call it.
|
|
|
|
|
Mark Nischalke wrote:
You should be calling a stored proc instead of trying build the script each time and call it.
I'm trying to run a create script (that Enteprise Manager creates ) so changes in my stored procedures on the development machine can be reflected on the production machine. As simple as that! Just a one time run to make sure the production server is up to date really.
After that, the webserver can call the modified procedures properly.
DBHelper - SQL Stored Procedure Wrapper & Typed DataSet Generator for .NET
|
|
|
|
|
Just so I understand. You are creating stored procs on your development machine and want them reflected on the production machine?
Ever heard of replication?
|
|
|
|
|
Mark Nischalke wrote:
Just so I understand. You are creating stored procs on your development machine and want them reflected on the production machine?
No, I am changing, and perhaps creating new ones...
Mark Nischalke wrote:
Ever heard of replication?
How do you propose I use replication over the web? Especially when the SQL server is provided by the ISP?
DBHelper - SQL Stored Procedure Wrapper & Typed DataSet Generator for .NET
|
|
|
|