Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [sql-server-2008]

SQL Server 2008 (major build version 10.00.xxxx). Please also tag with sql-server.

-1
votes
1answer
304 views

cannot read property user access. this property is not available on sql server 7.0

I want to know the .mdf file path from property tab of a db, but it was throwing error as cannot read property user access. this property is not available on sql server 7.0 Note : on querying my ...
0
votes
3answers
75 views

How I would I break a total count query into intervals?

For example, if I did a normal count query like: select status, count(*) from customers group by status and get the result status count ----------------- open 1200 closed 1002 but I want ...
0
votes
1answer
138 views

How to group records by a two-value column ignoring small gaps?

I have a subquery with a column named code that only has 1 and 0 values and an ID column because I query a lot of codes for each ID. I want to group by said column (and by ID) and by ocurrence but ...
0
votes
0answers
32 views

migrating instance from 2008r to 2016 Enterprise [duplicate]

i have a client that wants to migrate his data to sql server 2016 . currently they have 2008r and the databases are huge(total of 4 tb) on the instance. what is the best way to performe this with the ...
3
votes
2answers
90 views

How Do I Force Data From First Table to Display

DB: SQL SEVER 2008 I'm joining multiple tables and I want the results to always show the data from the "Project" table. In the example below, I have a client where billing and discount data is in ...
4
votes
0answers
75 views

Moving a very large (40 TB) DB from a 2008 server to a 2016 server [duplicate]

The Situation: Our 2008 MSSQL server is old and rapidly running out of drive space. We have a new 2016 server ready, we just need to move a 40 TB database from the old server to the new one. The DB, ...
2
votes
1answer
55 views

SQL 2008/R2 Extended Events - Row Count

I need to setup a sql audit to capture all queries running on a server from any unauthorized locations, and one of the columns that is required is Row Count. In sql trace, this is possible. But I can'...
0
votes
0answers
141 views

Recover data from .mdf file, and no correct version of SQL Server

I have an 80gb .mdf file that I need to open and get the data out of. It was on a computer running SQL Server 2008 R2 Express that died, but I was able to pull the file off the half dead HDD. I don'...
5
votes
0answers
215 views

SQL Server Profiler: why the RPC Starting event does use an different decimal separator from SP Starting?

Trying to diagnose an problem, I've ran into that inconsistency. In SQL Server Profiler, the RPC Starting event uses the regional settings to write real numbers (example: in Portuguese(Brazil) 14.5 ...
3
votes
1answer
652 views

