I have a form into which the visitor can enter data, and I want to store this data in a mysql database via the $_POST variable. What do I need to prevent sql injection?
I have some doubt as follows
We are UPDATING a field in SQL and ALTER the row also.After giving the COMMIT command the system is crashed.Wat will happen to the commands given,whether it will UPDATE and ALTER the table r not?
Hi I've got some SQL ...
SELECT
AdviceNo,
Registration
FROM tblSalesDetail
that produces something like ...
ADV00001, ABC123
ADV00001, CDE564
ADV00002, FGE432
ADV00003, HUY789
ADV00003, MJS532
ADV00003, JFY428
Can anyone tell me how I'd adjust it to see the following please?
ADV00001, ABC123, 1
ADV00001, CDE564, 2
ADV00002, FGE432, 1
ADV00003, HUY789, 1
ADV00003, MJS532, 2
ADV00003, JFY428, 3
how to
compare the values of same table(say for eg: Order table) each and every time the record get inserted ,
if the record with same values get inserted already in same table i should not insert the new record with same values. how to do that exactly in sql server 2008
Hi,
I want to translate LINQ expression tree to SQL statement and I don't want to write my own code for this.
Example:
var query = from c in Customers
where c.Country == "UK" &&
c.City == "London"
select c);
To
SELECT ... FROM Customers AS c WHERE c.Country = "UK" AND c.City = "London"
I know DataContext.Log, but I want to use:
query.ToSqlStatementString()
Thanks
Hi,
I have a table of items stored this way :
A1 | B1
A1 | B2
A1 | B3
A2 | B1
A2 | B4
...
And I need to retrieve with a SQL Query :
A1 | B1, B2, B3
A2 | B1, B4
...
Hey, I've just finished writing a VB.NET application. Now I want to package the executable and the database ofcourse into a single installer file. I tried using QSetup, InstallShield to make SQL Server embedded into the setup file, and finally after hours of try&fail I have no idea. Anyone?
Is there any way showing the detailed exception for String or binary data would be truncated.
I use LINQ to SQL and i cant figure out which column is that!?
Tried numerous things but i get the same meaningless error i got from within Visual Studio.
Also I use .NET 3.5 SP1, but errors are still returned useless.
Hi,
what is index in sql can u explain or any reference to understand clearly. where should i use the index. I search in stackoverflow but it is not clear for me. thank you
How would one go about converting this into a UDF? I'll pass the product_id to the UDF.
Running SQL 2k5
SELECT
sum(qty) as qty,
product_id
FROM vProductQuantity
WHERE
product_id = @product_id
GROUP BY product_id
Hello,
We have observed that there seems to be a maximum number of ids/variables which one can pass in the IN clause of SQL as comma seperated values. To avoid this we are storing all the ids in a table and doing a SELECT within the IN clause. This however means extra database operations to store and retrieve ids. Is there any other way to use IN without SELECT?
regards
Sameer
thanks for yout time helping on this ;)
I'm new to SQL and wish to solve somethign in just one query and i dont know how to do it.-
Basically I've a table of products, a table of users and a table of comments, linked by products.id - comments.pid and user.id - comments.uid ,
i wish to know what is the best practice to create just 1 query and get all products with child comments, including username.
Hi all, i want to ask about development in blackberry. I have background in .Net winform.
If i want to develop an application to show data from Ms.SQL server 2008 database in blackberry. what should i learn and what should i do ? thank you for your advice.
hi
i have 4000 records, and i need to pick randomize 500 records.
i need that 500 records will insert to GoodTable
and the rest 3500 records will insert to BadTable
how to do it using sql-server 2008 query ?
thank's in advance
Hi guys:
Suppose we got a original query as follows:
SELECT A, B, C FROM tblA
Now, I need to additional artificial rows like
SELECT 'Kyala', B, C FROM tblA when, for example, C = 100 to be inserted into the resultset.
How could I achieve it using a single SQL instead of relying on table variable or temp table?
Hi,
I have a server where I installed SQL Server 2008 and after I applied the SP1.
Now, I want also to add the Analysis Services to this instance by using the "Add or remove features...".
My questions are:
Is it possible to add the Analysis Services on a server with SP1 already installed?
How can I apply the SP1 also to the new Analysis Service feature?
THANKS!
E.g.
Declare @str varchar2(20)
Set @str = 'A Student'
Select Reverse(@str)
Output:
tnedutS A
Expected being:
Student A
The output(using Reverse) is as expected. But my requirement is the one described.
Help needed with SET BASED.
I am using SQL SERVER 2005
E.g.
Declare @str varchar2(20)
Set @str = 'A Student'
Select Reverse(@str)
Output:
tnedutS A
Expected being:
Student A
The output(using Reverse) is as expected. But my requirement is the one described.
Help needed with SET BASED.
I am using SQL Server 2005
I have two SQL 2005 instances that reside on different networks. I need to backup a database from instance A and restore it to a database in instance B on a weekly basis so that both databases hold the same data. After the restore, logins SIDS on database B are changed and therefore users can't log into database B and connection strings for the web application it supports are broken. Is there a work around for this? Thanks.
I'm learning how to use SQL Server Management Studio and can't figure out how to insert a new row into a table.
Table Structure:
ID,
Field1,
Field2
Query:
INSERT INTO Table (Field1,Field2) VALUES(1,2)
Error:
Major Error 0x80040E14, Minor Error 25503
I'm probably missing something very noobie like. Any help would be appreciated.
I have two basic SQL Server tables:
Customer (ID [pk], AddressLine1, AddressLine2, AddressCity, AddressDistrict, AddressPostalCode)
CustomerAddress(ID [pk], CustomerID [fk], Line1, Line2, City, District, PostalCode)
CustomerAddress contains multiple addresses for the Customer record.
For each Customer record I want to merge the most recent CustomerAddress record where most recent is determined by the highest CustomerAddress ID value.
I've currently got the following:
UPDATE Customer
SET
AddressLine1 = CustomerAddress.Line1,
AddressPostalCode = CustomerAddress.PostalCode
FROM Customer, CustomerAddress
WHERE
Customer.ID = CustomerAddress.CustomerID
which works but how can I ensure that the most recent (highest ID) CustomerAddress record is selected to update the Customer table?