I have an MySQL table with 25000 rows.
This is an imported CSV file so I want to look at the last ten rows to make sure it imported everything.
However, since there is no ID column, I can't say:
SELECT * FROM big_table ORDER BY id DESC
What SQL statement would show me the last 10 rows of this table?
The structure of the table is simply this:
columns are: A, B, C, D, ..., AA, AB, AC, ... (like Excel)
all fields are of type TEXT
In SQL, can we always write an inner join statement as a main query and subquery or vice versa if we only want to find the intersection?
For example,
select * from gifts g where g.giftID in (select giftID from sentGifts);
can do a join and show the gifts sent in the sentGifts table, but it won't be able to show the sentTime because that is inside the subquery. But if all we care is to find the intersection, without caring what is being displayed, then we can always convert one to the other?
I once needed the lines of the stored procedures, to be able to trace whether i have a reference to some function, procedure or table, or sometimes to try to find something inside of the sp's code. Where does the sqlserver stores the procedures's code?
i.e. if I create a VARCHAR(50) field, what happens if I try to assign it a value that's 100 characters long?
Will SQLServer let me do this? Is it somehow less efficient?
I was learning this ORM because think this is good technology for most projects. But most employers required acquirement of ADO.NET and SQL.
This ORM not will use in high-loaded system (like popular web-sites)? In which types of projects this ORM will be useful? Are highly loaded projects using ORM?
I am aware of other solutions like System.Data.Sqlite or Firebird through Dblinq, but since nothing beats SQL Compact Edition (integration-wise) with Visual Studio, I would like to use it and to know if its license allows its usage in Open Source projects.
Thanks.
Which is faster in SQL, While loop, Recursive Stored proc, or Cursor?
I want to optimize the performance in a couple of spots in a stored procedure.
The code I'm optimizing formats some strings for output to a file.
I'm trying to compare the schemas of two tables that exist in different databases. So far, I have this query
SELECT * FROM sys.columns WHERE object_id = OBJECT_ID('table1')
The only thing is that I don't know how to use the sys.columns to reference a database other than the one that the query is connected to. I tried this
SELECT * FROM db.sys.columns WHERE object_id = OBJECT_ID('table1')
but it didn't find anything.
I'm using SQLServer 2005
Any suggestions? thanks!
I need to write a function to delete the login in the database if it does not have any users to map to using SQLServer Management Objects (SMO). How can I achieve this ?
I am testing out my scripts to see if they will prevent xss and sql injections. Can someone provide me with some basic but good scripts that would "hack" into my programs. I want to test my scripts before it goes online.
How to automatically generate documentatation of stored procedures of SQLServer 2008 like doxygen does to codes? I read about hyperSQL but it doesn't work nice with Windows.
Thanks!
Gil.
I am trying to write an aggregate udf for using SqlServer 2008 and C# 3.5 that implodes an aggregation of data. The kind of syntax I am looking for is:
SELECT [dbo].[Implode]([Id], ',') FROM [dbo].[Table] GROUP BY [ForeignID]
where the second parameter is the delimiter for the aggregate function. And example return value would be something like:
1,4,56
Is there a way to have multiple parameters in an aggregate udf?
How can I find out if a Linq to SQL entity has grandchildren or not?
Pseudo-code below:
Return From p In dc.Processes Where p.Signers.Count > 0 and p.Signers.Signatures.Count > 0
Obviously I can't run the code above but I need to make sure that all the returning Processes have at least one Signer and that all of those Signers have at least one Signature.
TIA!
In SQLServer, is there any way to check whether the changes in the schema will impact Stored Procedures (and/or Views)?
For example a change of the column name in one table, may break some Stored Procedures; how to check the impacted stored procs?
Sql 2008 is telling me to include the Primary Key in an index in the Included Column field. I thought the PK was automagically returned with all indexes?
Why is it necessary to remove and then re-add a user to a SQLServer database after restoring it from a file?
If I don't do this, I get a "User login failed" when trying to access the database using this username from apps.
I need a test database to practice joins and other kinds of data retrieval operations in SQL.
What's a good free test database and RDBMS system to use on Windows?
Hello everyone!
I am now writing a report about MS Access and I can't find any information about its performance speed in comparison to other alternatives such as Micorsoft SQLServer, MySQL, Oracle, etc... It's obvious that MS Access is going to be the slowest among the rest, but there is no solid documents confirming this other than forums threads, and I don't have the time and resources to do the research myself :(
Hoping for your help,
V.S.
I would like to allow two threads to write in a table at the same time (I know the problem of updating the same row, but this would be a story apart). I need that in behalf of speed up the operations in my aplication (one thread could write in row X while another could do the same in row X+n instead of waiting the first to finalize).
So, can I block rows instead of tables with Linq to SQL?
Thanks.
The scenario is I want to get the users who has less than 2 photos.
There are two table:
[Users] (UserId, UserName)
[UserPhotos] (PhotoId, PhotoName, UserId)
UserId is a Foreign Key but I do not want to use association like user.Photos.
A user may have none photo in the [UserPhotos] table.
How to use Linq To Sql to get List<User> who has less than 2 photos?
I do like the SQL editor now bundled with Eclipse but I can't seem to find a way for it to format my code like eclipse will with my java.
Did I miss something, or does anybody have any alternatives?
Thanks
====EDIT====
I'd also be happy if there was an alternate plug-in that someone could recommend.