DataSource Controls :: Group By With No Repeated Data In Sqlserver 2005?
Jan 28, 2010
The below query produce the below output.
[code]...
select r.Name,c.Name,s.Name,(select count(p1.id)from profiles p1 where r.id=p1.religion and c.id=p1.caste and s.id=p1.subcaste and p1.Gender=1)as Male,(select count(p1.id)from profiles p1 where r.id=p1.religion and c.id=p1.caste and s.id=p1.subcaste and p1.Gender=2)as Female from religion r,profiles p,caste c,subcaste s where r.id=p.religion and c.id=p.caste and s.id=p.subcaste group by r.Name,c.Name,s.Name,r.id,c.id,s.id
View 3 Replies
Similar Messages:
May 18, 2010
Currently I am working in Sql server 2005. I do not know the Sql Server 2000 and Sql Server 2008. what is the difference between Sql server 2005 and 2008?
What is the Difference between Sql Server 2000 and Sql Server 2005
View 3 Replies
Mar 25, 2010
how to install microsoft sqlserver 2005 or 2008 on window 7 with x64 bit.It works perfectly on vista but on getting a new system which comes with window 7 and x64bit i was unable to load the software onit except my visual studio 2008.
View 1 Replies
Feb 18, 2010
give me a simple example to write an exception in stored procedure
View 2 Replies
Jul 8, 2010
i need record with id 1 and 3 only how do i get in sql server 2005.(means distinct empcod onl.
View 3 Replies
Apr 26, 2010
I have a web applicaton run at godaddy hosting and have a sqlserver 2005 database hosting also by godaddy .From 1 week My web site hacked , by putting a strange script at all my .ASPx and the same strange script at all my database row.after that I remove the permission and make only permission of view filesand after that yesterday my web site hacked again by the strange script??? but my files didn't hacked .I scaned all my web sites files with updated antiviruse and with malware application but they didn't find any thing
View 5 Replies
Apr 2, 2010
This is surareddy. i nead some small clarification in the "Stored Procedure"
how to convert the oracle Stored Procedure to sqlserver2005/2008 Stored Procedure.
right now i am enhancing the project that project already developed the oracle Stored Procedure. now our company is using sqlserver 2005/2008.
how to convert the Oracle Stored Procedure to sqlserver 2005 Stored Procedure
View 4 Replies
Jun 14, 2010
i am trying but i am unable to do this one.
View 2 Replies
Jan 8, 2010
I have problem like to count the repeated chars from a string using sql server.Also i have used functions in sql server thats working fine.But i want the solution using a sql query...
[i have a column like ID,name,Secure_name],here 1 ,'kamal','welcome'.so findout 'e' howmany times repeated in a column secure_name.....
View 2 Replies
Feb 10, 2010
I am using vs2008, Sqlserver2008.
my table: PostGL having data like thi
AutoIdx TxDate Id AccountLink Description Debit Credit
3 2010-01-22 JL 2 bcb 0 35.09
5 2010-01-28 JL 2 g 3.51 0
select AutoIdx,TxDate,Id,AccountLink,Description,Debit,Credit,(Debit-Credit) as Actual from PostGL where Id='JL' and AccountLink=2
AutoIdx TxDate Id AccountLink Description Debit Credit Actual
3 2010-01-22 JL 2 bcb 0 35.09 -35.09
5 2010-01-28 JL 2 g 3.51 0 3.51
I am trying in view like this
declare @cnt int
declare @i int
set @budget=20
set @cnt= (select COUNT(*) from PostGL where AccountLink=2 )
set @i=1
WHILE (@i<=@cnt )
BEGIN
set @tdebit=??
END
I am taking count the no of rows having AccountLink=2
I need to read all debit,credit and add all debit into totaldebit,all credit into totalcredit independently from table.
then i need to show the totaldiff as Actual.
i need ....totaldiff=totaldebit-totalcredit
View 3 Replies
Feb 18, 2010
i am Using sql server 2005. i want to copy the data of the excel file to the table.
i wrote the query like :
INSERT INTO test(empId,empName,empMailId,empContactNo)
SELECT *
FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=C: estExcel.xls',
'SELECT * FROM [Sheet1$]')
got the following error :
SQL Server blocked access to STATEMENT 'OpenRowset/OpenDatasource' of component 'Ad Hoc Distributed Queries' because this component is turned off as part of the security configuration for this server. A system administrator can enable the use of 'Ad Hoc Distributed Queries' by using sp_configure. For more information about enabling 'Ad Hoc Distributed Queries', see "Surface Area Configuration" in SQL Server Books Online.
then did this
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'Ad Hoc Distributed Queries', 1;
GO
RECONFIGURE;
GO
again am trying the same above query ,now am getting the following error:
Msg 7399, Level 16, State 1, Line 1 The OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)" reported an error. The provider did not give any information about the error. Msg 7303, Level 16, State 1, Line 1 Cannot initialize the data source object of OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)".
i want to copy the data of the excel sheet to the table.
View 2 Replies
Jun 16, 2010
I want use select * from sample (tablename) ,which returns only those columns from sample table which does not have xml data type.
note : sample table contains some columns which have xml data type .
View 6 Replies
Apr 29, 2010
I'm trying to display using this query:
SELECT documentcategoryname, documentname, documentid FROM documents
INNER JOIN documentcategory
ON documents.documentcat = documentcategory.documentcategoryid
WHERE documentsiteid = @siteid
GROUP BY documentcategoryname, documentname, documentid
Which gives the following results:
documentcategoryname | documentname | documentid
About Us doccy3 3
About Us doccy4 4
Map Of Medicine doccy5 5
Is there a way using vb.net I can just display the category name once, and the documents underneath it like below:
About Us
doccy3
doccy4
Map Of MEdicine
doccy5
My code so far is:
If pagesreader.Read() Then
' output documentcategoryname
mydata &= "<h2>" & reader.Item("documentcategoryname") & "</h2>"
'display document list here using while loop?
End if
View 5 Replies
Feb 8, 2010
I'm attempting to further reduce a dataset/table by various user input. Part of this process is grouping the data by a timestamp prior to a summation. I'm trying to use LINQ and cannot get the data returned that I need.
[Code]....
View 7 Replies
Sep 23, 2010
[Code]....
Complete error msg with the trace
[Code]....
Source File: C:UserssharmilaDocumentsVisual Studio 2008WebSitesWebSite16PostJobs.aspx.vb Line: 46 Stack Trace:
[Code]....
View 9 Replies
Mar 5, 2010
I have made a query based upon that the output is come as follow:-
[Code]....
Output should be like this:-
[Code]....
Means we need to concat all serial no in one row itself for a single group of data.
View 5 Replies
Feb 19, 2010
i have an excel sheet where i try to upload my excel sheet to sqlserver all having same colum name. now i do not want to add dll files as an web reference in my project. rather place the (dll) in an folder and call them dynamically in .cs side.now i am doing like this
var assembly = Assembly.LoadFrom(@"d:abcmicrosoft.office.interop.excel.dll");
now in my .cs page i need to generate this property or methods of an excel dll which i have loaded dynamically
microsoft.officce.interop.excel.applicationClass excel= null
so that after loading my excel dl dynamically i need to sent values from my excel sheet to sqlserver 2005
View 4 Replies
Apr 11, 2010
we have local net in our company.(we dont have win server.)
now i want to know how i can connect to the sqlServer in pc1 from pc2?
View 1 Replies
May 14, 2010
i have been trying to connect to SQLserver from ASP.net web developer in an n-tier architecture.But it shows this error in conncetion
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
View 3 Replies
Jun 27, 2010
I really need to create ID like this. But I don't know how use this Procedure .If you don't mind can you explain to me step by step how to use to procedure for create auto ID in database. (Should I call to this Procedure from somewhere else, like webpage button or something)
View 4 Replies
May 8, 2010
i am new to this cubes concept in sqlserver . i need to connect to cubes and and query and get an result and display that result in grid view
how to connect to an cube, articles on it, code any thing
View 1 Replies
Apr 28, 2010
I have a problem with saving hebrew into sqlserver.I've done it before in another computer but did not have problem.Now the hebrew is saved as '???'.About the field collation, it is latin1_general_cp1_ci_as in another DB I have in another computeranf also in the current field in the current DB.I guess it not the collation.Ialso tried to change the text field to varchar, but it still saves '???'.
View 9 Replies
Jun 28, 2010
I try to import Excel files to sqlserver problem is that the number and the titles of columns are dynamic.How can i do that by code?
View 5 Replies
Jun 24, 2010
I am using Sqlserver2008.
I want to konw how to get TransactionID(customized auto generated number) with 9dgits(2 alphabets, 7 numerics).
[Code].....
View 2 Replies
Mar 21, 2010
I have a select query where iam fetching the data from minimum of 7 different tables by using innerjoin. I have 3 lakhs of records in that table.BY using cache Iam fetching all 3lakhs of records at a time and put in cache. by using the rowfilter i use the records.firsttime when iam fetching these 3lakhs records it takes 3min. want to improve the performance of time.How to improve the performance of time?
View 1 Replies