Tagged Questions

Structured Query Language (SQL) is a language for managing data in relational database management systems. This tag is for general SQL programming questions; it is not for Microsoft SQL Server, nor does it refer to specific dialects of SQL on its own.

learn more… | top users | synonyms

7
votes
3answers
252 views

How to optimize this code to get a instant/better result instead of waiting at least 10 seconds every time?

I have the following code that unfortunately is really slow: private void FilterSessionByDate() { SessionsFilteredByDate = ...
1
vote
1answer
37 views

Is there a performance difference using AS keyword in SQL?

I'm working on a project in which the previous programmer seems to have loved using the AS keyword in the SELECT part of queries. I really don't like how it's written but if there is no performance ...
3
votes
2answers
58 views

Is this the correct way to use join instead of in operator

i have a small doubt, this is my query declare @table table(id int, name varchar(100)) insert into @table values (1,'a') insert into @table values (2,'b') insert into @table values (3,'c') select * ...
5
votes
1answer
71 views

PHP Login Authentication with BCrypt

So I have a php authentication script and everything works fine. But I'm very unsure about the way I programmed it (i hardcoded some stuff) and I was hoping stack could look through this and point out ...
3
votes
1answer
38 views

Is it necessary to replace this cursor in SQL Server 2005?

The Problem I have a cursor that I am trying to replace (perhaps unnecessarily) in an attempt to clean up a stored procedure. Essentially what it is doing is counting each note for each member in a ...
4
votes
1answer
83 views

Please review my PDO Database wrapper

The subject is this small project - PHP/MySQL Database wrapper The three main goals of this projects are: Easy way to map database columns to object properties Simple solution to insert or update ...
3
votes
1answer
59 views

Codeigniter active record - prepared statement assistance

I understand that I should use prepared statements to prevent sql injection. Unfortunately, having read the php docs on the matter I am none the wiser. Here is one of my simple active record sql ...
4
votes
0answers
38 views

Auditing a complex mix of reasonably small tables

I plan to use the following approach to audit the tables that represent user-editable configuration of an automated system (over the course of system's life these will be inevitably extended in their ...
4
votes
1answer
51 views

Is this MySQL database structure acceptable or can it be improved?

Recently I've tried to teach myself basic things about MySQL databases, however I received some help on stackoverflow with creating a good database structure trying to avoid redundancy as much as ...
3
votes
1answer
82 views

SQL view, better way?

I there a better way to write this query? I feel sure it can be done in one statement with joins, but I couldn't get it, and I'm afraid I've made it too slow. What suggestions do you have? I'm ...
1
vote
1answer
54 views

Mysql left joins last row

I am making a query in mysql to import users in our marketing system and need for this a lot of data like for example : Date of last order Date of last cheque created ... This are all left joins ...
0
votes
0answers
105 views

Splitting an address into fields in SQL

I have the following code to split an address string in T-SQL. Excepting the unit number, which is already in its own field, it would affect too much of the application to split the address into ...
3
votes
2answers
73 views

Any way to speed up this UPDATE?

SQL: CREATE FUNCTION dbo.fnRandomForeNames () RETURNS VARCHAR(50) AS BEGIN RETURN ( SELECT TOP 1 [FirstName] FROM [tmp_ForeNames] ORDER BY (SELECT new_id from ...
1
vote
2answers
191 views

Need help in MVC Winform example project to add a record into the DB [closed]

I want to learn MVC pattern using winforms and I have read some tutorial to understand. Now, i'm working on my own example to just add a customer records in a database using MVC pattern. The ...
1
vote
1answer
110 views

How can I improve the performance of this?

So, let me explain. This is a function that checks that when users register into the site, they only create one single account per email. The little twist is that all emails in the DB are hashed with ...

1 2 3 4 5 8
15 30 50 per page