sql-server-2008-r2

sql server back restore - login failed

荒凉一梦 提交于 2019-12-08 08:16:22
问题 I have a local database on sql server 2008 R2 and working fine, My hosting have sql server 2012 installed. After creating a fresh database on hosting server, I can connect easily to the blank database with given hosting credentials I have created Sql Server 2008 backup and restored it to the hosting and every stops working. Cannot open database "dbName" requested by the login. The login failed. Before Creating a backup I did created a new user with the same credetianls as provided by hosting

Compare 2 tables in sql

為{幸葍}努か 提交于 2019-12-08 07:38:58
问题 I have two tables, A1 and A2. I want to compare these two tables. I tried inner join but it doesn't give the required result. These are the data in these tables, Table A1 No. Address 1 abc 1 abc 1 def 1 def Table A2 No. Address 1 def 1 abc 1 abc 1 def These two tables can only be joined by using No. column. So if I use INNER JOIN it gives 16 rows. I don't want that, I want only 4 rows to be displayed. This should be the output: No. Address eq 1 abc # 1 abc * 1 abc # 1 abc # Last column is

SQL 2008 R2 - Reporting Services, using Data Model with Report Builder 3 over internet causes crash, any ideas?

余生长醉 提交于 2019-12-08 07:33:30
问题 Background: I have a Windows 2008 R2 box set up with SQL 2008 R2 both the Data Engine and Reporting Services. I have configured Reporting Services to use custom authentication (FormsAuthentication) that I wrote. The custom authentication gets passed the name of a user to treat as the admininistrator assuming they login correctly in the Reporting Services configuration files. The custom authentication when queried by Reporting Services about the current users permissions will always return

Get matching string with the percentage

孤人 提交于 2019-12-08 07:21:29
问题 I have the following details of the data: Table 1: Table1 is of small in size around few records . Table 2: Table2 is having 50 millions of rows. Requirement : I need to match the any string column from table1 to table2 for example name column to name and get the percentage of matching (note column can be any, maybe address or any string column which have multiple words in a single cell). Sample data: create table table1(id int, name varchar(100), address varchar(200)); insert into table1

How to register CLR User Defined Function for use in linq query?

耗尽温柔 提交于 2019-12-08 05:42:05
问题 Using SQL Server 2008 I'd like to run a regex on a DB value before comparing it. I'm looking into CLR User-Defined Functions (I investigated EDM Functions but I got the impression that UDFs were more appropriate with a regex - please correct me if I'm wrong). Ideally I'd like to make a linq call like this: var results= db.Items.Where(i => i.CustomFormatFunction() == xyz); So far I have this c# code: public static partial class UserDefinedFunctions { [SqlFunction] public static SqlString

Details rows inside tablix SSRS Reporting service, Records with Details rows under it

最后都变了- 提交于 2019-12-08 05:27:01
问题 Now it is a report with a tablix in which the records are like every row has some details rows under it. and the details row can have one or more records based on the main tablix rows To elucidate the problem, plz have a look Did some search here and there, but not able to figure out how to accomplish this. Sub-reports inside the tablix cell, but how will it keep the track of the current row One thing more : Do I need to create two separate datasets for this and bind accordingly or write

Self-joining query to find descendants of a node syntax issue

萝らか妹 提交于 2019-12-08 05:13:45
问题 I have a self-linking table that records one record for every "Step" in a process (Step.ParentStepId is a foreign key to Step.StepId): CREATE TABLE [dbo].[Step]( [StepId] [int] IDENTITY(1,1) NOT NULL, [Name] [varchar](50) NOT NULL, [Description] [text] NULL, [Sequence] [int] NULL, [ParentStepId] [int] NULL, CONSTRAINT [PK_Step] PRIMARY KEY CLUSTERED ( [StepId] ASC ) ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] ALTER TABLE [dbo].[Step] WITH CHECK ADD CONSTRAINT [FK_Step_Step] FOREIGN KEY(

How to configure a JDBC connection to use a different AD user than the current user?

99封情书 提交于 2019-12-08 04:58:39
问题 The MS SQL Server 2008 R2 database "dbname" hosted on server "HOSTNAME" is accessible by an Active Directory user from domain "ABC" , let's call him "dbuser" or "ABC\dbuser" . We are running our application as AD user "ABC\appuser" . "appuser" and "dbuser" are in different AD groups. When run by the service running under "ABC\appuser" , the connection uses user "ABC\appuser" to connect to the database: DriverManager.getConnection( "jdbc:sqlserver://HOSTNAME:1433;databaseName=dbname

BCP IN Error = [Microsoft][SQL Server Native Client 10.0]Invalid date format

大城市里の小女人 提交于 2019-12-08 04:57:13
问题 I am trying to insert some values in a table through BCP-IN by executing batch file.But facing this issue- Starting copy... SQLState = 22008, NativeError = 0 Error = [Microsoft][SQL Server Native Client 10.0]Invalid date format SQLState = 22008, NativeError = 0 Error = [Microsoft][SQL Server Native Client 10.0]Invalid date format SQLState = 22008, NativeError = 0 Error = [Microsoft][SQL Server Native Client 10.0]Invalid date format SQLState = 22005, NativeError = 0 The file thorugh which data

Conflict between Delphi and SQL server

冷暖自知 提交于 2019-12-08 04:26:10
问题 I have a Query that works in SQL Server as well but when i save it in ado query in delphi it doesn't work and stops with this error : Incorrect syntax near 'GO' But the below code is correct and has not any error . i was tested it in sql server . The below code is not Regular because i copy and past it from delphi . My Query : create function GetTedad(@pfcode INT, @pdcode INT) returns int as begin declare @Tedad int; select @Tedad= sum(t2.tedade_avalie) from Tbl_avalie_salon t2 where t2.FCode