|
this will do it:
SELECT tt.col, Count(isnull(tt.col, 'NULL'))<br />
FROM TempTesting tt<br />
GROUP BY tt.col
~Steve
www.roundpolygons.com
|
|
|
|
|
I think you need to change
SELECT tt.col, Count(isnull(tt.col, 'NULL'))
to
SELECT isnull(tt.col, 'NULL'), Count(tt.col)
and the group by needs the isnull check also.
Chris Meech
I am Canadian. [heard in a local bar]
When I want privacy, I'll close the bathroom door. [Stan Shannon]
BAD DAY FOR: Friendly competition, as Ford Motor Co. declared the employee parking lot at its truck plant in Dearborn, Mich., off limits to vehicles built by rival companies. Workers have to drive a Ford to work, or park across the street. [CNNMoney.com]
Nice sig! [Tim Deveaux on Matt Newman's sig with a quote from me]
-- modified at 13:23 Wednesday 22nd March, 2006
|
|
|
|
|
select sum case when tt.coll is null then 1 else 0 end
There are many ways as we can see
Hear,See,Learn,Understand,Practice <hslup>
Many can be good,but only ONE can be the best keep practicing
|
|
|
|
|
Hi,
managed to forgot how to figure out blob size in oracle 8.
In oracle 9 and after it's simple:
xyz blob column;
abc table;
select length(xyz) from abc;
But in oracle 8, length doesn't accept blobs.
I have vague memory it involved "lob describe" somehow or maybe vsize???
Thanks!
|
|
|
|
|
How can I do to make a procedure that return the number of rows of any table.? ... @var int OUTPUT as....
|
|
|
|
|
Execute the following SQL Statement using ExecuteScalar
SELECT COUNT(*) FROM MyTableName
|
|
|
|
|
Run this procedure in Query Analyser
CREATE PROC Usp_RowCount AS<br />
SELECT count(*) FROM fc_Employee<br />
Go
"Aim to go where U have never been B4 and Strive to achieve it"
http://groups.yahoo.com/subscribe/dotnetforfreshres
http://himabinduvejella.blogspot.com
|
|
|
|
|
Great, thank you very much....
|
|
|
|
|
Hello
I need some good free e-Books or any Web Site Links for learn Stored Procedure....
N.Rajakumar B.E.,
Application Developer,
www.newdreamz.tk
|
|
|
|
|
|
U can even have a look at this KB article
http://www.dotnetspider.com/kb/Article1131.aspx[^]
All the best
"Aim to go where U have never been B4 and Strive to achieve it"
http://groups.yahoo.com/subscribe/dotnetforfreshres
http://himabinduvejella.blogspot.com
|
|
|
|
|
Hi all,
I have VS 2005 Professional, which comes with SQL Server 2005 Developer Edition. I'm in a crossroad thinking whether to install it or not.
Does ASP.net application requires SQL Server installed? Not that I'm developing asp.net, but I may need to in the future. I mainly do offline apps (Win32 /w C++).
Thanks.
|
|
|
|
|
It's not madatory that u only need Sql server
U many use Oracle .But any one database is must to store data in the back end
Sqlserver is the preferable one
"Aim to go where U have never been B4 and Strive to achieve it"
http://groups.yahoo.com/subscribe/dotnetforfreshres
http://himabinduvejella.blogspot.com
|
|
|
|
|
Hey,
Thanks for your reply. What I wanted to know is, do I really need to install SQL Server? I don't develop server-side apps, I mainly do client-side apps using Win32 /w C++.
|
|
|
|
|
SQL server is a powerful and robust data store. It is not required for development. ASP.Net apps can use any data store or none at all depending upon the application (just like Forms based apps).
Note: If you want to make a career in software development - learn to use a SQL database.
|
|
|
|
|
The SQL Server 2005 Developer Edition I'm going to install on my workstation is only for testing purpose, correct? When actually deploying the apps on a server machine, another copy of SQL Server 2005 should be installed there? Right?
|
|
|
|
|
Yes.
Note: My production enviroment has the SQL Server and IIS on seperate boxes. This gives more RAM room for each application.
|
|
|
|
|
Michael Potter wrote: Note: My production enviroment has the SQL Server and IIS on seperate boxes. This gives more RAM room for each application.
Wait a minute, so you're saying that the SQL Server and IIS don't need to be installed on my workstation machine? They could be on a remote server computer?
|
|
|
|
|
Yes, SQL Server can be anywhere on the network you want. You can even expose one directly to the Internet and access it from across the globe on the public internet (not recommended).
If you intend to develop ASP.Net applications, VS runs some kind of IIS based system when you are testing on the local box. This is a requirement unless you want to make your development really difficult.
SQL, on the other hand, is no more difficult to handle remotely as it is locally. The only thing that changes is the connection string. See http://www.connectionstrings.com/[^]
-- modified at 10:55 Wednesday 22nd March, 2006
|
|
|
|
|
Hey Michael, thank you for your reply.
|
|
|
|
|
If u are not storing naything inside database and using specifically client side applications then u don't really need to install it
U may have some other options for storage
"Aim to go where U have never been B4 and Strive to achieve it"
http://groups.yahoo.com/subscribe/dotnetforfreshers
http://himabinduvejella.blogspot.com
|
|
|
|
|
In case anyone is interested, a new Sql Intellisense addin for VS 2003/2005 was just released:
SqlAssist, www.roundpolygons.com[^]
Many features beyond just fast intellisense...
~Steve
|
|
|
|
|
Hi Steeve,
Thanks a lot
"Aim to go where U have never been B4 and Strive to achieve it"
http://groups.yahoo.com/subscribe/dotnetforfreshres
http://himabinduvejella.blogspot.com
|
|
|
|
|
hi all
I have declare following variable in a function
DECLARE @strTemp VARCHAR(100)
SET @strTemp=(SELECT AiLine From Table1 WHERE id=1)
Now can I get the true Length of the '@strTemp' Value?
can any body please help me..
Thanks in advace.
|
|
|
|
|
DECLARE @strTemp varchar(100)
DECLARE @Length int
SELECT @strTemp = AiLine, @Length = DATALENGTH(AiLine) FROM Table1 WHERE id=1
|
|
|
|