Hi
I am using Visual Studio.Net 2003 and SQL 2000
Web applications run using the ASPNET user account.
I have to set up this account and grant it permissions before my Web application will have access to a SQL database.
How do I grant permissions ?.
Hi
I am using Visual Studio.Net 2003 and SQL 2000
Web applications run using the ASPNET user account.
I have to set up this account and grant it permissions before my Web application will have access to a SQL database.
How do I grant permissions ?.
Hi,
I have a asp.net 2.0 web applicaiton which is connecting to the remote SQL server 2005. When I run the Web app, then Iam connecting to the DB and its displaying the records on the page.
When I browse the same page from the IIS, then iam getting the following error:
"System.Data.SqlClient.SqlException: Login failed for user 'mydomain\user' "
Connection string :
connectionString="Data Source=MySystem;Initial Catalog=DBLive;Integrated Security=SSPI;" providerName="System.Data.SqlClient"/>
Please let me know if find accross a solution for this...
Thanks
Vaskam
Verify the 'user' assigned to the Web Servers' AppDomain.
Somewhere, you seem to have assigned the security to 'mydomain\user' -I hope that your domain is NOT called 'mydomain' and that you do NOT have a user named 'user'.
I was wondering if anyone sees a way to make this faster, its not super slow(10-300 seconds) right now but it has to be run up to 40 times in a row with different variables which combined can take up to 60 minutes.
With CorrectTab(SumCol,Loc1,Loc2) as
(
Select Sum(coltobesum1),Loc1,Loc2
from [Dat1].dbo.Table1 where (CCol=@.cCol) and Quarter=@.Quarter and Year=@.Year and area='D'
Group By Loc1,Loc2
),
CombinedCorrectTab(SumCol2,SumCol,SumColPer,Loc1,Loc2) as
(
Select Sum(coltobesum2)*10 as SumCol2,Min(SumCol)
,((Min(SumCol)-Sum(coltobesum2)*10)/(Sum(coltobesum2)*10))+1.0
,Table2.Loc1,Table2.Loc2
from Table2,CorrectTab
where (OpCCol=@.CCol)
and Table2.Loc1=Table1.Loc1
and Table2.Loc2=Table1.Loc2 and newcoltobesum is null
Group by Table2.Loc1,Table2.Loc2
)
Update Table2
Set NewColtobesum=coltobesum2*SumColPer
from CombinedCorrectTab
where (OpCCol=@.CCol) and Table2.Loc1=CombinedCorrectTab.Loc1 and Table2.Loc2=CombinedCorrectTab.Loc2
How many rows are being updated? If it is one row at a time, you might build a table of @.cCol values to join to rather than doing it multiple times... This is especially true if each of these updates does a table scan.
Can you post the plan? Use:
set showplan_text on
go
<exec query>
go
set showplan_text off
go
You can also use batch updates: place your update statement in a loop and set rowcount 1000 or 10000 (depending on what's faster)..
P.S. Nice nick
|||You may also consider using a temporary table to hold the calculation values that does not change between various parameter invocations of the UPDATE statement. With the CTE approach, you are essentially doing the work every time you perform the UPDATE statement. So using temporary table will considerably reduce the time taken to run the UPDATE statement. Apart from this, there are other factors that affect the UPDATE statement performance:
1. Indexes on the table (one being updated). You might consider dropping unnecessary indexes
2. Does the table have triggers? What about the logic in the triggers?
3. If you are running the same UPDATE statement multiple times then you can also consider storing the different parameter values in a temporary table and joining against that as suggested by Louis. This will also help
4. Lastly, if you are updating large number of rows then consider running the UPDATE in batches using the TOP clause
I was wondering if anyone sees a way to make this faster, its not super slow(10-300 seconds) right now but it has to be run up to 40 times in a row with different variables which combined can take up to 60 minutes.
With CorrectTab(SumCol,Loc1,Loc2) as
(
Select Sum(coltobesum1),Loc1,Loc2
from [Dat1].dbo.Table1 where (CCol=@.cCol) and Quarter=@.Quarter and Year=@.Year and area='D'
Group By Loc1,Loc2
),
CombinedCorrectTab(SumCol2,SumCol,SumColPer,Loc1,Loc2) as
(
Select Sum(coltobesum2)*10 as SumCol2,Min(SumCol)
,((Min(SumCol)-Sum(coltobesum2)*10)/(Sum(coltobesum2)*10))+1.0
,Table2.Loc1,Table2.Loc2
from Table2,CorrectTab
where (OpCCol=@.CCol)
and Table2.Loc1=Table1.Loc1
and Table2.Loc2=Table1.Loc2 and newcoltobesum is null
Group by Table2.Loc1,Table2.Loc2
)
Update Table2
Set NewColtobesum=coltobesum2*SumColPer
from CombinedCorrectTab
where (OpCCol=@.CCol) and Table2.Loc1=CombinedCorrectTab.Loc1 and Table2.Loc2=CombinedCorrectTab.Loc2
How many rows are being updated? If it is one row at a time, you might build a table of @.cCol values to join to rather than doing it multiple times... This is especially true if each of these updates does a table scan.
Can you post the plan? Use:
set showplan_text on
go
<exec query>
go
set showplan_text off
go
You can also use batch updates: place your update statement in a loop and set rowcount 1000 or 10000 (depending on what's faster)..
P.S. Nice nick
|||You may also consider using a temporary table to hold the calculation values that does not change between various parameter invocations of the UPDATE statement. With the CTE approach, you are essentially doing the work every time you perform the UPDATE statement. So using temporary table will considerably reduce the time taken to run the UPDATE statement. Apart from this, there are other factors that affect the UPDATE statement performance:
1. Indexes on the table (one being updated). You might consider dropping unnecessary indexes
2. Does the table have triggers? What about the logic in the triggers?
3. If you are running the same UPDATE statement multiple times then you can also consider storing the different parameter values in a temporary table and joining against that as suggested by Louis. This will also help
4. Lastly, if you are updating large number of rows then consider running the UPDATE in batches using the TOP clause
Hi everyone.
Using C# 2005 EE with SQL 2005 EE
I am really new to SQL, got qns here.
Can my program with SQL database run correctly on another com using win xp home edition, with only C# 2005 EE installed?
Is it compulsory for every table in a database to have a primary key?
Can I extract a data from a specific cell in a database table(click button get data)? How do I go about doing it (the simplest n straight forward method)?
Many Thanks in advance.
Regards,
dragoncells.
Hi !
"Can my program with SQL database run correctly on another com using win xp home edition, with only C# 2005 EE installed?"
YOu compiled application (The actual exe you produce with compiling) will work on every computer which has the requisites installed that you need in your application (at leat the .NET Framework). If you using an installer instead of Xcopy deployment you can also package the prerequisites ensuring that the client will fullfill the requirements.
"Is it compulsory for every table in a database to have a primary key? "
Thats all about database design, primary keys will help you to keep unique integrity throught he database and integrity with the other tables using PK/FK relations. They help you (and behind the scenes the SQL Server) to create and retrieve data by a unique identitifer.
"Can I extract a data from a specific cell in a database table(click button get data)? How do I go about doing it (the simplest n straight forward method)?"
I am not quite sure what you mean, but from my understanding you want to retrieve an specific attribute (your cell) from a row in a table. Therefore you will have to create a SQL query like the following one:
SELECT YourAttributeName_Column FROM YourTable Where <filter the row out by specifying the condition like SOmeCOlumn = 'SomeValue'>
HTH, Jens K. Suessmeyer.
http://www.sqlserver2005.de
|||
Additionally info about me: I am also Absolute Beginner in C# 2005 EE.
when you wrote "YOu compiled application (The actual exe you produce with compiling) will work on every computer which has the requisites installed that you need in your application (at leat the .NET Framework). If you using an installer instead of Xcopy deployment you can also package the prerequisites ensuring that the client will fullfill the requirements."
I assume you are telling me that if my application has a SQL database than I must have SQL server 2005 EE installed on that computer for it to work.
And what do you mean by Xcopy deployment?
Installer? I thought when I publish the application it comes with the installer?
**Note**
I replied to Jens post(1:27pm) but it does show properly.
Edited: Backed to normal.
|||dragoncells wrote:
I assume you are telling me that if my application has a SQL database than I must have SQL server 2005 EE installed on that computer for it to work.
You don′t need to have a SQL Server on the actual machine if you have another server in the network you want to connect to. Assuming that another server in the network act as a SQL Server you don′t have to install the SQL Server Express on the client machine.
"And what do you mean by Xcopy deployment?"
Xcopy deployment is possible because if the .NET framework is installed on the client machine no other things have to be registered like in the old days. YOu can just copy the application over (and also overwrite it with a newer version and it will work.
"Installer? I thought when I publish the application it comes with the installer?"
I don′t know which project type you are using. You will need an installer if you use components which do not easily install by just copying the files over, or if they have to be "installed" or copied in a different way.
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
That means Xcopy deployment is obsolete nowadays.
Using C# 2005 EE, working on a windows application project. When I publish my application it does come with a installer automatically?
|||No and no as the answer :-)
"That means Xcopy deployment is obsolete nowadays."
Seems that my description was too fuzzy. It is absolutely nice that you can do Xcopy deployment. Assuming that you want to update your application or an assembly within the application you just have to copy it over. Thats often used instead of uninstalling the old version and installing a new one.
A Windows application does not come automatically with a installer project. You will have to add one and will have to add the output files of your project solution to the installer project.
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de|||
Than what about the Publish properties, isn't it suppose to add a installer after I publish my application?
Does the forum have a suggestion area or something, so that microsoft can collect useful suggestions and try to improve the forums?
|||As being a moderator you can direct that directly to me. The thing with the quotes was fixed by me as it seems that the syntax I used is not supported by the forum.-Jens.|||
It slipped my mind that you are the moderator, lol.
Suggestions:
Images: Currently cannot post picture, a picture tells a thousand words.|||
nice suggestions, thanks. as we are currently working on additional features for the forums, we will take these under consideration and prioritize as appropriate. should you have additional suggestions, please be sure to post them in our suggestions forum.
best,
brian -- forums product manager
Ok.
=)
is it possible to run a trigger forever... whose work is to archive data from a table. or how can i do the operation to archive automatically ?
Regards,
Kamrul Hassan
Well... triggers cannot be used for schedule tasking, there are certain some ways to do this.
1st) if you are running on dedicated server then you can use windows service to update records periodically
2nd) Use Sql Server jobs. to know more about sql server jobs http://msdn2.microsoft.com/en-us/library/ms187880.aspx
cheers..
SQL About AMO,SQL AMO