|
-
Sep 1st, 2005, 02:24 PM
#1
Thread Starter
Hyperactive Member
Stored Proc for new record in SysObjects
Does anyone know if there is a system stored procedure available for inserting new rows into the sysobjects table?
I have looked throughout the Master database but cannot find one.
"The passion lives to keep your faith, though all are different, all are great" ... Michael Hutchence 1960-1997.
Windows & Web Developer
Specialising in Visual Basic .Net & Client Server Programming & Client/Customer Relations Databases
Sutherland Shire, Sydney Australia
www.stingrae.com.au
Developer of Arnold - Gym & Martial Arts Database Management System
www.gymdatabase.com.au
-
Sep 1st, 2005, 02:43 PM
#2
Re: Stored Proc for new record in SysObjects
Why do you want to insert rows into a system table?
Wouldn't it be better to create your tables/views using the normal methods (through the user interface, or with SQL statements)?
-
Sep 1st, 2005, 03:23 PM
#3
Thread Starter
Hyperactive Member
Re: Stored Proc for new record in SysObjects
Why do you want to insert rows into a system table?
I'm just a simple programmer and I have my orders!
"The passion lives to keep your faith, though all are different, all are great" ... Michael Hutchence 1960-1997.
Windows & Web Developer
Specialising in Visual Basic .Net & Client Server Programming & Client/Customer Relations Databases
Sutherland Shire, Sydney Australia
www.stingrae.com.au
Developer of Arnold - Gym & Martial Arts Database Management System
www.gymdatabase.com.au
-
Sep 1st, 2005, 09:04 PM
#4
Re: Stored Proc for new record in SysObjects
That doesn't seem like a good idea to me... it is something that I have never seen a need for, and could cause serious issues.
There are times when you should question your "orders", and this is one of those times.
-
Sep 1st, 2005, 10:23 PM
#5
Re: Stored Proc for new record in SysObjects
I'm with si on this.... in fact, it jsut osunds down right dangerous....
-tg
-
Sep 2nd, 2005, 03:49 AM
#6
Re: Stored Proc for new record in SysObjects
 Originally Posted by stingrae
I'm just a simple programmer and I have my orders! 
I totally agree with si_the_geek and techgnome. You should never write directly to the system tables. Use DDL (Data Definition Language, like CREATE, ALTER, DROP) and system stored procedures like sp_rename if you want to do modifications to objects.
Tell your boss that the guys at VBForums told you not to do what he told you to do
-
Sep 2nd, 2005, 06:23 AM
#7
Re: Stored Proc for new record in SysObjects
If your goal is to add columns to tables, or alter tables - it would be much better to develop a program to create a DDL script to perform those actions.
We have programs our mainframe systems that will create DDL scripts to "create" the entire SQL database, tables and index structure - by simply analyzing the mainframe database/table structure information.
If your goal is to develop a program similar to ENTERPRISE MANAGER - that performs table creation and modification - then yes, there are system stored procedures to do what you are asking about. Many of them are not documented. EM most likely uses these to do much of what it does in design mode, on a table. It also creates complex scripts to move columns around - so it's not all done one way.
For example, go into BOOKS ONLINE, and lookup SP_RENAME - this system sproc will change the name of an object in SYSOBJECTS. You can look at the "source" for this sproc in the MASTER database and even see how it does it.
All of this is very complex - there are many relationships between the system tables. Also, it can all change from one version of MS SQL to the next.
-
Sep 4th, 2005, 09:38 PM
#8
Re: Stored Proc for new record in SysObjects
stingrae,
What would be the purpose for this type of operation. Sounds like he person that gives orders does not know much about what need to be done or how to accomplish it.
There has NEVER EVER been a reason a user needed to directly access the System Tables.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|