MS SQL
Microsoft SQL Server
Recently I restored a MS SQL database from one server to another and starting getting an 'invalid user or password' error message. What happened was the database user became 'orphaned' on the target server. Here's how to remedy this problem:
Within SQL Management Studio run this command...
EXEC sp_change_users_login 'UPDATE_ONE','svcUser', 'svcUser'
where svcUser is the name of the user account being used to communicate with the database.
Here's how I return a null value for a sql data type of datetime:
newExpense.AMEXStatementDate = ConvertToDateTime(AMEXStatementDateTextBox.Text);
private DateTime ConvertToDateTime(string value)
{
if (!value.Equals(string.Empty))
return Convert.ToDateTime(value);
else
return (DateTime)System.Data.SqlTypes.SqlDateTime.Null;
}
I recently built a SSIS package that included a web task and script task. The web task called a remote web service to pull in needed data. The script task wrote text files based on the data. All worked great on my development environment. However, once deployed it started throwing this error:
Code: 0xC0016016 Source: Description: Failed to decrypt protected XML node "DTS:Property" with error 0x8009000B "Key not valid for use in specified state.". You may not be authorized to access this information. This error occurs when there is a cryptographic error. Verify that the correct key is available. End Error
Thanks...
I kept getting a Failure while applying Microsoft SQL Server 2005 Service Pack 2 today for 'Database Services' and 'Analysis Services'. It was a brand new installation so I couldn't think of anything that would cause this. I found a kb on Microsoft's site that fixed the failure for 'Database Services'. I'm still getting the failure on Analysis Services. I will update this post when I find the solution.
Missing your SQL Server Management Studio after installing SQL Server 2005? When creating my Microsoft Office SharePoint Server (MOSS) development environment I had the same problem. Thankfully, Pete Orologas posted a solution and it worked for me. Apparently, if there is already a \Program Files\Microsoft SQL Server\90\Tools folder that exists then the installer moves on to the next step. How does that subfolder get there? Well, if you install Visual Studio before SQL it creates the folder when installing SQL Express. Or if you install the SQL Express edition it will create the tools folder.
THE SOLUTION?
Rename the Tools folder to something...