Tagged Questions

Microsoft's SQL Server is a relational database management system (RDBMS) that runs as a server providing multi-user access to a number of databases. It originated from the Sybase SQL Server codebase, which is why both products use the extension of SQL called Transact-SQL (T-SQL).

learn more… | top users | synonyms (2)

1
vote
2answers
51 views

Did a SQL Server instance ever participate in replication?

How can I tell whether a SQL Server instance ever had replication in use or not? I'm debugging an issue with a 3rd party software. This software (Red Gate SQL Backup) reports the distribution database ...
0
votes
1answer
70 views

Downloading files based on most recent date and timestamp

I have a requirement to download zipped files from an SFTP site using C# and Script Task within SSIS. We have multiple files on the server with the same name, but with different date and timestamps. ...
1
vote
2answers
56 views

SQL Server 2008 R2 Log File Location

One of the databases I am going to support does not have a validate log file location. The drive which the log file is pointing to does not exist. But I don't see any error in database error log ...
1
vote
2answers
117 views

Disabling certain steps in a job

I have a project coming this weekend where all the jobs has to be stopped but only 1 step in a particular job has to be run. for eg: i have a a 2 step job and the second step must run and the first ...
0
votes
1answer
47 views

Select complete next row based on the current row

Hi i have a complicated condition. I have a table lets say 'Test' ID Partner Type Amount 143854 CSTC Purchase -0.81 144029 CSTC Purchase -0.69 144030 CSTC Purchase ...
8
votes
3answers
1k views

Truncated 200GB table but disk space not released

I have only 2GB left, so I need to remove this history table. This table now is empty but the database disk space not released. And the database file is 320GB.
0
votes
1answer
28 views

SQL Server, firewall and linked servers

I have: SQL Server 2008R2 database server in my LAN and under my control (call it LOCALSQL) remote SQL Server, on which I have much less control (call it REMOTESQL), for which I only have IP, ...
1
vote
2answers
79 views

How can i resolve this problem of taking more time to execute then the previous?

I'm working in DWH environment Every day many data gets extracted transformed & loaded But from last week i see that there are taking more time then previously executed. I don't have a option to ...
1
vote
1answer
24 views

Separating system databases from MDW SQL Server 2008 R2

We have the Management Datawarehouse feature configure on two of our SQL Servers. Both point to the same central database and upload their results to it. Everything works fine with the built in ...
1
vote
1answer
38 views

Database mirroring in sql server

I have setup SQL server mirroring in two servers. I have enterprise edition on primary server. And standard edition on secondary server. To verify data on secondary server I broke mirroring. After ...
2
votes
1answer
53 views

XML Whitespaces/Unwanted Characters