Why is my database using Partitioning? ( I know it's not )

Running this query: select * from sys.dm_db_persisted_sku_features Shows me that I'm using Partitioning: | feature_name | feature_id | |--------------|------------| | Partitioning | 200 | ...
1
vote
1answer
1k views

Two-step Replication between SQL 2008 and 2017

I am currently using transactional replication from several SQL 2008 publishers to a central 2014 subscriber/distributor. I need to replicate this data to a 2017 server, which would require a 2017 ...
0
votes
1answer
497 views

why my split string functions are not working with large OBJECT_DEFINITION?

I have in one of my databases a stored procedure called PROCEDURE [repl].[usp_upd_repl_out_application], that is not exactly a very clever stored procedure but it has over 389 lines. As I need to ...
1
vote
0answers
52 views

Get the records matching the combination of column values from a temporary table

I have a temp table with 4 columns question_tbl: TempTable -- combination to lookup id | Code1 | Code2 | code3 --------+----------+-------------+--------- 111 | AA | A1 ...
0
votes
1answer
130 views

How can I create a stored procedure of inheritance tables in SQL Server [closed]

I have three tables create table CustomerTypes( CustomerTypeID int primary key identity(1,1), CustomerType varchar(11) ); insert into CustomerTypes(CustomerTypeID,CustomerType) select 1, 'Regular' ...
0
votes
1answer
369 views

Unexpected Shutdown affects SQL Server DB start at OS start up

I have an application that uses a sql server db (SQL Express 2008 R2) and starts when Windows OS starts. When the pc shutdown unexpectedly and then restart the pc the application run automatically but ...
0
votes
2answers
8k views

Where to download Sql Server 2008 R2? [closed]

I need to do a fresh install in a lab environment. Where's a good place to download it?
11
votes
2answers
2k views

When is the SQL Server database ready to accept queries?

In the SQL Server error log file I found the following lines: 2018-02-22 14:10:58.95 spid17s Starting up database 'msdb'. 2018-02-22 14:10:58.95 spid16s Starting up database 'ReportServer'. ...
0
votes
1answer
687 views

SQL Server Failover Cluster setup shared drive issue

I'm trying to complete an SQL install on a two node cluster which has three LUNs assigned from Filer storage present and currently owned by the first node. I've selected the "New SQL Server ...
1
vote
2answers
111 views

How can I get Sql Server 2016 on a 32-bit server?

I didn't build it, but we've got a 32-bit Windows Server 2008, with SQL server 2008 and 4GB of RAM. I need to upgrade it to SQL Server 2016 in order to log ship to a new server, so we can put this ...
1
vote
2answers
33 views

Best way to allow update exceptions on a cell level

I've got 2 tables, a base table - tBase - and a holding table used to update that base table - tUpdate. (Note: actual tables will have around 25 columns) Table tBase ID | name | type | color ...
0
votes
1answer
164 views

Error occur during Oracle and Sql Server Integration

I have developed a SQL Server Integration Services package pulling data from Oracle 11g and storing in a SQL Server 2008 database. Everything works as expected, but when I schedule a sqlserver job to ...
-2
votes
1answer
117 views

DBCC CHECKDB last good date

SQL Server 2014 Standard. Using Ola's (blessings be upon him) scripts to perform database integrity checks: Job command: sqlcmd -E -S $(ESCAPE_SQUOTE(SRVR)) -d master -Q "EXECUTE [dbo].[...
5
votes
1answer
194 views

Why does this CTE return the bulk of its results immediately, but then take several minutes to finish?

I've got a schema roughly like this (this is a simplification of my actual schema): CREATE TABLE foo ( key1 NUMERIC(6) NOT NULL, key2 VARCHAR(32) NOT NULL, val VARCHAR(255) NULL, ...
0
votes
0answers
19 views

SQL Server 2008 CPU Troubleshooting on 6 identical servers

We offer an API service that rotates between 6 identical SQL Servers on a "round robin" rotation. I'm trying to troubleshoot some high CPU usage on one of the 6 servers but have hit a wall. All of ...
0
votes
1answer
218 views

Unable to remove additional tempdb file

In our production DB, we only have 1 tempdb file and it had ballooned to 180GB. I ran: Alter Database tempdb modify file (name='tempdev', size=30gb); to resize the primary file, and then ran ...
0
votes
1answer
27 views

Generate a file or a script that can be used to reconstruct a database on a different PC

I'm trying to copy a database that I created in SQL server 2008 on a new PC without having to do so manually by creating a database on the new computer and recreating all the tables from the scratch. ...
0
votes
2answers
530 views

Dynamic select column name on the basis of a flag

I have a config table where there are config values are stored as key, value pair in each row. And there is another table which have two columns (lets say column1 and column2). Now I have to select ...
0
votes
1answer
353 views

Unzip files within the SQL Server [closed]

I need to unzip some files. I can do it with xp_cmdshell using 7z (since it is free) but I need this procedure to be able to run on multiple machined and I cannot guarantee that all of them will have ...
2
votes
2answers
985 views

Sum purchased & sold quantities for all items on daily/weekly

I have 4 tables Items, DimDate, Purchase and Sales for items definitions, calendar table, purchased and sold Items respectively. Tables structure here I need to outer join sum(Purchased_Qty) and sum(...
0
votes
1answer
37 views

Correlating hostname/IP to user

I work in an environment where logins are shared among applications, and occasionally developers - in a situation like this, I am having trouble determining who is connected to the database, or who is ...
0
votes
1answer
63 views

Output File Default Location using MultiServer Agent Jobs

I've used Ola's scripts for quite a while at several companies, and just started a new job at a company who has already implemented MultiServer Agent Jobs to execute backups, DBCC CheckDB and ...
1
vote
1answer
149 views

Find the destination owner (schema) for replication on SQL Server

We have a table replicating to another server with a different Schema at the destination. When I set the replication up it shows as destination owner in the GUI. I am trying to create some reports ...
0
votes
1answer
429 views

How to reduce table partition timing for existing table in SQL Server

Repost from: https://stackoverflow.com/questions/48169487/how-to-reduce-table-partition-timing-for-existing-table-in-sql-server I have a problem with table partition, I am working in a very big ...
0
votes
0answers
203 views

Same Domain Linked Server Login Failing

I have several SQL Server instances. All of them are setup in the same domain, and have been working for years. One of these instances serves as an aggregator for the data of the others, and a sync ...
1
vote
1answer
55 views

Does this set of locks imply table lock and if so is it avoidable?

I have a query on SQL Server 2008 that when using sp_whoisactive with get_locks = 1 has the following locks open.... <Object name="my_table" schema_name="dbo"> <Locks> <Lock ...
0
votes
2answers
44 views

How do i merge multiple records into a single record

I have a select query: SELECT 'IT Queue' as Category, dbo.Status.Status, COUNT(*) AS Count FROM dbo.Status INNER JOIN dbo.CactusQueue_Task ON dbo.Status.Id = dbo.CactusQueue_Task.StatusId ...
0
votes
1answer
44 views

Query whith DATETIME

How to get this result expected result CodeCompany fechaActual Clave Usuario Depto entrada salida sumaHoras 2300 201712 307 USER1 TTT 06:00:04 ...
1
vote
3answers
712 views

Delete and Insert performance SQL Server

I have the below stored procedure that is taking close to an hour to complete. The result set is about 200K machines. All I am doing is extracting a set of ids from a linked server, deleting those ...
2
votes
1answer
1k views

Calling two stored procedures from one, is the order guaranteed?

I have some code that looks like this: EXEC StoredProcedure1 @Arguments EXEC StoredProcedure2 @Arguments Are the two datasets guaranteed to return in the called order? I am expecting two ...
-2
votes
2answers
128 views

Auto update of a column's value (SQL Server 2008)

I want update the value of a column in a table after 24 hours. We're booking a car for a customer; if he doesn't confirm within 24 hours, the car's status should automatically change to "stock". How ...
1
vote
3answers
1k views

Join tables where the table name changes every day

I need some help in figuring out how to join tables to my query. The table names change every day as the date is used in the table name and older tables are dropped as they are no longer needed. My ...
0
votes
2answers
203 views

Returning only duplicated data

I'm searching all over the internet and stack Overflow but every example I find is with only one row, or it just does not work. I have this table: TBL_RELATORIOS_TAMANHOS table_catalog table_name ...
2
votes
2answers
74 views

Changing the column width in Transactional Replication

Changing the column width in SQL server Transaction Replication. Can we do direct width change ? or we need to takeout the article and modify. This change replicate to subscriber? or we need to do ...
5
votes
1answer
2k views

NVARCHAR(MAX) string appears to have 6326 characters but won't PRINT them all

I am writing a stored procedure to use the sp_send_dbmail system stored procedure to send an HTML email. I have used this procedure before but have not run into this problem before. I am using the ...
2
votes
0answers
338 views

Insert 2 output result sets from sp_spaceused into Temp Table (SQL Server non-2016)

sp_spaceused, when executed without any parameters, produces 2 result sets database_name, database_size, unallocated_size reserved, data, index_space, unused Usually when you execute some SP, you ...
8
votes
1answer
5k views

Access view based on table in another database without account in that other database

I created view in database1 based on tables in database2. I gave SELECT permission to a user who has access only to database1. The user can't get this view to work because he doesn't have an account ...
0
votes
1answer
38 views

what are the impacts if I convert one of the column to primary key or add a primary key to an existing table

One of my MSSQL table don't have any primary key, I would like to add one. Just want to know: First, if I convert an existing column (or multiple columns) to a primary key, what would be the impact? ...
3
votes
2answers
374 views

I have a database backup (.bak) from SQL Server v7, how do I convert it for load into v10?

A client has given me a backup (.bak) from a SQL Server v 7 database. I am trying to load it into version 10 which is incompatible. Are there any tools that will restore or prepare an old version ...
3
votes
1answer
105 views

SSIS Excel export changes # to

I am exporting an excel file through SSIS using excel connection manager. I am using SSIS 2008 version and the excel is .xlsx CREATE TABLE `Sheet1` ( `Date` DATETIME, `NMMO` NVARCHAR(30), ...
1
vote
1answer
73 views

# of key locks while updating

I am using SQL Server 2008, RTM. I have a simple table defined as create table t(id integer not null primary key) This table has 50,000 records, just in case. When I issue an update transaction ...