All versions of Microsoft SQL Server (not MySQL). Please also add a version-specific tag like sql-server-2016 if that is relevant to the question.

learn more… | top users | synonyms (2)

0
votes
1answer
133 views

Error “The publication '[Name]' does not exist.” running sp_article_validation

DECLARE @p SYSNAME, @a SYSNAME SET @p = N'[NAME]' SET @a = N'[ARTICLE]' EXEC sp_article_validation @p,@a I'm using the exact name of the publication provided by the table MSpublications (even using ...
1
vote
1answer
208 views

SSIS Execute Sql Task not executed on server

I have a package that has an Execute Sql Task. When I run it in SSDT it works fine, the query is executed. When I deploy it on the server and run the package, the query is not executed and there is ...
3
votes
2answers
207 views

How to capture sp_refreshsqlmodule event

My issue: executing sp_refreshsqlmodule will update the sys.objects.modify_date value, but does not fire a DDL event that can be used by a DDL trigger. So if using a DDL trigger to show object change ...
0
votes
0answers
86 views

Long running query with index seek

I was tuning this query, the execution plan looks fine for me but based on the statistics the Lock waits time is very high .What should i do to fix this problem? (@P0 bigint) SELECT mgmtemails0_.Id ...
0
votes
2answers
34 views

conditional/processing on the dummy data column to create new dummy column

