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?
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
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 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!
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
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
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#)
Having a bit of difficulty figuring out how to create a named_scope from this SQL query:
select * from foo where id NOT IN (select foo_id from bar) AND foo.category = ? ORDER BY RAND() LIMIT 1;
Category should be variable to change.
What's the most efficient way the named_scope can be written for the problem above?
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).
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.
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
Hi
I would like to create a temporary table in a Oracle database
something like
Declare table @table (int id)
In SQL server
And than populate it with a select statement
Is it possible?
Thanks
I have the following table :
alertID inspectorID datelive dateread
1 none 2012-11-06 10:36:03.350 NULL
2 none 2012-11-06 10:36:25.043 NULL
3 none 2012-11-06 10:36:42.433 NULL
1 31030 2012-11-06 10:37:19.193 2012-06-11 10:34:47.000
I want to select the alerts that dont have the inspectors ID against it AND where the alert ID doenst match the one that has the inspectorID against it, ie inspector has read alert 1 so i only want it to return alerts 2 & 3
Am using Classic ASP and MS-SQL
Cheers
My database has about 30 views, most of which have a reference to another database on this server (call it DB1).
Now, without going into the reasons why, I need to update all those views to DB2, also on the local server.
I would hate to have to do this manually on each view. Is there some SQL query I can run that will replace all occurrences of the string 'DB1' with 'DB2' in all my views?
Hi,
I have the following table in an access database
id VisitNo Weight
1 1 100
1 2 95
1 3 96
1 4 94
1 5 93
Now row 2 and 4 are deleted. So i have...
id VisitNo Weight
1 1 100
1 3 96
1 5 93
However what i need is...
id VisitNo Weight
1 1 100
1 2 96
1 3 93
What is the SQL query i need to accomplish the above?
thanks
I have a SSIS package that I plan to deploy on my SQL Server 2008 machine.
I need to call this SSIS package remotely and synchronously from .NET. Obviously I need to pass parameters to this package as well.
How could I do that?
Thanks,
Alex
Hello!
To empty database table, I use this SQL Query:
TRUNCATE TABLE `books`
How to I Truncate table using Django models and orm?
I've tried this, but it doesn't work:
Book.objects.truncate()
Assuming you can't use Linq for whatever reason, is it a better practice to place your queries in stored procedures, or is it just as good a practice to execute ad hoc queries against the database (say, Sql Server for argument's sake)?
I'm querying a view and filtering the results with a column named status. I'd like to query it so I can search for rows with different status, by using the IN operator as I'd do in SQL.
As so:
SELECT * FROM VIEW WHERE Status in ('....', '.....')
How can I achieve this?
When do I execute query COPY TO ... CSV, I create CSV file. BUt when open it column with names in excel that should be with national characters are not as it should be. So my question is, If it is possible within a sql query to change this encoding to utf8? Or something else? Because I want that new created CSV file to be as final product for user on web. I hope someone understood what I want:)
Hi,
I don't see a LINQ option when picking a data source for a grid view - any ideas?
I just upgraded to Visual Web Developer 2010. I see the other options like SQL etc.
Thanks!
Good Morning,
Say I have an insert statement:
Insert INTO tblTest (fieldOne,FieldTwo,fieldThree) VALUES ('valueOne','valueTwo','null')
This statement doesn't seem to want to insert a null value into the database... I have also tried to insert the word "nothing".
Has anyone any ideas how to make this work? I am using SQL server 2005.
i would like all data that is entered into a specific column to always have a trailing comma and also i need the first character to always be a comma. how do i do this? the best solution is probably not in vba or sql but probably the properties of the table?
An insert statement with a large number of values returns 'Error converting data type varchar to numeric.'
How can I find which value actually triggers the error?
MS SQL Server 2008 is used.