|
Yes.
I understand it.
Thank you very much.
|
|
|
|
|
Dear sir i have installed sqlserver 2008 r2 sp2 & vs.net 2010 I make a project in ado.net to add data in sql database with no error. the program runs well but when i go to the add button it says that "Login failed for this user" plzzzzzzzzzz help.....
|
|
|
|
|
Not enough information!
Use SQL credentials - user id and password registered in SQL server, do NOT use integrated security.
Create the user for your app in SQL server eg userid - MyAppUser
Give the user dbo rights to your database
Use those credentials in your connection string.
If this does not make sense to you then get a book or an article and work through the examples.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
What help do you need? The error tells you exactly what the problem is.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Case 1:
Suppose there are two computers (Ser1, Ser2) and SQL Server 2005 Express is installed on each machine, the input will be stored on the machine Ser1, if the data changes on the computer Ser1 will be updated again computer Ser2, the ask my SQL Server 2005 express can update data on the computer Ser2 from Ser1 ? How the computer config ?
Case 2:
Suppose there are two computers (Ser1, Ser2) and SQL Server 2005 Express is installed on each machine, the input will be saved to Ser1 or Ser2, meaning that if the computer Ser1 busy, it will save computer Ser2 or else, and 2 machine Ser this is always synchronized data.
if I understand this issue I find the document what ? or what keywords to search on google.com?
|
|
|
|
|
Here you go some Google Foo[^]
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I do not get through formal classroom training school, not knowing I ask you help, if you are not only helping out loud, do not know without question, the more bites.
|
|
|
|
|
And english is not your first language, I understand that. However the results of the search I supplied will give you more information and better resources than a forum post. Your requirement is not trivial small.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
SQL Server 2005 Express cann't create Replication\Local subcriptions ? because sql warning: Microsoft SQL Server Management Studio is unable to access replication components because replication is not installed on this instance of SQL Server. For information about installing replication, see the topic Installing Replication in SQL Server Books Online.
|
|
|
|
|
I would not expect replication to be available in an Express version as it is one of the advanced features of the database but I don't know as I use neither the Express nor do I need the replication features.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I configure SQL Server Merge Replication, when merger database together, if one of the two server machines damaged or die, the software did not transfer it, i have to manually reset ip to the software to run, how to automatically switch to 1 in 2 server fails ?
|
|
|
|
|
How can I change the below code snippet from using cursor to using table expression. The below code is about getting specific data for general account and all accounts below such given account
FUNCTION [dbo].[GetChildrenAccount]
(@AccountID INT,
@DateFrom DATETIME,
@DateTo DATETIME,
--@TypeTransaction INT,
--@Currnecy INT,
@Branch INT)
RETURNS DECIMAL(18,3)
AS
BEGIN
DECLARE @Account_ID AS BIGINT,
@IsLeaf AS BIT,
@TotalValue AS DECIMAL(18,3),
SELECT @TotalValue = ISNULL(SUM(JournalDet_Debit),0) * CASE WHEN @Currnecy = 0 THEN AccountBranch_CurrencyConv ELSE 1 END
FROM AccountTree
INNER JOIN Account_InBranch ON (AccountBranch_AccountID = Account_ID)
LEFT JOIN Journal_Details ON (Account_ID = JournalDet_AccountID)
LEFT JOIN Journal_Head ON (Journal_ID = JournalDet_HeadID)
WHERE (Account_ParentID = @AccountID OR Account_ID = @AccountID )
AND Journal_BranchID = @Branch
AND Journal_Date >= @DateFrom AND Journal_Date <= @DateTo
GROUP BY AccountBranch_BegBalDebit , AccountBranch_BalanceDebit , AccountBranch_CurrencyConv
OPEN GetAccount_ID
FETCH NEXT FROM GetAccount_ID INTO @Account_ID
WHILE @@fetch_Status = 0
BEGIN
SET @TotalValue = @TotalValue + dbo.GetChildrenAccount(@Account_ID,@DateFrom,@DateTo,@Branch)
FETCH NEXT FROM GetAccount_ID INTO @Account_ID
END
CLOSE GetAccount_ID
DEALLOCATE GetAccount_ID
RETURN ISNULL(@TotalValue,0)
END
|
|
|
|
|
You seem to be missing the definition of your GetAccount_ID cursor.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I removed some parts of the function when posting may be I forgot and remove the declaration for
GetAccount_ID and here is the declaration
DECLARE GetAccount_ID CURSOR STATIC FOR
SELECT Account_ID FROM AccountTree WHERE Account_ParentID = @AccountID AND Account_Isleaf = 0
|
|
|
|
|
It's tricky to answer without your table definitions and some sample data, but this should get you close:
WITH cteAccountTree As
(
SELECT
@AccountID As Account_ID
UNION ALL
SELECT
P.Account_ID
FROM
cteAccountTree As P
INNER JOIN AccountTree As C
ON C.Account_ParentID = P.Account_ID
And
Account_Isleaf = 0
)
SELECT
@TotalValue = IsNull(Sum(JournalDet_Debit), 0) * CASE WHEN @Currency = 0 THEN AccountBranch_CurrencyConv ELSE 1 END
FROM
cteAccountTree As T
INNER JOIN Account_InBranch As B ON B.AccountBranch_AccountID = T.Account_ID
LEFT JOIN Journal_Details As JD ON JD.JournalDet_AccountID = T.Account_ID
LEFT JOIN Journal_Head As JH ON JH.Journal_ID = JD.JournalDet_HeadID
WHERE
Journal_BranchID = @Branch
And
Journal_Date Between @DateFrom And @DateTo
;
The first part is a recursive common table expression (CTE):
How to use recursive CTE calls in T-SQL[^]
This should return the list of all accounts in the tree which have the specified account ID as an ancestor, excluding any with the Account_Isleaf flag set.
NB: If your tree is particularly deep, you might run into the default recursion limit. There will probably be a way to work around it, but it won't be as nice as the recursive CTE solution.
You then join the tree of account IDs to your branch and journal tables to calculate the total in one hit.
The only part I'm not sure about: your code seems to be double-counting at each level:
<hr size="1" color="#63B4FF" noshade="">
<span style="color: rgba(0, 88, 170, 1)">
<cite>"These people looked deep within my soul and assigned me a number based on the order in which I joined."</cite>
- Homer
</span>
|
|
|
|
|
Thank very much for help. I'm trying to learn about recursive expression table however I cannot know how its really work The Where clause you mentioned at the end of your post to be able to get the parent account and its child(s) too and that what I forgot to mention in the post because I did not know it at the time when I wrote the post what I need to get is the parent account and its child(s) account(s) and if those child(s) account(s) is/are a parent(s) for another child(s) account(s) I got them too it seems stupid but this function is used within a procedure to get the balance of the account chart within the system.
Finally, I'm thanking you too much. could you help sending me a link to an explanation of the recursive CTE and how it is implemented
|
|
|
|
|
|
Appreciating your help. Thanks very much I will review the function again as I'm not the one who wrote it however I'm trying to optimize a Stored Procedure performance which selects from a lot of tables + calling this function. the last time I executed the procedure it nearly took over 14 minutes without a single result while it was still executing
|
|
|
|
|
hi - How can you tell if a SQL Server instance max'ed out bottleneck is Memory? It's on a 8GB box with two processors. Seems CPU ok. Memory max out the whole time while this big SELECT-INTO statement is running. Avg Disk Queue lenght ok - avg below 1.0 so doesn't appear disk/paging is causing problem.
However, fact from Task Manager memory keeps 7 GB out of 8GB over the whole time doesn't mean memory is the bottleneck? Or is it?
The same query runs on another SQL server with double the RAM finishes a few times quicker however.
Any advises? Thanks
dev
|
|
|
|
|
Check the configuration on the SQL Server instances to see what the maximum amount of memory is that is allocated to them. I'm don't remember where it is, but that is a starting point.
|
|
|
|
|
Thanks alot
It works
|
|
|
|
|
Hi everyone
I am facing problem while I write the following syntax on command prompt:
c:\>mysqldump
Error is: "mysqldump: unknown option '--no-beep'"
please let me know the solution.
(Riaz)
|
|
|
|
|
Try removing the option from the configuration file and try again.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I want to send Email to Many Users from One Email Address. I did configured the Database Mail. After Scheduled this Job, It is sending Emails to some users and failing to some users. Following are the Error Message am getting from the Log.
1)The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 3 (2014-12-08T16:01:56).
Exception Message: Cannot send mails to mail server. (The operation has timed out.).
2)The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 3 (2014-12-08T16:02:05).
Exception Message: Cannot send mails to mail server. (Failure sending mail.).
I am getting this Time Out Message even after Updating the Time Out to 60 Sec
|
|
|
|
|
I wanted to add database services to my windows app, but didn't want to use SQL Server, Access or even a DBF file would of been fine.
So the code below works fine, creates a database file, but off the top of your head, will I need to have sql server installed on other client machines?
Dim m_connString As String = "Data Source=(LocalDB)\v11.0; Integrated Security=True;"
Dim myConnection As SqlConnection = New SqlConnection(m_connString)
Dim myQueryString As String = _
"CREATE DATABASE STREAKWAVE ON PRIMARY " & _
"( " & _
" NAME = STREAKWAVE, " & _
" FILENAME = '" & m_storagePath & "\STREAKWAVE.mdf', " & _
" SIZE = 10MB, " & _
" MAXSIZE = 500MB, " & _
" FILEGROWTH = 10% " &
") " & _
" LOG ON " & _
"( " & _
" NAME = STREAKWAVE_Log, " & _
" FILENAME = '" & m_storagePath & "\STREAKWAVE.ldf', " & _
" SIZE = 1MB, " & _
" MAXSIZE = 500MB, " & _
" FILEGROWTH = 10% " & _
") "
|
|
|
|