|
Thanks, works great.
Not only does it work, but when I looked this method up in my SQL book it says that this is the prefered way to do this. Better to use a system view than to access system tables directly.
Now I know how to do this (and other things) with SQL Server, it would be nice to have a way that works with other Database systems (MySQL and Access in particular. None of the three methods listed here work with those two systems
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
To do this prgramatically (not query analyzer) Use the GetOledbSchemaTable[^] method of the OledbConnection object (or ADO connection.OpenSchema()[^]if not using .NET).
Absolute faith corrupts as absolutely as absolute power
Eric Hoffer
All that is necessary for the triumph of evil is that good men do nothing.
Edmund Burke
|
|
|
|
|
|
Thanks for the link
It seems INFORMATION_SCHEMA is new in version 5. I have version 4 here. Explains why I could not get it to work
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
it depends actually on which database you try to get the table names.
the answer you got seem to be for MS SQL Server, but it would have worked on Oracle DB.
you should type instead :
select table_name, table_type
from user_tables
order by table_type asc, table_name asc;
cheers,
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
how to insert data directly into ms sql server 2000 database by using asp.net with vb.net and how to update data.
|
|
|
|
|
search for ADO.NET for the access classes.
to insert, use the insert SQL command :
insert into table
list_of_columns_to_insert
values(list_of_values);
to update, use the update SQL command :
update table
setcolumn1 = value1,
column2 = value2
where condition;
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
This is C# which you can easily convert.
###########################################
string myType = "Type"; ' varchar on SQL Server
string myPropID = "12"; ' Int on SQL Server
string SQLstring = "UPDATE tblZtest SET PropertyType = '" + myType + "' " +
" WHERE zTest = " + myPropID
SqlConnection myConnection = new SqlConnection(ConnectionString);
myConnection.Open();
SqlCommand myCommand = new SqlCommand( SQLstring, myConnection );
myCommand.ExecuteNonQuery();
myConnection.Close();
##############################################
|
|
|
|
|
|
hi
I have some questions that I need to know the answers. These r in the ORACLE database.
Pleaaaaaaaaaaaaaaaaaaaaaaaaase, I need the answers sooooooooon.
answers any Q u can. Pleaaaaaaaaaaaaase.
the Q's r:
1-Write down SQL statement that shows free tablespace of one or more tablespaces. (In ORACLE)
2-Write down SQL statement that shows a particular table exists on which tablespaces.(In ORACLE)
3-. For example, one of the control file is deleted. When you start your database instance, you will receive message that database instance cannot startup. Write down steps how to resolve this task. Your steps must be outcome of implementation.(IN ORACLE)
4-Suppose you want to import data in one of the user’s schema, some tables with same names already existing in a schema. Write down tested imp command to accomplish it. Also, show the output result of your command.(IN ORACLE)
|
|
|
|
|
Sounds like you should have actually studied for this test.
Absolute faith corrupts as absolutely as absolute power
Eric Hoffer
All that is necessary for the triumph of evil is that good men do nothing.
Edmund Burke
|
|
|
|
|
|
Your questions are almost certainly either a class assignment or a test. You won't learn anything if someone on this site does the work for you. Before anyone will, you must make some effort to work out the answers yourself, most CP regulars will help with specific questions as to why whatever you tried is not working, but few will, or should , do the work for you.
Absolute faith corrupts as absolutely as absolute power
Eric Hoffer
All that is necessary for the triumph of evil is that good men do nothing.
Edmund Burke
|
|
|
|
|
believe me man. I searched in my material and did not find any thing. And I have to submit it tommorow. Or I will fail
I paid for this course alot and I do not want to fail...
|
|
|
|
|
Want to pay some more?
|
|
|
|
|
NOOOOOOOOOOOOOOO
|
|
|
|
|
1. speak english correcly, because if you're looking for answer, you should first be understood
2. do your homework by yourself
ps: have you failed actually ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Got a backup system that backs up directories. I want to backup all the databases, they could be hundreds and a few more every day. The problem is that SQL keeps the databases lock for reading, so I cannot back them up every night. I need to manually stop the server in order to back them up. Any way to schedule the server to stop at 3 AM to 5 AM? or something like that?
Al
|
|
|
|
|
from an admin account issue the console command "net stop mssqlserver"
You could place this command string in a batch file and schedule the batch file at the desired time.
another command file with
"net start mssqlserver"
could be used to restart the server.
Use start->settings->control panel->scheduled programs to invoke the scheduler wizard. select (browse to) your batch file as the program to schedule. set up the frequency and time, then select an administrative account for the user so that it has sufficient privelege to start or stop the service.
Absolute faith corrupts as absolutely as absolute power
Eric Hoffer
All that is necessary for the triumph of evil is that good men do nothing.
Edmund Burke
|
|
|
|
|
Good concept, just need to find out how long it takes to back it up as if I start the server before the backup finishes .... well
Fantastic idea, thanks
Al
|
|
|
|
|
you can copy only the DB data... in this case you have to copy only the modified/new data.
|
|
|
|
|
Rob,
Just to let you know. I added a schedule to stop the SQL server at night for 1 hour and to start the back up at that time. All works great. Thanks
Al
|
|
|
|
|
hi all,
i was importing the data from a another database, when it was completed, old data was deleted..means new data over write upon old data....
Plz tell me any method to recover the old data......
i am serious in trouble....
thanx
Sajjad
|
|
|
|
|
Hopefully you can restore a backup and try again. You did make a backup first, didn't you?
Absolute faith corrupts as absolutely as absolute power
Eric Hoffer
All that is necessary for the triumph of evil is that good men do nothing.
Edmund Burke
|
|
|
|
|
no i have not any backup .....
|
|
|
|