|
|
You could look in the table sysobjects (or this may be different if you are using a different database type)
'--8<------------------------
Ex Datis:
Duncan Jones
Merrion Computing Ltd
|
|
|
|
|
STOP YELLING !!!
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
What is the database that you are using.
Assuming its SQL Server
To get an *approximate* count for all tables, you can use the following:
SELECT
[TableName] = so.name,
[RowCount] = MAX(si.rows)
FROM
sysobjects so,
sysindexes si
WHERE
so.xtype = 'U'
AND
si.id = OBJECT_ID(so.name)
GROUP BY
so.name
ORDER BY
2 DESC
|
|
|
|
|
SELECT
[TableName] = so.name,
FROM
sysobjects so
WHERE
so.xtype = 'U'
ORDER BY
so.name
|
|
|
|
|
got a problem:
table(with names A, B):
A B
----------
1 Hallo
1 wie geht es dir?
2 schlecht!
3 nein,
3 eigentlich gut!
I want the result:
A B Resultat C
-------------------------------------------
1----Hallo----------------
1----wie geht es dir?-----Hallo wie geht es dir?
2----schlecht!------------schlecht!
3----nein,----------------
3----eigentlich gut!------nein, eigentlich nicht
Thank`s for helping!!!
nico
|
|
|
|
|
Try this:
First) You must create a "user defined function" (T SQL function)
like this
CREATE FUNCTION SSum (@a INT) //SSum = string sum
RETURNS NVARCHAR(255) AS
BEGIN
DECLARE @ssum NVARCHAR(255)
DECLARE @b NVARCHAR(25)
SET @ssum = ''
DECLARE crs CURSOR FOR SELECT B FROM table WHERE A = @a
OPEN crs
FETCH NEXT FROM crs INTO @b
WHILE( @@FETCH_STATUS = 0 )
BEGIN
SET @ssum = @ssum + '-' + @b
FETCH NEXT FROM crs INTO @b
END
CLOSE crs
DEALLOCATE crs
IF( LEN(@ssum) != 0 )
SET @ssum = SUBSTRING(@ssum,2,255)
RETURN @ssum
END
Second) Build a SELECT query using SSum function like this:
SELECT DISTINCT A , dbo.SSum(A) AS Result
FROM table
---
object oriented
uml oriented
iconix oriented
sql oriented
truespace oriented
---
solitare oriented
|
|
|
|
|
Hi,
I have .MDF ,SQL server DB files.
How to import those data or how to open .MDF files to the sql server or any other DB .
Pls help
Ram
|
|
|
|
|
Just install a copy of SQL Server or MSDE and attach database files with sp_attach_db system stored procedure.
If you use MSDE and you don't have Enterpreise Manager you may use
osql or isql
commnad prompt tool.
object oriented
uml oriented
iconix oriented
sql oriented
truespace oriented
---
solitare oriented
|
|
|
|
|
hey i would like to "trigger" methods on a remote pc when my database changes(update occurs) the remote program is my GUI and the methods get the info from the database. How would i program this? would i need to write a smll app on the sql server and then let it some how call the remote methods or trigger them? please include code as i dont know anything. v new to coding in C#.
thanks
|
|
|
|
|
|
Be carefull if using sp_OACreate to run a COM component. ActiveX dll's typically run in process which means they are running in the same memory as your database. A badly written dll is likely to corrupt memory in the SQL Server environment which could be containing some of your data. Although you can get it to run out of process it is not an easy thing to set up. An ActiveX.exe will run out of process by default.
Jon
|
|
|
|
|
Hello,
I am developing an application where I need to load custom data to Analysis Server (MS-OLAP) without going through any OLE DB
Provider. I am able to load data into dimensions/cubes using Microsoft OLE DB provider for ODBC Drivers. But my requirement is loading data at runtime from a buffer. Is there any way to do this? Are there any APIs which can help me to load this data directly?
Thanks & regards,
|
|
|
|
|
I found many articles in web and feel it is not clear for connect Oracle 9i later with .net framework 2.0 beta 2.
Some namespace like OracleClient could not be used,and new System.Data.Common does not have examples.
The ODP.NET seems need to download some libary.After downloading a lib writen at 2002, the vs.net 2005 does not has any change.
Could you show me some examples?
Thanks a lot!
|
|
|
|
|
Hi!
One possibility is to use an oleDBConnector (using System.Data.OleDB).
OleDBConnection oleDdCon = new OleDbConnection("Provider=OraOLEDB.Oracle;Data Source=" + sDataSource + ";User ID=" + sUserID + "; Password=" + sPWD);
oleDBCon.Open();
-- modified at 7:49 Wednesday 14th September, 2005
|
|
|
|
|
Hi, I'm still new to sql server 2005 express integrated with VS.NET 2005 Beta 2. I'd like to import my data from Access into my newly created table in sql server 2005 express. How can I do so? Thank you so much.
KiT
|
|
|
|
|
What you like/dislike at OODBMS ?
What you want from a OODBMS ?
object oriented
uml oriented
iconix oriented
sql oriented
truespace oriented
---
solitaire oriented
|
|
|
|
|
how to change the permits on a data base in csharp
|
|
|
|
|
Check if your database management system suport GRANT / REVOKE
SQL commands !
|
|
|
|
|
If you talk about how to grant and revoke permissions
you can send it as sql statment to sql server
SqlCommand sqlCommand =new SqlCommand("GRANT SELECT ON authors TO xyz",yourConnection);
sqlCommand.CommandType=CommandType.Text;
sqlCommand.ExecuteNonQuery();
MCAD
|
|
|
|
|
i ned to do a system same that the enterprise manager in csarp and i need help how to do or change the permits in the data base and what tables have
|
|
|
|
|
if you ant to build tool like Sql server enterprise manager you can use SQL-DMO if you want to builed it in managed way you can look at
QueryCommander SQL Editor
[^] as start
MCAD
|
|
|
|
|
SQLDMO is the easy way.
Also you can use system tables and system stored procedures: sysobjects, etc.
|
|
|
|
|
Hi,
I have a several tables defined by an xsd schema which are also
loaded into an ADO DataSet via DataSet.ReadXMLSchema(...)
(they are of the MS specific dataset schema)
I wish to create matching tables in a SQL Server database programatically
using ADO.NET (something like the complement of DataAdapter.FillSchema(...))
without having to explicitly write SQL statements after traversing the DataTable
objects (e.g. SqlCommand mySqlCommand = new SqlCommand("CREATE TABLE...")).
OR
find a utility which will convert my MS dataset xsd file into a script
which can be used, say by sqlcmd.exe, to create tables on a SQL Server 2005
instance.
Am I being too lazy, or is there an existing solution for this problem?
Thanks,
Eric Smith
|
|
|
|
|
Is this anything wrong with this query?
CREATE TABLE [1384/6] (OrderTable int NOT NULL ,OrderNo int NOT NULL,OrderTypeIDn nvarchar(20) NOT NULL,Report nvarchar(254) NOT NULL,Receptionist nvarchar(50) NOT NULL ,Cashier nvarchar(254) NOT NULL,Day nvarchar(15) NOT NULL,TimeInstant nvarchar(15) NOT NULL,Description nvarchar(254) )
I am using this query with OleDb on an access database.
-- modified at 13:25 Wednesday 31st August, 2005
|
|
|
|