Click here to Skip to main content
15,901,122 members
Home / Discussions / Database
   

Database

 
GeneralOleDbDataAdapter Vs ExecuteNonQuery Pin
myNameIsRon6-Jun-05 18:22
myNameIsRon6-Jun-05 18:22 
GeneralRe: OleDbDataAdapter Vs ExecuteNonQuery Pin
Christian Graus6-Jun-05 18:27
protectorChristian Graus6-Jun-05 18:27 
GeneralRe: OleDbDataAdapter Vs ExecuteNonQuery Pin
myNameIsRon6-Jun-05 18:55
myNameIsRon6-Jun-05 18:55 
GeneralRe: OleDbDataAdapter Vs ExecuteNonQuery Pin
Christian Graus6-Jun-05 18:59
protectorChristian Graus6-Jun-05 18:59 
GeneralRe: OleDbDataAdapter Vs ExecuteNonQuery Pin
Colin Angus Mackay6-Jun-05 21:30
Colin Angus Mackay6-Jun-05 21:30 
GeneralASP.NET and DAAB Pin
cbh5g6-Jun-05 9:53
cbh5g6-Jun-05 9:53 
GeneralUsing a Stored Proc parameter as a tablename Pin
Dan Neely6-Jun-05 8:16
Dan Neely6-Jun-05 8:16 
GeneralRe: Using a Stored Proc parameter as a tablename Pin
Colin Angus Mackay6-Jun-05 8:24
Colin Angus Mackay6-Jun-05 8:24 
You cannot do this in the way you are trying. However, you can create some dynamic SQL and execute that.

What you do is create a string in SQL Server, say a varchar(1000), and build the CREATE TABLE statement into the string.

Once you have built the string you can then do EXEC(@MySqlStatement)

However, be aware that this carries a security risk with it as it could more easily be the weak point for a SQL Injection Attack (See SQL Injection Attacks and Tips on How to Prevent Them[^] for more information).

To help mitigate the risk your stored procedure should ensure that the @Tablename parameter contains only valid characters (say 0-9, a-z, and an underscore) before building the dynamic SQL Statment and running it.

Does this help?


My: Blog | Photos
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More


GeneralRe: Using a Stored Proc parameter as a tablename Pin
Dan Neely6-Jun-05 8:38
Dan Neely6-Jun-05 8:38 
GeneralAvoid NULL values, causes Exception Pin
Miekec6-Jun-05 5:41
sussMiekec6-Jun-05 5:41 
GeneralRe: Avoid NULL values, causes Exception Pin
Luis Alonso Ramos6-Jun-05 7:00
Luis Alonso Ramos6-Jun-05 7:00 
GeneralRe: Avoid NULL values, causes Exception Pin
Colin Angus Mackay6-Jun-05 8:17
Colin Angus Mackay6-Jun-05 8:17 
GeneralProductColumn Pin
albCode6-Jun-05 2:42
albCode6-Jun-05 2:42 
GeneralRe: ProductColumn Pin
oykica6-Jun-05 7:14
oykica6-Jun-05 7:14 
GeneralRe: ProductColumn Pin
Colin Angus Mackay6-Jun-05 8:13
Colin Angus Mackay6-Jun-05 8:13 
GeneralRe: ProductColumn Pin
oykica7-Jun-05 7:14
oykica7-Jun-05 7:14 
GeneralRe: ProductColumn Pin
Colin Angus Mackay6-Jun-05 8:15
Colin Angus Mackay6-Jun-05 8:15 
GeneralRe: ProductColumn Pin
oykica7-Jun-05 6:59
oykica7-Jun-05 6:59 
GeneralNHibernate: Criteria query - Parent's property as select criteria. Pin
devvvy5-Jun-05 22:01
devvvy5-Jun-05 22:01 
GeneralRe: NHibernate: Criteria query - Parent's property as select criteria. Pin
Jeff Martin6-Jun-05 12:37
Jeff Martin6-Jun-05 12:37 
GeneralRe: NHibernate: Criteria query - Parent's property as select criteria. Pin
devvvy6-Jun-05 16:18
devvvy6-Jun-05 16:18 
GeneralNumbers of rows different in Q.A and in E.M.!! Pin
under28115-Jun-05 18:20
under28115-Jun-05 18:20 
GeneralRe: Numbers of rows different in Q.A and in E.M.!! Pin
Colin Angus Mackay5-Jun-05 20:53
Colin Angus Mackay5-Jun-05 20:53 
GeneralRe: Numbers of rows different in Q.A and in E.M.!! Pin
under28115-Jun-05 21:21
under28115-Jun-05 21:21 
GeneralRe: Numbers of rows different in Q.A and in E.M.!! Pin
Colin Angus Mackay5-Jun-05 22:42
Colin Angus Mackay5-Jun-05 22:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.