Tag: sql-server-2012

What version of VS do I need to deploy to BizTalk 2013 R2 on a SQL Server 2012 database?

I am developing with BizTalk for the first time. I have created an extremely basic project in VS2103 which builds but fails to deploy with the output: error DEPLOY: The database or the database version is incompatible with the installed version of this product. The BizTalk installation is BizTalk 2013 R2 on a SQL Server […]

Enabling generation of non-clustered indexes on subscription database for SQL Server 2012 transactional replication

We have a SQL script that we use to create a publication and its articles, along with a pull subscription. It’s pretty basic, as we don’t explicitly exclude any articles, rather take them all across to the subscriber (a database used for queries that our reporting uses, to prevent excessive load on the application db). […]

restore-sqldatabase report status during restore

Is there any way to get the Restore_Database command to report status during execution? My database is small and I’d like to record output to a text file. I think I saw a green status bar that is not what I’m looking for. Is there no switch on the cmdlet or way to track the […]

upgrading SQL server 2012 SE to 2016 EE for dynamics CRM

We do have CRM 2015 on-prem and CRM Nav, their database is in SQL Server 2012 SE. Can we upgrade just SQL Server from 2012 SE to 2016 EE without upgrading the CRM version? We would like to do this get benefits of EE for Data warehousing and reporting purposes. Thanks.

sql server multi columns index & query filter has the first and the last columns in the index keys

If I have multi-columns index with column keys: col_1, col_2, and col_3 Is the query would use this index or not if it has in the WHERE clause these conditions: col_1 = any_value AND col_3 = any_value (the second columns in the index keys was not added to WHERE-clause) and here is another example: if […]

Generalize code !?!

I have a lot of constraints – tests that looks like this: Test for Lastname not null BEGIN TRY set @TEST_TEXT = ‘insert into Person.Person lastname = NULL- Expect ERROR_NULL_CONSTRAINT_VIOLATION’; select @PostalCode = max(dbo.PostalCodeCity.PostalCode) +1 from dbo.PostalCodeCity; — Generate new valid postal code insert into Person.Person (Firstname, Lastname, AddressLine1, PostalCode) values (‘Jens’, null, ‘Møgelbjergvej 34’, […]

How to preserve store procedure's formatting while creating it from one database to another using c# ado.net?

I am creating store procedures from one source database to another destination database using c# console application. For that i have list of store procedures from source database. I iterate through that list and get definition of that sp by this command Select definition from sys.sql_modules where object_id = OBJECT_ID (‘” + item.SPName + “‘)” […]

SQL: Add values to STDEVP calculation

I have the following table. Key | Count | Amount —-| —– | —— 1 | 2 | 10 1 | 2 | 15 2 | 5 | 1 2 | 5 | 2 2 | 5 | 3 2 | 5 | 50 2 | 5 | 20 3 | 3 | 5 3 […]

Sum of data between 7AM to 7PM and 7PM to 7AM (next day)

I have following table: Date Reading1 Reading2 2017-02-15 07:00:00.0000000 33 30 2017-02-15 07:15:00.0000000 32 31 2017-02-15 07:30:00.0000000 32 31 2017-02-15 07:45:00.0000000 33 30 2017-02-15 08:00:00.0000000 33 28 2017-02-15 08:15:00.0000000 32 29 2017-02-15 08:30:00.0000000 32 31 2017-02-15 08:45:00.0000000 34 31 2017-02-15 09:00:00.0000000 34 31 2017-02-15 09:15:00.0000000 34 30 2017-02-15 09:30:00.0000000 31 30 2017-02-15 09:45:00.0000000 32 32 […]

“Conversion failed” Error in a CTE

Here is a trimmed-down version of a SQL Server 2012 query I am using to get all users with age between 25 and 34 years. In my table, The column “Feedback” is of type VarChar and stores the date of birth of a user as a VarChar in the format dd-mm-yyyy. The column “FeedbackDate” is […]

MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.