Hi All,
Having a bit of a "special" moment here. Basically I have a DB table for listing files and their attributes (size, creation date, etc). Being a self-proclaimed (borderline delusional) SQL-whiz, you can imagine my surprise when I failed to figure out a quality manner by which to individually list only files whose [INSERT ATTRIB...
Does anyone know how can I do a count in SQL Server based on condition.
Example:
How can I do a column count for records with name 'system', and total caseid records in the table??
Customer table
userid caseid name
1 100 alan
1 101 alan
1 102 amy
1 103 system
1 ...
How many queries in one webpage is good performance? If that page is home page that is viewed many times.
and how about....
$sql1 = mysql_query("SELECT * FROM a", $db1);
while($row = mysql_fetch_assoc($sql1)){
$sql2 = mysql_query("SELECT * FROM b WHERE aid='a'", $db2);
$a = mysql_fetch_assoc($sql2);
}
is it good? acctually I can ...
Scenario
Web server running an ASP.NET site that's connected to a sql server instance for all the web related DB needs (products, pricing, users, etc.)...
The companies accounting, inventory control(FIFO, etc.) and whatnot are mainly done on another system which uses a different SQL server...much more complex, for obvious reasons.
Wha...
Hello Guys,
May I know why Sparse columns which are having non null values takes 4Bytes of extra space..I am finding out why it is taking 4 bytes of extra space.. Please help me out?
...
I have a table in an Oracle database that contains actions performed by users in one of our systems. It's used for statistical analysis and I need to display the number of actions performed for a given date, grouped by hour of the day.
I have a query that does that fine, however, it does not display the hours of the day that contain no ...
I have a stored procedure which gets data from another database on the same server.
I will not be hard-coding which database to use, instead this will be configurable. Is this possible without dynamic sql?
The best solution I could come up with so far is to first run a stored procedure which uses dynamic sql to generate a bunch of view...
Hi
I would like to know what is the best way of creating a report that will be grouped by the last 7 days - but not every day i have data. for example:
08/01/10 | 0
08/02/10 | 5
08/03/10 | 6
08/04/10 | 10
08/05/10 | 0
08/06/10 | 11
08/07/10 | 1
is the only option is to create a dummy table with those days and join them altogether?
th...
I have been given a table that is populated by '1' and '0' based on the yes/no answers to a survey. I have been asked to identify all totally distinct answers, i.e. People who answered 'Yes' to questions 1, 17, 23, 234 and 238.
There are many columns (500+) and thus many answer permutations.
Any ideas?
...
Hi ,
I have a table structure like below :
categoryID bigint , primary key , not null
categoryName nvarchar(100)
parentID bigint, not null
where as categoryID and parentID has an one-to-many relation to each other
and I want to create a nested categories with unlimited depth out of this table in my program.
I have a solution but i...
What is the difference between jobs and maintenance plan in sql server?
I am confused about where I should use job and where maintenance plan.
...
I'll try to avoid describing the background here. I now have a query result (not a table) which contains rows like this:
ID SP1 SP2 SP3 SP4 SP5 SP6 SP7 SP8
1 null null 2500 1400 700 null null null
There may be leading and/or trailing null values around a section of non-null v...
Dim NorthWindOledbConnection As String = "Provider=SQLOLEDB;DataSOurce=SARAN-PC\SQLEXPRESS;Integrated Security=ssp1;InitialCatalog=Sara"
Dim rs As New ADODB.Recordset()
rs.Open("select * from SecUserPassword", NorthWindOledbConnection, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockBatchOptimistic)
i tried to run this ab...
Hi, I have a table with One-To-Many reflexive association.
I need insert the first value disabling temporary the constraint.
Any idea how to do it?
I use MS SQL 2008, thanks guys for your support!
CREATE TABLE dbo.CmsCategories
(
CategoryId int NOT NULL IDENTITY (0,1) -- Seed = 0 and Increment= 1
...
Can any one provide the SQL Text books links to download?
(text books)
PDF/document to download, not link to view
...
Looking for a way to use SQLBase (by Unify, formerly Gupta) with NHibernate. I don't think there is a specific SQLBase provider, but I guess there would be generic providers to connect and use the most common SQL features...
Any help would be appreciated.
...
Hi,
consider a SQL table, which stores hierarchical data using MPTT (Modified Preorder Tree Traversal) method.
CREATE TABLE node (
id SERIAL NOT NULL, -- primary key
-- Nested mptt tree model.
lft INT NOT NULL,
rgt INT NOT NULL,
-- Some legacy a...
Suppose I have a table with a column name varchar(20), and I store a row with name = "abcdef".
INSERT INTO tab(id, name) values(12, 'abcdef');
How is the memory allocation for name done in this case?
There are two ways I can think of:
a)
20 bytes is allocated but only 6 used. In this case varchar2 does not have any significant adva...
We are facing some annoying issues while trying to remotely connect to an Oracle database from a Windows Azure worker instance. The problem has been already discussed on the MSDN, but at this point, we are still stuck.
Does anyone has succeeded in establishing a connection toward an Oracle database from a .NET app hosted in Windows Azur...
In MySQL Im having two tables:
PRODUCTS (id, Name)
SEEALSO (id, prodLeft, prodRight)
SEEALSO defines which PRODUCTS are related together and are represented as binded fileds "prodLeft"-"prodRight".
For Example:
PRODUCTS:
1 Desk
2 Table
3 Chair
4 Doors
5 Tree
6 Flower
SEEALSO
1 1 2
2 2 3
3 3 4
4 5 6
From that we can see bin...