Could anyone help on how to remove white spaces from an XML file? I used the following code that i got from Mikael Eriksson on Stack Exchange to extract the site id: cast(msg as ...
0
votes
2answers
41 views

SQL Server 2005 to 2012 Replication, cannot access replicated data

I have created publication (snapshot, small table with 10 rows) on MS SQL Server 2005. Then, I created push subscription on MS SQL Server 2012. When I try to select data form table, process takes ...
0
votes
1answer
57 views

T-SQL How to Pivot on the Values of a Table?

How do you pivot a table on the value in the field? I have to admit that while I can write some pretty nifty queries, have my CTEs down, and enjoy a wide knowledge of T-SQL programming, Pivots get ...
0
votes
0answers
35 views

Sql Server, a single threaded query spawns multiple threads (or internal parellelizaion during execution)

In Sql Server, when I run a procedure or a query that takes multiple minutes, sometimes spawns multiple threads. Even though there is no MAXDOP hint or necessity in the query, I see multiple instances ...
1
vote
0answers
50 views

Integrity checks on large dbs (700GB)

What's the best strategy for integrity checks on large dbs? DBCC CHECKDB (DB Name) would probably take over 24 hours, the largest table (532GB) would probably take over 17 hours...
1
vote
1answer
69 views

Copy SQL Logins and Permissions From One Server to Another

I need to duplicate all Logins and their associated database-level permissions from one server to another. I am using SQL Server 2008 R2 for Server A and SQL Server 2012 for Server B I am able to find ...
1
vote
0answers
41 views

Alternatives to log shipping / Replicate a local SQL Server database on a remote DB accesible only by IP

I'm trying to replicate a local SQL Server 2008R2 DB to a remote DB instance accessible only by IP (specifically, a RackSpace cloud site DB). I believe log shipping is ideal, since the remote only ...
1
vote
1answer
42 views

Attempting to Pivot a column of grades and coming up with NULL values

I have Data in a table that i'm attempting to pivot from rows to columns, and the script im using is working, but the pivot is coming up with NULL for everything. Here's the source data: ...
2
votes
1answer
83 views

Inserting variables into another variable [closed]

I've been working on the code below. I'm trying to insert results of a declared variable into a sql statement. I've highlighted the section below that I'm talking about. What am I doing wrong here? ...
3
votes
1answer
84 views

Possible reasons for really long database recovery

This is cross-posted at SSC, but restore is now going on 6 hours. Hello, Overnight I ran restores with NORECOVERY for a 5tb database, along with several other 250GB - 1.3tb databases. I did that ...
1
vote
0answers
50 views

700 million row mixed text/numeric data - read-only in a single table [closed]

Our data has some small character fields, and a few floating point and integer columns. About 36 columns in all. It is about 700 million rows. Is it feasible to use MS SQL Server to host this data? It ...
1
vote
0answers
31 views

Is there any way to set stored procedure options like ANSI NULLs to true or false outside of creation?

I'd like to set ANSI NULLs and quoted identifier properties on a stored procedure after it has been created. Is this possible? For some context, I'm using Visual Studio Database Projects / SSDT, and ...
0
votes
1answer
35 views

how drivers work in sql server

We have different drivers like ODBC, OLE DB, JDBC. I understood when we want to work with Excel in SQL Server, we need to load different driver. But my question is why we need different drivers, what ...
4
votes
2answers
197 views

Migrate all databases from one SQL Server 2005 to another

We have a production SQL Server 2005 server on which we are hosting 200 databases. We want to host these databases on our new server. On new server SQL Server 2005 is installed and is ready. I want ...
0
votes
0answers
44 views

SqlServer: can one table's PK be the FK of two table's?

I have three tables project, users and proj_user. The PK of proj_user table is the FK of project and users table's pk e.g.(project_id,user_id) My question is, is it possible if the project_id and ...
1
vote
3answers
143 views

Extracting an an integer value from an xml column

I'm just wondering how I can extract an integer out of an XML column. Currently all the digits are 4 which the below query is able to do. But the number is going to grow to 10,000's soon which will ...
0
votes
0answers
22 views

Exporting data using SBIDS

I have created lots of SQL reports using Microsoft Visual studio (from BIDS as part of the SQL package). I am running 2008R. When I export the data I would like to export to Access instead of the ...
3
votes
1answer
79 views

Total Fragments 99% and I cant get it to stay down [closed]

I have a SQL Server 2008 R2 database it is of size 13000.31 MB and my largest table has around half a million records. It is a database that I have bought. It already has indexes but when I run the ...
1
vote
1answer
40 views

why doesn't this parameterized sql return anything while the non parameterized one does?

I have tried to use sql parameter on one of my queries and noticed when ever i do so, it just doesn't return anything! while the none parametrized one works just fine. Why is it ? None parametrized ...
0
votes
0answers
35 views

Install JDBC driver 4.0 for SQL Server

How can I confirm that JDBC is running and properly configured/registered in the system? I followed the installation instructions but I believe there has to be more to it than what the instructions ...
0
votes
0answers
34 views

Measure fragmentation of a single index?

We are measuring the impact of different defrag approaches that we do one index at a time. How do we query to see fragmentation of a single index, by index name (or table + index). This is on SQL ...
3
votes
1answer
58 views

SQL Server Replication w/o network connection

Is there a way to use SQL Server Replication without a network connection? My would-be publisher is an SQL Server 2005. It is on the "outside" as it is connected to my company's primary LAN, which is ...
0
votes
0answers
26 views

Merge Replication — Reinitialize Without Recreation

I have a publication with ~10 subscriptions configured as clients. They all have a partition of that data using row filters. Earlier this week I received this error on two of the subscriptions: ...
1
vote
1answer
22 views

Windows Managed account to report subscription file share

Is it possible to used a Windows Managed account to access a file share in a Report subscription? When creating a Windows file share report subscription, on Step 4 - Create a data-driven ...
4
votes
1answer
105 views

SQL Server Database File Groups on a SAN: Relevant or Not?

I am about to build out a new SQL Server and I was planning to make extensive use of file groups. I expect heavy growth, and heavy read/write to 5 different databases on this server. I was planning on ...
0
votes
0answers
17 views

OEM SQL Server plugin - Discovering targets

I am trying to configure OEM to work with SQL Server using the plugin. I have the agent installed on the Windows Server, and the system is being monitored just fine. But when it comes to adding ...
1
vote
0answers
36 views

Query slower than the sum of its parts

I have a query with the following pseudo outline 1. CREATE TABLE #Temp 2. INSERT INTO #Temp 3. INSERT INTO A --90% of time spent here 4. INSERT INTO B --10% of time spent here 5. INSERT ...
2
votes
1answer
29 views

How do you generate large OLTP and reporting workloads? [closed]

My current skillset lies towards plain vanilla data warehousing, with < 20k users, our setups are rather simple.. I am looking for ways to enhance my technical skills, however, as much theory as I ...
2
votes
1answer
49 views

Sum Actual in different period

I have the following table test : test is a table that contains the number of week , start and end day of each week for a month WeekOfMonth StartDate EndDate 1 2014-05-01 ...
0
votes
2answers
69 views

Sql Server Management Studio can't remember passwords [duplicate]

When I connect to a database using ssms, I also have a checkbox labelled "Remember password". However, ssms will not remember the password. The next time I connect to the same server, I have to write ...
0
votes
0answers
26 views

SQL Server partitioning of many-to-many tables - triggers

Many to many tables usually have only foreign keys to related tables, like EmployeeId PositionId Is it good idea to add column only for partitioning and set its value with INSTEAD OF INSERT/UPDATE ...
0
votes
3answers
52 views

Instead of Trigger Continue with operation after custom logic?

I do not think what I am trying to do is possible, but I could not find any documentation on this. I have an INSTEAD OF UPDATE, INSERT, DELETE that always inserts data into a history table before ...
0
votes
3answers
147 views

Alternatives for a LEFT OUTER JOIN query

Problem I have a SQL statement with an LEFT OUTER JOIN which works fine on our Microsoft SQL Server. My problem is that i have to be compatible with H2 Database and this one got a bug with OUTER ...
0
votes
1answer
32 views

SQL Server: compare names ignoring non-alpha

I have a database table with a text column "title". New rows are inserted all the time, and every time I would like to check for potential duplicates on this column. I define duplicate by "having the ...
0
votes
0answers
13 views

not able to create SSISDB catlog in Sql server 2014 [duplicate]

getting below error while trying to create catlog in slq server 2014 integration services. any idea what i missed in installation or anywhere else? The catalog backup file 'C:\Program Files\Microsoft ...
1
vote
1answer
107 views

Not able to create SSISDB catalog

getting below error while trying to create catlog in slq server 2014 integration services. any idea what i missed in installation or anywhere else? The catalog backup file 'C:\Program ...
0
votes
3answers
53 views

Truncating log while database is in use

New to SQL server. I have to truncate log on printing database as the server is almost out of space:(other stuff on server too) I know I must : USE master GO ALTER DATABASE DB_Name SET RECOVERY ...
1
vote
0answers
60 views

How to use join with this query? [closed]

This query is working fine, and giving the right result. In this query all columns are in one table, but now I have made some changes. Now columns named Semester and Major are in different Table ...
5
votes
1answer
126 views

What is the minimum required compatibility level to use parallel SELECT INTO?

What is the minimum required compatibility level to use parallel SELECT INTO in SQL Server 2014?
1
vote
1answer
81 views

Dynamic Number of Columns in Pivot Table

I have a table to store StudentID, SubjectID, ObtainedMarks. Now I have to create a pivot table to show studentID and obtainedMarks in different subject. Number of subject may differ. I could generate ...