Can someone point me towards a resource or show me an example of a good way of writing sql statements in php.
Most statements seem so ugly and unreadable.
Hello all,
I am just reading this article and I came across this:
Filter: Remove any functions in the
WHERE clause, don't include views in
your Transact-SQL code, may need
additional indexes.
If I do not use views, what are the alternatives? I mean, in my situation, I want to select some data from a table and then use a few other select queries to work on the subset of data from the first select query?
How can I do this efficiently?
Thanks all
Hi All,
How can we set permissions for users to only allow them to download SSIS packages from the production server and but deny them permissions to run any package in the Server.
http://msdn.microsoft.com/en-us/library/ms141053(SQL.90).aspx
If i assign users to any of the DB roles db_dtsadmin, db_dtsltduser, and db_dtsoperator they will automatically have permission to run the package.
Appreciate your inputs.
Thanks!
What tool for managing Oracle DB do you suggest? I need to execute scripts and manage data in tables and develop some scripts and packages. I'v tried SQL developer and actually don't like it. Want some more features for developing (debug, code assist, integrated help and so on.)
Hi
We've noticed something odd with our Coldfusion 8 client variables DB. We have many more (about 3 times as many) CGlobal entries as we have CData entries.
I would have assumed that the relationship would be 1:1 on the cfid column.
Has any one else noticed this before? I have ruled out old data, my sample is less than 3 hours old. We're using SQL Server 2000 to host the tables.
Thanks in advance,
Ciaran
Money, Staff, Skill and preference to open source or commercial is neutral. Lets take the best of the best programmers (for arguments sake) and think about this:
What will perform better overall:
PHP & MySQL
or
ASP.Net & Microsoft SQL
(I don't want biased answers, just
looking for Performance, and Speed).
Hi,
I have a sql script file that upon import creates a table in a MySQL database and fills it with 2800 record. These are all the postal codes for the country Belgium.
Now I would like to make a Ruby on Rails database migration file from this. Any idea how I can do this?
Thanks,
Michael
In what cases would a call to java.sql.ResultSetMetaData.isSearchable(int col) return false for an Oracle database? The documentation for the method doesn't really answer the question:
"Indicates whether the designated column can be used in a where clause."
I can think of only one case - when the column is the result of an aggregate function (in which case it would have to be part of a HAVING filter, not a WHERE filter).
Are there any other cases?
We have two tables:
Vehicle: Id, RegistrationNumber, LastAllocationUserName, LastAllocationDate, LastAllocationId
Allocations: Id, VehicleId, UserName, Date
What is the most efficient (easiest) way to update every row in Vehicle table with newest allocation? In SQL Server I would use UPDATE FROM and join every Vehicle with newest Allocation. Oracle doesn't have UPDATE FROM. How do you do it in Oracle?
hi,
i have to create window service which read the xml file and and take the node's value to connect the sql server and create the log file i have already created window application for that but i don't know how to create win services.
I am making a windows service to be able to run operations on a sql server database (insert, edit, etc) and invoke Stored Procs.
However, is there a way for me to know the type of the SP? When invoking from C#, I need to knof if it is returning 1 value, or more, or none (so I can use executereader, scalar, etc)?
Thanks
Has anybody done any benchmarking/evaluation of the popular open-source embedded SQL DBs for performance, particularly write performance? I've some 1:1 comparisons for sqlite, Firebird Embedded, Derby and HSQLDB (others I am missing?) but no across the board comparisons... Also, I'd be interested in the overall developer experience for any of these (for a Java app).
I am going to generate XML file based on the data returned from SQL Server, but there are some special characters like  and  (there may be other characters like these), which will fail the XML.
Is there any way to escape them?
Thanks!
Hi,
I got used to the xml support and recursive common table expressions of sql server 2005. I am just wondering whether any free dbs like mysql support these requirements nowadays? Thanks.
Christian
ok, my Sql Server Management Studio Object Explorer had dissapeared. I know the shortcut F8, and the view-object explorer method.. neither do anything, ive clicked everything on the keyboard, googled around, but nothing..
really need this back, its a massive hassle having to navigate through the summary window without the object explorer tree view!
help meeeee...
Here's the situation. I have a bunch of objects that implement Serializable that I want to store in a SQL database. I have two questions
Is there a way to serialize the object directly into the database
Is that the best way to do it or should I
Write the object out to a formatting String and put it in the database that way and then parse it back out
Write each member to the database with a field that is unique to each object
I have an application that creates a Sql Server 2008 database. When I create the database, I would also like to create a datasource for SSRS.
How can I do this?
Can I have a SQL query to get the data from columna in tableA whose values don't start with 'f' ?
For example:
select * from tableA where columnA
where values don't start with letter 'F'.
i have a txt file stored in my sql DB, in that .txt file i have certain numbers like
99435
87889
33455
33555
34556
how to get the count of these numbers from the txtfile stored in the database and also to read the file and fetch the number one bye one in a string.
using asp.net (C#)
I have this sql query:
SELECT
S.SEARCH,
S.STATUS,
C.TITLE AS CategoryName,
E.SEARCH_ENGINES AS Engine,
S.RESULTS,
S.DATE,
S.TOTAL_RESULTS AS Total,
S.ID
FROM
PLD_SEARCHES AS S
Join PLD_CATEGORY AS C ON C.ID = S.CATEGORY_ID
Join PLD_SEARCH_ENGINES AS E ON S.SEARCH_ENGINES_ID = E.ID
ORDER BY S.DATE ASC
I want to identify if S.STATUS is either 1 or 0 and according to those values to return COMPLETE or PENDING in the query results
I have a SQL query in which I am passing sysdate to the query problem is that when there is no matching date in table with sysdate then it don't shows the zero even if there is nvl applied
here is my query
select * from molasses
where trunc(trn_dte) = trunc(sysdate)
But it show data only when current date is present in table but I want to show zero if no data found in table.please help me to do this in oracle 10 g. Because some times the situation is like above and I have to display zero when no data found
For what x is
The expression x IS NOT NULL is not equal to NOT(x IS NULL), as is the case in 2VL
(quote from this answer, which is quoting Fabian Pascal Practical Issues in Database Management - A Reference for the Thinking Practitioner -- near the end of that answer)
My guess is when x IS NULL is NULL, but I cannot guess when that would be (i.e. I haven't checked the SQL standard).
Hi,
I've got table Articles
ID identity autoincement, IDArticle: nvarchar(100) ,IDCar nvarchar(100), createddate
How to convert this:
SELECT IDCar , MAX(createddate)
FROM Articles
GROUP BY IDCar
to get IDArticle
eg:
1 art1 BWM 5-21-2010
2 art2 BMW 5-24-2010
3 art3 BMW 5-31-2010
4 art4 Porshe 5-31-2010
5 art5 Porshe 6-1-2010
Expecting result is:
art3
art5
It's not duplicated with:
http://stackoverflow.com/questions/2736769/sql-query-number-of-occurance/2736809#2736809
I tried session.createSQLQuery("ALTER TABLE People MODIFY address VARCHAR(1000);").executeUpdate();
but this throws org.hibernate.exception.SQLGrammarException: could not execute native bulk manipulation query
After a lot of googling, the recommendation is to use HQL instead of SQL query to do bulk updates. Not sure how to use HQL to accomplish this. There seems to be no decent HQL documentation for updating column length in a table.
Thanks so much for the help.