Click here to Skip to main content
15,900,110 members
Home / Discussions / Database
   

Database

 
AnswerRe: Automatic Add and Update Pin
pmarfleet18-Oct-07 2:04
pmarfleet18-Oct-07 2:04 
GeneralRe: Automatic Add and Update Pin
Sarfaraj Ahmed18-Oct-07 2:26
Sarfaraj Ahmed18-Oct-07 2:26 
GeneralRe: Automatic Add and Update Pin
pmarfleet18-Oct-07 2:42
pmarfleet18-Oct-07 2:42 
Questionproblem in javascript Pin
Arihant rathi18-Oct-07 0:49
Arihant rathi18-Oct-07 0:49 
AnswerRe: problem in javascript Pin
pmarfleet18-Oct-07 1:57
pmarfleet18-Oct-07 1:57 
Questionquery Pin
venky45617-Oct-07 23:51
venky45617-Oct-07 23:51 
AnswerRe: query Pin
Imran Khan Pathan18-Oct-07 0:19
Imran Khan Pathan18-Oct-07 0:19 
QuestionData Encryption and Decryption in sql server/2005 Pin
nhss17-Oct-07 21:51
nhss17-Oct-07 21:51 
QuestionImporting Data From Excel Pin
Syed Mujtaba Hassan17-Oct-07 18:45
Syed Mujtaba Hassan17-Oct-07 18:45 
AnswerRe: Importing Data From Excel Pin
Sathesh Sakthivel17-Oct-07 20:01
Sathesh Sakthivel17-Oct-07 20:01 
GeneralRe: Importing Data From Excel Pin
Syed Mujtaba Hassan17-Oct-07 20:30
Syed Mujtaba Hassan17-Oct-07 20:30 
QuestionProblem with row concatenation [modified] Pin
Payal_e_m17-Oct-07 16:52
Payal_e_m17-Oct-07 16:52 
AnswerRe: Problem with row concatenation Pin
Colin Angus Mackay17-Oct-07 17:39
Colin Angus Mackay17-Oct-07 17:39 
GeneralRe: Problem with row concatenation Pin
Payal_e_m17-Oct-07 18:06
Payal_e_m17-Oct-07 18:06 
GeneralRe: Problem with row concatenation Pin
pmarfleet17-Oct-07 20:15
pmarfleet17-Oct-07 20:15 
AnswerRe: Problem with row concatenation Pin
manojm3917-Oct-07 20:18
manojm3917-Oct-07 20:18 
GeneralRe: Problem with row concatenation Pin
Payal_e_m18-Oct-07 16:28
Payal_e_m18-Oct-07 16:28 
QuestionHow to Install SSL in Workgroup Environment for SQL Server? Pin
DotNetWWW17-Oct-07 2:54
DotNetWWW17-Oct-07 2:54 
AnswerRe: How to Install SSL in Workgroup Environment for SQL Server? [modified] Pin
Mike Dimmick17-Oct-07 6:22
Mike Dimmick17-Oct-07 6:22 
GeneralRe: How to Install SSL in Workgroup Environment for SQL Server? Pin
DotNetWWW1-Nov-07 5:40
DotNetWWW1-Nov-07 5:40 
QuestionDynamic ColumnName in Stored Procedure Pin
Herman<T>.Instance17-Oct-07 2:27
Herman<T>.Instance17-Oct-07 2:27 
AnswerRe: Dynamic ColumnName in Stored Procedure Pin
Colin Angus Mackay17-Oct-07 2:40
Colin Angus Mackay17-Oct-07 2:40 
You are using dynamic SQL where you are concatenating a string together to make a full statement. You have not sanitised the values @Table, @FieldInTable and @CodeInGrid. This means your application is susceptable to a SQL Injection Attack. Please read this[^]

All column and table names are nvarchar(128)

If you must do this then please check that @Table and @FieldInTable (actually, they are called columns in SQL Server) are valid first

This might be a starting point for the checking that the table and column name are valid:
SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = @Table

SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME = @fieldInTable AND TABLE_NAME = @Table

Also, table and column names should be wrapped in square brackets in case they contain obscure characters or whitespace.

@CodeInGrid I presume is an integer as you don't wrap it in apostrophes in your dynamic SQL. If so pass it as an integer and NOT as any sort of string type. This can easily be cast to a string for concatenation with the rest of the satement.


Upcoming FREE developer events:
* Glasgow: SQL Server Managed Objects AND Reporting Services ...

My website

GeneralRe: Dynamic ColumnName in Stored Procedure Pin
Herman<T>.Instance17-Oct-07 3:03
Herman<T>.Instance17-Oct-07 3:03 
GeneralRe: Dynamic ColumnName in Stored Procedure Pin
Colin Angus Mackay17-Oct-07 3:11
Colin Angus Mackay17-Oct-07 3:11 
GeneralRe: Dynamic ColumnName in Stored Procedure Pin
Colin Angus Mackay17-Oct-07 3:38
Colin Angus Mackay17-Oct-07 3:38 

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.