Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Help on creating Dynamic Row for any Table.

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-05-09 : 22:23:33
Kruti writes "hi,
i am using SQL Server 2000 and OS MS 2000.
i have following table structures.
UniqueTableID:
TableName varchar 25 0
TableUID varchar 25 0
UserUID varchar 25 0
TableDate datetime 8 1
srNO numeric 9 0

UniqueColID:
ColName varchar 50 0
SrNo numeric 9 0
TableUID varchar 25 0
ColUID varchar 25 0
UserUID varchar 50 0
ColDate datetime 8 1
AllowNull bit 1 1
DefaultValue varchar 50 1
ColType varchar 25 1
ColLength numeric 9 1


UniqueRowID:
TableUID varchar 25 0
RowUID varchar 25 0
UserUID varchar 25 0
RowDate datetime 8 1
srNO numeric 9 0

I am creating a dynamic table, say 'MyTable'. This will create a new table with given name and create a Unique ID for it and add data into UniqueTableID.

Now, I am creating/adding a new column to this table. This will add new column into that table as well as create a Unique ID for that column and add data into UniqueColID.

I am using stored procedures to do all functions as above.
Now, i want to add a row into that column. User will give only Table Name. Now, I can know the no. of Columns into the Table. And I want to add a row with Unique Row ID which i can get from a stored procedure. But how can i add values of other columns. I have 'defalultValue' for each column which i can retrive from table 'UniqueColID'.
I can do this by taking these data into a RecordSet in my ASP Page. But, i want these data into my stored Procedure.

How, can I do this?

Hope, i can make you properly understood about my problem.

Regards,
Kruti."

robvolk
Most Valuable Yak

15732 Posts

Posted - 2005-05-09 : 23:02:39
Top Ten List of Worst. Ideas. Ever. :
10. Inflatable Vibrators
9. Habanero Decongestant Spray
8. Blind epileptic children working in a nuclear reactor submarine
7. Dehydrated water
6. New Coke
5. Buy-one-get-one-free Rabid Pit Bull Sale!
4. Octogenarian Nude Skydiving
3. Crunchy Frog & Anthrax Ripple Candy
2. French-kissing an electrical outlet
And the #1 Worst. Idea. Ever.:
 1. What you're trying to program here
Go to Top of Page

DonAtWork
Master Smack Fu Yak Hacker

2167 Posts

Posted - 2005-05-10 : 12:21:39
9. Habanero Decongestant Spray <<---- wtf it works better than any other on the market
Go to Top of Page

Beachsandintoes
Starting Member

15 Posts

Posted - 2005-05-10 : 13:57:30
Kruti,

While your requirements are a little unclear, what you are describing can be done. You are correct, you will need to pass the variables into a stored procedure. Can you show us what you have so far?

- Beach
Go to Top of Page
   

- Advertisement -