Tag: sql-server-2008-r2

sql server management studio express 2014 not enumerating network sql servers

In my apps, I am using SqlDataSourceEnumerator.Instance.GetDataSources() to enumerate the sql servers on local networks. I had VS 2010 pro and Sql Server 2008 R2 Express and SSMS 2008 R2 Express and VS 2013 Pro. Everything was ok. Then I installed VS 2015 Community Edition, removed VS 2013 Pro. Then my apps and SSMS starts […]

Query Lag – Single Row Select Takes Over 2 Minutes to Complete

Query Lag – Single Row Select Takes Over 2 Minutes to Complete SQL Server 10.50.4000.0 (2008 R2 SP2) Step 1 – Populate the Test Table begin tran truncate table MSDS_PROD_BK..MSDS_Import insert into MSDS_PROD_BK..MSDS_Import select * from MSDS_PROD..MSDS_Import (nolock) commit tran (30354 row(s) affected) (takes 32 seconds to complete) (IMPORTANT NOTE – the table contains a […]

Use “insert into” only with databases that has a certain table ( SQL Server 2008 R2 )

I need to do a “log” with all the information of a certain table, of all databases, inside a new table that I will create (With the same structure). But not all databases has this table. I could make a query to find all databases that has this table I want: SELECT name FROM sys.databases […]

T-SQL Using Unsupported Column In Query

I’m trying to query cluster node information from SQL Server 2008 R2 and up using the following query. select nodename node, status status_value, status_description status_text, case when is_current_owner = 1 then ‘true’ else ‘false’ end is_current_owner from sys.dm_os_cluster_nodes This works fine on SQL Serve 2012 and up but on 2008 R2 according to the sys.dm_os_cluster_nodes […]

SQL Server 2008 R2 match counts

I have a SQL query that checks when a stored procedure was last run, from that date it gathers all the units that were purchased between that date and today’s date and compares it to another number. If they match it sends an email saying the two number match and executes the rest of the […]

SQL server service broker usage with ASP.net cache?

I have ASP.net site (4.5) which uses sql cache notification. (using aspnet_regsql.exe) The idea is that SQL server tables are stored in the app’s cache .This is for – not to load data over and over again from the specific table. The beauty is that Asp.net’s cache can automatically remove the table from the cache […]

Compare a dataset in excel with with SQL Server table

I have a extract of a dataset like below from mysql tables joins into Excel. ╔════════════════════════════════════════════════════════════════╗ ║ student_no name age subject mark status updated_date ║ ╠════════════════════════════════════════════════════════════════╣ ║ 1 aaa 18 Subject1 50 A 2015-07-02 ║ ║ 2 bbb 19 Subject1 50 A 2015-07-02 ║ ║ 3 ccc 20 Subject3 60 A 2015-07-02 ║ ║ 4 […]

Is there any downside to having authentication data in a separate database from the business data?

Is there any downside to having all user login and administration data such as roles and permission in a database that is separate from the database that has business data? Both the databases would be on the same SQL Server 2008 R2 instance. All other things remaining same (assume you do both set ups on […]

SQL Server recursive query which is not working

I have a table with three columns unified_id master_id (the third column is a primary key identity) For an id which could be in either id column, I want to find the set of ids. For example, if the data looks like this X001,X123 X002,X123 X123,X123 then starting from X001 I want to return with […]

Finding a literal within a database definition

A database contains in its definition some hardcoded literal, which should be replaced by a generic function call. The literal may appear in procedures, triggers, defaults, checks, etc. – basically “everywhere”. I’m using this code to find the literal: SELECT Name FROM sys.objects WHERE OBJECT_DEFINITION(OBJECT_ID) LIKE ‘%HARDCODEDLITERAL%’ I just would like to know if this […]

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