Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server ASP
|
SQL Server ASP Discussions about ASP programming with Microsoft's SQL Server. For more ASP forums, see the ASP forum category.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server ASP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 20th, 2006, 02:32 AM
Registered User
 
Join Date: Mar 2006
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default pass table name from asp to sqlserver stored prcdr

Hi,
  can anyone tell how to pass the table name from asp to sql server stored procedure which contains the SELECT * FROM /tablename passed/

 
Old April 20th, 2006, 04:16 AM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

Hi KGANESH2006 !!

in this case you need to create dynamic string for query .
.when you passe tablename in storedprocedure you need to append it into the query string in SP, then use exec(stringSql) method in order to execute the dynamic build query named stringSql
Hope this will help you


Cheers :)

vinod
 
Old April 25th, 2006, 10:55 AM
Friend of Wrox
 
Join Date: Dec 2005
Posts: 146
Thanks: 0
Thanked 1 Time in 1 Post
Default

When you execute Dynamic SQL you need to be aware of how to prevent SQL Injection Attacks.
See here for an example http://www.unixwiz.net/techtips/sql-injection.html


David Lundell
Principal Consultant and Trainer
www.mutuallybeneficial.com
 
Old April 26th, 2006, 01:28 AM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

Hi David,
  Excellent link for sql injection attacks.

Thanks Again

Cheers :)

vinod





Similar Threads
Thread Thread Starter Forum Replies Last Post
how to pass value to stored procedure? hertendreef SQL Server 2005 3 February 23rd, 2007 11:43 AM
How to display a picture stored in SqlServer yiyufeiyang BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 1 March 27th, 2006 10:14 PM
evaluate asp.net code stored in DB table jpamental ASP.NET 2.0 Professional 1 February 13th, 2006 01:32 PM
How will I pass stored procedure in an asp shoakat SQL Server 2000 1 July 15th, 2004 10:28 PM
Pass-through queries vs stored procedures kendawg Access 2 October 8th, 2003 02:00 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.