|
Thanks it works great...
|
|
|
|
|
|
Negative several million!
Look up "SQL injection attack".
|
|
|
|
|
PIEBALDconsult wrote: Negative several million!
Look up "SQL injection attack".
Yes dude it's true, But he is just expecting just correct the error. Also here before I received a rude comment from Enquirer for the same type of suggestion. Ok Here after I'll add the additional details along with answer. Thanks
thatraja |Chennai|India|
Brainbench certifications Down-votes are like kid's kisses don't reject it Do what you want quickly because the Doomsday on 2012
|
|
|
|
|
Never ever ever etc. suggest concatenation. Not once, not even a little bit.
|
|
|
|
|
OK Deal
thatraja |Chennai|India|
Brainbench certifications Down-votes are like kid's kisses don't reject it Do what you want quickly because the Doomsday on 2012
|
|
|
|
|
According to question, Good Answer.
|
|
|
|
|
|
How to Get Value from Exec(Sql) in SQL Server 2005 if possible...? help me....
|
|
|
|
|
|
Use Print(sql) to have a full customized query.
Regards,
Hiren.
"We owe a lot to the Indians, who taught us how to count, without which no worthwhile scientific discovery could have been made." - Einstein
Microsoft Dynamics CRM
|
|
|
|
|
How can I declare varchar(MAX) in MySQL?
|
|
|
|
|
|
Hi All.
I have some small Access databases including identical tables.
For example let's suppose I got a.mdb b.mdb c.mdb with table1 table2 table3.
Is this possible to merge data from table1 table2 table3 in a SQL database without creating problems with ID colums of each table
(0;1;2;3;4......)
How this task can be realized?
Thank you in advance
|
|
|
|
|
KORCARI wrote: without creating problems with ID colums
What are you using for a datatype? If UniqueIdentifier, you should be OK; if auto-increment integers, you're hosed.
|
|
|
|
|
It's a terrible task.
In your small Access dbs, turn off the autoincrement feature of the ID columns. Then look for the max ID values in the first db, update the IDs in the second by adding that value, then take the new max value, ....
In SQL Server, use "SET IDENTITY_INSERT " + table + " ON" .
Now move your Access data to SQL Server, turn IDENTITY_INSERT off again, and throw away the small Access dbs.
|
|
|
|
|
KORCARI wrote: Is this possible to merge data from table1 table2 table3 in a SQL database without creating problems with ID colums of each table
Yes. Add a column called "sourceDatabaseName", make it part of the primary key, and when importing write the name of the database that you're importing into that column.
If you're moving a lot of data, then this would be the time to consider upgrading to Sql Server (express)
I are Troll
|
|
|
|
|
Hello
I want to connect my Vb.net application to SQL Azure database which is in cloud, what connection string i should use.
Thanks
Bhaskar
Senior Programmer
B R. Solutions, Delhi
www.brsolutions.info[^]
|
|
|
|
|
Connectionstring.com [^]is an excellent resource for this information
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
how can I convert a varchar like this "254565825145" to bigint in mysql stored procedure?
|
|
|
|
|
Try:
select cast('254565825145' as unsigned)
|
|
|
|
|
What if it's in hex?
At a previous job of mine, the company stored 64-bit IDs in strings as hex (in RDB*) and there was no native way of converting them back and forth within the database, you had to fetch the data out and then work on it (in C). Eventually I wrote functions (like CLR extended stored procedures in SQL server) to do it.
* Which still doesn't support 64-bit integers?
|
|
|
|
|
The code below which was advised works very well, not sure if it was supposed to be laid out that way and was a little learning curve me but it works am happy. My next problem is this...
SELECT
(FU.id)AS ID1,
(TU.id)AS ID2,
(FU.username)AS Username1,
(TU.username)AS Username2,
(FU.level)AS level1,(TU.level)AS level2,
(NU.Profile_Image)AS Image1,
(MU.Profile_Image)AS Image2,
comments.comment
FROM comments
JOIN login as FU ON comments.Artist = FU.id
JOIN login as TU ON comments.Buddy = TU.id
JOIN tbl_profile as NU ON comments.Artist=NU.Usr_AD_ID
JOIN tbl_profile as MU ON comments.Buddy=MU.Usr_AD_ID
WHERE TU.active = 1
ORDER BY comments.commentid DESC LIMIT 10
I have a tbale which is basically a buddies list...
TABLE Structure...
ID
Buddy_ID
Author_ID
Description
Block
Approved
I am not sure how to include this so the comments only show comments from a person that is in a user buddies list, if that makes sense. at the moment it shows all comments from and to everyone. As members have to be logged in to see the page I could grab the users login_id from the session variable which would go against the Author_ID in the buddies list table, so only to show comments form people in his/her buddies list.
Any pointers would be very much appreciated.
King Regards
Ray
-- Modified Tuesday, November 23, 2010 2:00 PM
|
|
|
|
|
Hi again,
1.
no you don't have to format in any particular way, I did it there and then as it made things more clear.
2.
please use preview and modify your post till it looks all right, the PRE tags didn't work for you, probably because you had one of the checkboxes/radiobuttons wrong below the edit box. You can still edit and improve that message!
3.
in general, if you want fewer results, all it takes is a more limiting WHERE clause.
4.
I am not sure I understand your exact requirement, an example would have helped.
5.
If you're unfamiliar with it, this may be the time to learn about the IN operator. Google SQL IN, and remember, you can put a secondary SELECT statement inside those parentheses if necessary (don't expect it is, in this case).
6.
FWIW: I like http://www.w3schools.com/sql/ a lot as a primary source on SQL stuff. Sorry, the damn linkifier is on strike again.
|
|
|
|
|
Hi Luc Pattyn
Wow! quick reply
Seems you are to my rescue again. Many thanks for your support I am really enjoying the learning curve and achiveing so much just for having been pointed in the right directions.
Have a great evening, thank you again
Regards
Ray
|
|
|
|