sql-server-2008-r2

The formal parameter “@mode” was not declared as an OUTPUT parameter, but the actual parameter passed in requested output

感情迁移 提交于 2019-12-05 04:33:51
I have this stored procedure: ALTER PROCEDURE spCertificationType @result nvarchar(15) output, @mode int AS BEGIN if @mode = 1 begin exec spGeneratedID 2, @result output print @result end END but when I tried to execute it,it has this error The formal parameter “@mode” was not declared as an OUTPUT parameter, but the actual parameter passed in requested output. I tried to set @mode as output like this: ALTER PROCEDURE spCertificationType @result nvarchar(15) output, @mode int output AS BEGIN if @mode = 1 begin exec spGeneratedID 2, @result output print @result end END but the it returns a null

Can I create SSRS Reports in VS 2015 using SQL Server 2008 R2?

≡放荡痞女 提交于 2019-12-05 04:08:22
I'm new to SSRS. Recently upgraded my development environment from Visual Studio 2010 to Visual Studio 2015 Enterprise Edition. Currently my reports are made using Crystal Reports. I would like to to use SSRS and I'm trying find out my current environment will allow me to do it. So now I'm using Visual Studio 2015 and SQL Server 2008 R2. Can I create SSRS Reports using these two? If yes, how can I create it? I know how to create a report and publish it using the Business Intelligence Development Studio in SQL Server 2008 R2. But could not understand how I could use those reports in my

Create user that can only SEE one database, and only select from it?

我们两清 提交于 2019-12-05 03:58:45
We have several databases on SQL server. We would like to create 1 new user that can see database 'c' but can not see the rest of the databases. This user should only be able to select from this database, and nothing else. I have been googleing and searching for a while now, and the closest I found was to deny view any database, and then make them the database owner. But I don't think that will work for limiting them to select, unless is there a way I can deny everything except for select on a database owner? Thanks in advance for any help! Edit: SQL Server 2008 R2, by the way. Edit2: Sorry, I

Delete Every Alternate Row in SQL

安稳与你 提交于 2019-12-05 03:39:56
I need to clean up a table which has three columns, ID (uniqueidentifier), Observation (nvarchar), and Timestamp (datetimeoffset). The content is generated by two sensors at 1 hour interval, and the value of Observation is the same from the two sensors. My idea is to do a SELECT query such as SELECT * FROM [Records] ORDER BY [Timestamp] and then delete every alternate row. I found this on SO how to delete every alternate row in access table , but doesn't really applies here as the ID is not Int but UID. A sample of the data would look like: If you are on SQL Server 2005 or later you can do

Simplify CTE string concatenation?

人走茶凉 提交于 2019-12-05 02:59:25
问题 I have the following code list Code Meaning 1 Single 2 Married/Separate 3 Divorced 4 Widowed 8 Not Applicable 99 Not known I am trying to flatten these into a single row using a CTE. I have a CTE solution which uses RowNumber function to do this. WITH Flattened (JoinItem, CodeMeaning) AS ( SELECT 1 AS JoinItem, CAST('' AS VARCHAR(255)) UNION ALL SELECT f.JoinItem+1, CAST(f.CodeMeaning + ',' + c.CodeMeaning AS VARCHAR(255)) FROM ( SELECT JoinItem = ROW_NUMBER() OVER (ORDER BY Code),c.Code + '

SQL Server drop and recreate indexes of a table

做~自己de王妃 提交于 2019-12-05 02:32:13
I have a situation in my SQL Server 2008. I need to change a column type, but the indexes are preventing the changes. But because of the database is on several clients, I don't know how many indexes exists involving the column. Is there any way of getting, programmatically speaking, all indexes that involve the column and drop them, and after the alter table statement recreate them automatically? I've heard that disabling them can mess with the table because of the change of type. I'm changing from tinyint to smallint type. DISABLE all indexes on destination table ALTER INDEX Indexname ON

JDBC connection Url for SQLServer express R2

时光怂恿深爱的人放手 提交于 2019-12-05 01:51:18
问题 I wrote the below line for connection with sql server express r2: Connection con=DriverManager.getConnection("jdbc:sqlserver://localhost/SQLEXPRESS;databaseName=abc","sa","password"); It is giving exception: com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host localhost/SQLEXPRESS, port 1433 has failed. Error: "null. Verify the connection properties, check that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port, and that

Visual Studio 2015 - Sql Server Project Database Diagram

好久不见. 提交于 2019-12-05 01:38:55
Is there as way to create database diagram in Visual Studio as a Sql Server Project? I know it is possible to do it in sql server management studio, but I am also wondering if it is possible to do in Visual studio. As per MSDN ( https://msdn.microsoft.com/en-us/library/y5a4ezk9.aspx ) the Visual Database Designer was deprecated in Visual Studio 2013. If you're using an older version of Visual Studio, note that support for the design tool within Visual Studio stops at SQL Server 2008 R2. (See "Important" box on top of page at https://msdn.microsoft.com/en-us/library/ms171976.aspx ) The short

Configuring Integrated Security using IIS Application Pool Identity accounts for SQL Server 2008

China☆狼群 提交于 2019-12-05 01:18:35
问题 I have the following configuration for a web site: Two Web front-ends (e.g. machine names: WFE1 & WFE2) 1 SQ One SQL Server Database cluster (e.g. machine name: DBCluster) All machines are in the same domain (e.g. MyDomain) running Windows 2008 R2 Enterprise and SQL Server 2008 R2. I am in the process of deploying a web application that uses the Application Pool Identity. I have named the pool MyWebApp, which translates to the name, [IIS APPPOOL\MyWebApp]. When I try adding this user to SQL

Scripting Log Shipping Automation

耗尽温柔 提交于 2019-12-05 00:08:06
问题 Is it possible to script All of the Log Shipping configuration? For example: I need to write a job that initiates Log Shipping from two databases from server A to server B. The job will run on Server A. By the way both are SQL 2008 R2 Enterprise. There's a share on server A. \serverA\Log I Believe this is all that is needed. Is it possible to do it just by script? Do I have to initialize the databases or is there a option like SSMS to auto initialize? Will I have to create the jobs manually?