Following is my query. Select [A],[C] ,CASE WHEN [A]>19999 and [A]<30000 THEN '12' ELSE '21' END AS 'dummy1' ,Substring(CAST(C AS varchar(9)),1,4) as YEARDummy ,Substring(CAST(C ...
2
votes
1answer
91 views

Four-part distributed Query issue from 2014 to 2008R2

From a SQL Server 2014 RTM in our DEV environement, I am executing this query using a SQL login. select t.noshipid, y.nofolder from ...
3
votes
1answer
280 views

Ola Hallengren solution, backups not cleaning up

I have about 30 SQL Server 2005-2014 instances, all of which use the excellent Ola Hallengran maintenance script to produce my full/diff/log backups. This has worked for me for years with no issues, ...
1
vote
0answers
74 views

SQL query using CTE not working after database migration

We have recently migrated an application, and in the process we have migrated from SQL Server 2005 to SQL Server 2008 R2. I have noticed that some SQL queries using CTE do not work anymore since. I ...
0
votes
1answer
28 views

Best practice - Log shipping / replication for archive / reporting database

We have a setup with a product that has a production database (many customer installations). The production database has been around many years and there are some performance issues that is getting ...
0
votes
2answers
104 views

List all sessions from current user

I connect to SQL Server with a given user that is not an administrator. I want to get a list of all my open connections. I've found endless commands to do so but all fall in one of those categories: ...
1
vote
2answers
50 views

Can I surveillance the backup taken in SQL Server?

I have a SQL Server and I want to put some surveillance on it, to know if someone is taking a backup. I know that I can make an audit to monitoring the backup. But I want to have some kind of trigger ...
1
vote
0answers
541 views

How to check the status of an SSAS cube while it is processing

When one processes an analysis services cube in Sql Server Management Studio, by right clicking on the cube name in the GUI and selecting the "process" option, a GUI pops up and displays the status of ...
2
votes
1answer
50 views

MDX Intersection - how to?

A similar question has been asked here, but I'll give a brief intro. In SQL Server there are 3 tables: Order (Id, Date); Product (Id, Name); OrderRefProduct (Id, OrderId, ProductId); ...
0
votes
1answer
102 views

How do I recover from a failed SQL Restore?

After a failure of the restore code in a webpage the database is left in the "restoring" mode and/or is offline. How do I recover so I have an operational online database - before I exit the code? ...
0
votes
1answer
32 views

Change SSIS package location (REPOST from SO) [closed]

My SSIS Package are located in shared drive with a long path name. To make the packages easier and not to remember long path name, I use "Map my network drive" option and use X: drive as an alias to ...
0
votes
2answers
34 views

Distribution Server (1) Replicating Source Server (2) To Destination Server (3)

I'm setting up replication from a source server to a destination server using a third party distribution server. I've added the source server to the list of publishers on the distribution server ...
2
votes
1answer
218 views

Encryption/Decryption with StoredProcedure/View

I'm working on a project that uses EntityFramework for programmers to access the data. We've recently found need to add fields that were determined that need to be encrypted. This will be the first ...
20
votes
4answers
940 views

What's up with the collation of some columns in sys.databases?

I'm attempting to run an UNPIVOT on various columns contained in sys.databases across various versions of SQL Server, ranging from 2005 to 2012. The UNPIVOT is failing with the following error ...
1
vote
1answer
71 views

How can I check what jobs are scheduled to be run at a specific time?

How can I check what jobs are scheduled to be run at a specific time? I am trying to work on something, use msdb go Select [job name] = jb.name , [schedule name] = sc.name , [next run ...
1
vote
0answers
88 views

Secure view on row level with custom security tables

Let's say I have a following table that lists all member of my application. CREATE TABLE dbo.Member ( MemberId BIGINT, LoginName NVARCHAR(64), SecurityRole NVARCHAR(64) ) I assume that ...
1
vote
2answers
23 views

What is the purpose of adding new file to the database?

I'm fairly new at Microsoft SQL. I've seen many tutorials online on how to add a file to the database. What I still don't get is why?
0
votes
1answer
106 views

MS SQL Server 2008 makes hard disk space disappear

We are running SharePoint 2010 with MS SQL Server 2008 (Windows Server 2008 R2 Enterprise). We have not taken regular SP backups this far which has led to high disk usage. However, even if I shrink ...
0
votes
0answers
9 views

How to read data from oracle db without creating linked server in SQL Server? [duplicate]

I need to import data from an Oracle database into a SQL Server database. How can I do it without creating a linked server?
2
votes
1answer
129 views

Table to create Ids for one table to many table relationships

I have several tables that will represent an object that can be commented on. I would like to store all the comments in one table. To relate the other tables to the comments, I was thinking of adding ...
1
vote
0answers
214 views

Can't uninstall SQL Server 2008 R2 SP3

I have encountered the error on SQL Server 2008 R2 where Report Builder 3 fails to load with error Microsoft.ReportingServices.ComponentLibrary.Controls.dll, has a different computed hash than ...
0
votes
0answers
32 views

Change SSIS package location

My SSIS Package are located in shared drive with a long path name. To make the packages easier and not to remember long path name, I use "Map my network drive" option and use X: drive as an alias to ...
1
vote
0answers
65 views

How to backup SQL Server 2014 database with SC Data Protection Manager using SQL script

I'm trying to set up the database maintenance solution for SQL Server 2014 using this SQL script and System Center Data Protection Manager 2012 r2 as a BackupSoftware (like SQLSAFE, SQLBACKUP and ...
-1
votes
3answers
352 views

SQL Server installation errors assembly

I have been trying to install SQL Server and now I am tired of it. I tried to version SQL Server 2008 and SQL Server 2008 R2. SQL Server 2008 gives the following error (.Net Framework installed) ...
3
votes
2answers
4k views

Convert string numeric values with comma as decimal separator to NUMERIC(10, 2)

I have an SQL table of varchar colums which contain Greek formated numbers (. as thousand seperator and comma as decimal seperator) The classic conversion ...
0
votes
2answers
180 views

problems when importing csv files into SQL using SSIS when the columns are not consistent from quarter to quarter

I am using SSIS to upload a bunch of csv tables into SQLexpress. The csv files are quarterly data files. They are largely consistent but every couple of years a column may be added or an existing ...
0
votes
1answer
114 views

Error message is causing Error Log to grow out of control

The error log is growing like crazy - in one day it has reached 32GB. There is one error that keeps being logged. I have searched online for this error, however I couldn't find any helpful ...
0
votes
1answer
39 views

Need help with a query for a helpdesk application

I have a helpdesk application I'm modifying. I need to pull data into an ASP.Net DataGrid. In the problems table, there is a field for employeeID, which is the employee id of the person entering ...
0
votes
0answers
40 views

How could I remove remote CMS from my local BO deployment? [closed]

Sorry, it's localized and I can't switch it to English. There are one local CMS server and three remote servers: I can't just stop server and delete this servers, because they will appear again ...
3
votes
2answers
233 views

What would be the most efficient way to check for null values in all columns for multiple tables?

Say I have three tables or four tables that I want to check for values present and I don't want any of them to be null. IF they are null, I will send an email notification per row. What would be the ...
1
vote
0answers
96 views

Receiving historical SQL alerts when SQL Server agent is restarted

The issue is faced in SQL server 2014, whenever SQL Server Agent is restarted or if the server reboots, there are historical SQL alerts which are received and emails are being sent to the various DLs. ...
0
votes
1answer
63 views

How can I mask a CMD-Variable reference $(myVar)?

It is kind of an accademic question, but if I write a SQL-Script for SQL-Server in CMD-Mode, how could I create an column-alias like [$(myVar)]? SELECT 1 AS [$(myVar)] --error: myVar is not defined
6
votes
1answer
251 views

Should I pause mirroring when I reboot the witness server?

So I know that when patching the two main database servers (SQL Server for the record) you do the mirror, failover and then when it's all caught up do the new mirror, but what about the witness box? ...
2
votes
1answer
365 views

SQL Server service automatically stops after starting

I have a problem with my SQL Server 2014 Express instance. It worked fine until now. I can't get it working because SQL Server service automatically stops immediately after I start it. I'm trying to ...
3
votes
1answer
109 views

Grant access on Secondary but not on primary in SQL Server logshipping [duplicate]

I have a strange situation wherein users need permission on log shipped DB on secondary server but not on primary. The problem is, the login has access on many other DBs on primary server apart from ...
-1
votes
2answers
107 views

how to bind data from sql to excel chart [closed]

i want to create a Excel sheet with data from SQL table and a chart of same data. I had create a excel sheet with data from table but not able to insert a chart in excel sheet. How can I do it???
-4
votes
1answer
135 views

How to Pass table type as Parameter in T-Sql like Postgresql [closed]

In my company like to move from PostgreSQL to SQL Server. Doing this, we need to migrate pl/Pgsql functions to T-Sql. In pgsql function we are create and pass type as parameter. Same option had in ...
0
votes
1answer
349 views

SSRS CROSS Domain Reports Server Authentication

I have a pretty complicated situation at hand, let me try to explain. I have a SQL Server and a Web Server in a separate domain (lets call it domain A). SQL Server has the databases for Reporting ...
3
votes
2answers
70 views

Can I create a computed column that requires input to select?

I have a scenario in a very old and very large application, where I have a table representing a type of resource: CREATE TABLE resource (resource_id INT, name NVARCHAR(4000)) This table is selected ...
0
votes
0answers
173 views

PREEMPTIVE_OS_FILEOPS when querying Filestream

I've have a table which contains a Filestream column, when I query the table as follows: SELECT ID, FileContent --, * FROM dbo.Files AS f WHERE FileContent IS NOT NULL AND ID = ...
4
votes
1answer
68 views

Any potential issues/ DoS risks with frequent connections/ queries to a SQL Server db?

A database team suspects there may be an issue with a third-party ETL application opening, and closing, connections to a SQL server database repeatedly. In terms of exact numbers --- it opens about ...
0
votes
1answer
62 views

dm_db_index_physical_stats results inconsistent with actual object properties - what may be the reasons?

SQL Server 2008 RTM (10.0.1600.22) Running a typical index fragmentation report on a table: SELECT OBJECT_NAME(i.OBJECT_ID) AS TableName, i.name AS IndexName, s.index_type_desc, ...
0
votes
0answers
25 views

Service Broker -

SQL 2008 R2, clustered and mirrored. We recently switched data centers, and Service Broker is now failing to receive messages sent from another instance on the same cluster. This was working for the ...
2
votes
2answers
137 views

How can I re-index a column using SQL Server Compact Edition?

We have a table TemplateItem that has a column ListIndex that stores the order in which we want the items to show in the UI. This table is self-referencing / hierarchical. The query requirement is ...
-3
votes
1answer
34 views

Without Quorum Drive.. will it work node1 and node2 in cluster [closed]

Without Quorum Drive.. will it work node1 and node2 in cluster. How it is possible? if not required then where it stores cluster information?
4
votes
1answer
671 views

Scope_Identity() returns null after inserting first row in table

I have a stored procedure that is used for inserting values in two tables. The tables have a parent-child relationship i.e. the first table has an identity column, and the second table references the ...