I need a script asap

  • Hi folks,

    Please let me know if it's possible or not...

    Suppose we have a sql server 2005 with some database 'Sample db' and it contains tables tb1,tb2,tb3.

    Using GUI we can right click on table tb1 and if we hit on 'OPEN TABLE' then it will open a window in sql which will let you to see the records,update as well as delete the records. Is there any script to perform this action????

    Is there any chance i can have a where clause in that script so tht i can open the table with filtered information????

    Reason: I am building a front end with sql as back end. If user hits a button on front end then it should open a table so that user can view,delete,update,insert the records on this table.

    Please share your ideas.

    Thanks in advance,

    SAM.

  • let you to see the records,update as well as delete the records.

    1. To "see" the records it is termed a SELECT statement. For example SELECT Column1, column2 FROM tb1 is a simplistic version, which can be modified by adding a "WHERE" clause. to make it read like thisSELECT Column1, column2 FROM tb1 WHERE column1 = some value

    2. There are also T-SQL statements to update rows and likewise there exists T-SQL statements that can delete rows ....

    Now if you can be more specific by posting table definition(s), providing some sample data, along with desired results some one can be more specific in answering your question. To do this quickly and easily click on the first link in my signature block for an article that explains how to display what I requested, and the article has T-SQL code for you to use to assist you.

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • Thanks for your reply.

    Please perform this action.

    Open SQL SERVER, OPEN some database, right click on some table . You will see open table option if you click on it sql server will open a window with all records. There you can see the records, update , insert and delete the records i,e you can edit the records.

    What i want is a script

    If i hit some button on front end it has to take me to this window directly so that the front end user will have access to edit data only on few tables.

    I hope you got it..

  • sam-1083699 (5/31/2011)


    Thanks for your reply.

    Please perform this action.

    Open SQL SERVER, OPEN some database, right click on some table . You will see open table option if you click on it sql server will open a window with all records. There you can see the records, update , insert and delete the records i,e you can edit the records.

    What i want is a script

    If i hit some button on front end it has to take me to this window directly so that the front end user will have access to edit data only on few tables.

    I hope you got it..

    You have to write all of that functionality into your client application. SSMS is just a client application itself - and you really do not want to use the open table functionality. That functionality is horribly broken and will - eventually - cause issues. In some cases, it will delete data you really didn't want deleted, or update rows that you didn't want updated as well as other issues.

    Jeffrey Williams
    “We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”

    ― Charles R. Swindoll

    How to post questions to get better answers faster
    Managing Transaction Logs

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply