sql-server-2005

SQL Server does not exist or access denied error

有些话、适合烂在心里 提交于 2019-12-23 02:36:37
问题 I have an application that runs fine when executed off the server. When clients try to connect, they receive the following error: Failed to get data. *Data provider could not be initialized *SQL Server does not exist, or access denied on my Office Web Components (MDAC). I am guessing there is some security or server configuration error, but I'm not able to pinpoint it. I am running SQL Server 2005. *Note - clients can't change their security settings, company policy. 回答1: When you try this

How can I display two rows worth of data on one line side-by-side in Report Designer?

前提是你 提交于 2019-12-23 02:31:53
问题 I am using SQL Server Reporting Services 2005, and I'm developing a report in Report Designer/Business Intelligence Studio. Right now I have a normal-looking table that displays data like this: ---------------- | A | B | C | ---------------- | A1 | B1 | C1 | ---------------- | A2 | B2 | C2 | ---------------- | A3 | B3 | C3 | ---------------- What I would like to do, is display two rows side-by-side on the same line, so that the table would look like this: ------------------------------- | A |

How to convert timezones in SQL Server 2005?

巧了我就是萌 提交于 2019-12-23 02:09:25
问题 All my times are in UTC timezone now I need to somehow convert it to the users timezone(I have it stored in the db as well and uses the ids of the windows timezones). How can I do this in SQL Server 2005? Edit So I tried to do that extended stored procedure but with Timezoneinfo I get this error Deploy error SQL01268: .Net SqlClient Data Provider: Msg 6503, Level 16, State 12, Line 1 Assembly 'system.core, version=3.5.0.0, culture=neutral, publickeytoken=b77a5c561934e089.' was not found in

How to Update SQL Server Table With Data From Other Source (DataTable)

不打扰是莪最后的温柔 提交于 2019-12-23 02:07:07
问题 I have a DataTable which is generated from .xls table. I would like to store this DataTable into an existing table in SQL Server database. I use SqlBulkCopy to store rows which have unique PK . Problem is, I also have other rows which have same PK as SQL Server table but contain cells with different value compared to SQL Server table. In short: Let's say in my DataTable I have a row like this: id(PK) | name | number 005 | abc | 123 006 | lge | 122 For my SQL server I have sth like this; id(PK

SQL Insert multiple rows using stored procedure and xml parameter?

匆匆过客 提交于 2019-12-23 01:46:29
问题 I've used a table valued parameter before, but I'm not sure how to use xml. I do not know the best way to format my xml but I think I would try this: <Car> <Name>BMW</Name> <Color>Red</Color> </Car> Then I would pass the xml (one or more car) to the stored procedure and it would insert one row for each car I pass (with the name going in a name column etc..) Does anyone know how to write the stored procedure? (I'd usually try it myself but I don't have much time for testing T_T) 回答1: You can

Web Site Administration Tool: Unable to connect to SQL Server database (using SQL Server Development Edition)

三世轮回 提交于 2019-12-23 01:34:29
问题 I am using the ASP.NET 2.0 and I am using local server --> SQL Server 2005 Development Edition. WHen I go into VIsual Studio 2.0 Professional and go to menu item WEBSITE --> ASP.NET CONFIGURATION, the ASP.NET Web Site Administration Tool shows. When I click on the Security link, after about 30 seconds an error pops saying Unable to connect to SQL Server database. I can connect to the SQL database via Server Explorer in VS 2005 and also via Grid Control etc but I keep getting the error when I

How to Convert a SQL Query using Common Table Expressions to One Without (for SQL Server 2000)

旧巷老猫 提交于 2019-12-22 19:00:25
问题 I just found an adequate solution to How to Find Rows which are Duplicates by a Key but Not Duplicates in All Columns?, coded the stored procedure, then learned that the database is stuck at SQL Server 2000. My solution, of course, relies heavily on Common Table Expressions. Can anyone provide me a set of ru les for converting back to the SQL Server 2000 dialect? Note that I have things like thisL: ; WITH CTE1 AS ( ... ), CTE2 AS (SELECT ... FROM CTE1 ... ), CTE3 AS (SELECT ... FROM CTE1

SQL Server replication without deletes?

馋奶兔 提交于 2019-12-22 18:05:09
问题 Is there a way to replicate a sql server database but not push out deletes to the subscribers? 回答1: Do this....Drop the article. Create a new storedprocedure in the corresponding database that mimicks the system store procedure (sp_del...) and contains the same parameter but does nothing. Add the article again...and set the delete store procedure under the article's properties to the new delete stored procedure that you created.... Or you can select Do not replicate Delete Statements....I

A good SQL strategy for fuzzy matching possible duplicates using SQL Server 2005

房东的猫 提交于 2019-12-22 17:56:21
问题 I want to find possible candidate duplicate records in a large database matching on fields like COMPANYNAME and ADDRESSLINE1 Example: For a record with the following COMPANYNAME: "Acme, Inc." I would like for my query to spit out other records with these COMPANYNAME values as possible dups: "Acme Corporation" "Acme, Incorporated" "Acme" I know how to do the joins, correlated subqueries, etc. to do the mechanics of pulling the set of data I want. And I know that has been covered on here before

How can I get Stored Procedure return value in C#?

谁都会走 提交于 2019-12-22 17:56:15
问题 I have a stored Procedure that do some operation and return 1 or 0 as below CREATE PROCEDURE dbo.UserCheckUsername11 ( @Username nvarchar(50) ) AS BEGIN SET NOCOUNT ON; IF Exists(SELECT UserID FROM User WHERE username =@Username) return 1 ELSE return 0 END and in C# i want to get this returned value i try ExcuteScalar but it didn't return any value ( i know if i replace return 0 with Select 0 ExcuteScalar will catach it .. but is it any way that allow me to get returned value with replace