This tag is for SQL Server 2008, major build version 10.00.xxxx.

learn more… | top users | synonyms (1)

4
votes
4answers
13k views

T SQL Table Valued Function to Split a Column on commas

I wrote a Table Valued Function in Microsoft SQL Server 2008 to take a comma delimited column in a database to spit out separate rows for each value. Ex: "one,two,three,four" would return a new table ...
1
vote
1answer
34 views

Sql Server - Running a Job on Multiple servers

I am using SqlServer 2008. I have a Sql Server Job that checks Disk Space and emails admins if the space is less than 15% Instead of adding that Job to all servers is it Possible to run the Job on ...
0
votes
0answers
13 views

Are there limits to SSRS 2014 RDL files going over to SSRS 2008 (or 2012)?

Is there any incompatibility with reports developed in SQL Server SSRS 2014, and then exported to .RDL files that will be imported into SQL Server 2008?
0
votes
1answer
28 views

Facing SQL Error 3403

Recently I was working in SQL Server and I faced an error called SQL Error 3403 which was stating: "Error 3403, Severity 22 During recovery initialization, page %ld was encountered. This page ...
1
vote
1answer
107 views

Print the execution time on messages Pane?

How I can print the execution time of each query on messages Pane? For example the Select * from tbl1 runs for 10 mins then Select * from tbl2 runs for 15mins and so on.. Select * from tbl1 Go Select ...
0
votes
0answers
16 views

Can user defined roles cause problems with colliding permissions?

I recently ran into a problem with an application crashing accessing a SQL Server 2008 database. An "APPCRASH" was recorded in the Event Viewer, but I have little else to go on. The tables are owned ...
3
votes
2answers
322 views

Migration to databases Domain Users do not have access

I migrated databases to new servers, however the applications that were previously used with the databases are failing to load. I have changed the connections and etc. The jobs also seem to be ...
0
votes
1answer
63 views

How to increase the performance of this 3 minute reporting query

We have a table MyTable with about 10.000.000 records which contains a record of all transactions processed in our application. This table has the user Owner who did the transaction, the date ...
11
votes
2answers
3k views

How can I add a rowversion column to a large table with minimal downtime

Using SQL Server 2008 and later, I want to add a rowversion column to a large table however when I simply ALTER TABLE [Tablename] ADD Rowversion [Rowversion] NOT NULL Then the table is unavailable ...
0
votes
1answer
18 views

Numeric Latitude & Longitude values are rounded up when querying SQL Server Database

Developing an application that is using Google Maps. Lagitude and Longitude values are stored in the table as the correct value. However when they are pulled into a view the value is rounded to the ...
-2
votes
1answer
70 views

SQL Server 2008: Is there a graphical reporting tool that shows tps (or select statements) per second for a specific table?

In SQL Server 2008: Measure tps / select statements per second for a specific table? , the question was "how to do it" OK, so I can do it.... but I want automated, pretty charts, so I can easily find ...
1
vote
1answer
33 views

How to get paged resultset from a table?

I am trying to get paged resultset from a table (Notes). So, I am passing the last offset id (@LastOffset) value along with the page size (@Count). My approach to achieving this is: Sort the table ...
6
votes
2answers
17k views

Add a new Column and define its position in a table

I have Table A with 5 columns: TableA -- Name Tel Email Address I want to add a new column (mobile) in between Tel & Email: TableA -- Name Tel Mobile Email Address If I use ALTER TABLE ...
-3
votes
0answers
31 views

Backup and Restore

What are the Negative Aspects backup and Recovery in sql server Over these points. Full Backup and Restoration Point in Time Restoration Restoration in Same Instance Restoration in Different ...
1
vote
2answers
250 views

After Restore Log_reuse_wait_desc of Replication

I'm wondering if anybody has ran into this issue before and has any suggestions on what's causing it/how to fix it. We are restoring a database into lower Dev environments and after the restore the ...
2
votes
2answers
437 views

Table with 4 million records - different size and performance in development and production

At my company we use SQL Express 2008 R2, which supports databases up to 10GB. We have 2 databases with almost the same number of rows in all tables. But, one of them is 4.5 GB in size (which is in ...
1
vote
0answers
30 views

Renaming databases vs backing up and restoring

I am creating a copy of Database A, restoring as database b, executing a job on database b. Upon successful execution, I would like to delete the database A and rename the database B to what the ...
7
votes
6answers
14k views

How to query last restore date in SQL Server?

Is there a TSQL query that shows the last restore datetime for a certain database?
-2
votes
0answers
38 views

SQL Server job to backup and restore database [closed]

I need to create a SQL Server job that would run nightly and backup a database and restore the database with a different name. Example NorthDB (Original Database), NorthDB_test (backup database ...
5
votes
3answers
18k views

"Could not find stored procedure' even though the stored procedure have been created in MS SQL Server Management Studio

I have created a table testtable inside the database testbase that have the following structure: product_no (int, not null) product_name (varchar(30), not null) price (money, null) expire_date (date, ...
1
vote
1answer
227 views

SQL Server replication conflicts after migration from 2000 to 2008

I got a suggestion over at Stackoverflow to post here....greatful for any and all help. Please bear with me I think this might take a while to explain. For many years now my company has hosted a ...
0
votes
1answer
48 views

Exclusive access to edit rows [closed]

I'm developing a program that allows users to view and edit data. My question: Is there tools (sql server tools, may be users/roles) to implement the following: There are two users: A and B. User A ...
2
votes
4answers
4k views

SQL Server mirrored database is stuck in recovery mode

I have a database that is stuck in recovery mode for few days already. There are multiple threads about this, but the solutions there don't work for me. Here is what I tried already: RESTORE ...
0
votes
1answer
37 views

How to transfer table in SQL Server 2008 from one computer to another [closed]

I want to transfer my table in SQL Server 2008 from one computer to another... Is it possible? How to transfer from one computer to another? I am doing my final year project. In my project, if the ...
1
vote
3answers
3k views

how can I ignore duplicate inserts?

I basically have the same question posed here - Optimal way to ignore duplicate inserts? - except in my case it's SQL Server. I have a table that is a list of person IDs who are deceased. There are ...
0
votes
1answer
15 views

Un-attaching SPL 2008 BD not willing to Attach

I have a 5 year old SQL Server 2008 database. There are actually 3 databases NL_Dev NL_Test NL_Prod Each has a log file. We have been using the development database, but all three seam to be ...
0
votes
1answer
22 views

Maintaining multiple build versions of asp .net / SQL Server applications

We have new versions of .net applications deployed every week for testing given in form of new build files. Can any one suggest how I can maintain many versions of the builds without having to keep ...
0
votes
1answer
15 views

migrating legacy databases from SQL Server 2000 via SQL Server 2008 to SQL Server 2012: users and logins

I have some legacy SQL Server 2000 databases to migrate to SQL Server 2012. In my dry run, I have done this: I created empty databases of the same names in SQL Server 2008. Then I backed up the SQL ...
1
vote
1answer
6 views

Run a report by specifying which server to execute the query on

I have a couple of stored procedures that I have written that gathers some information about all of the databases on the server it's stored on. I would like to create a report such that I can select ...
0
votes
0answers
21 views

can't connect to DB using MS SQL Server 2008 Upgrade Advisor

I'm trying to use MS SQL Server 2008 Upgrade Advisor Analysis Wizard, to connect to a networked MS SQL 2000 database. According to the query select @@ServerName, the instance name contains a hyphen. ...
5
votes
2answers
367 views

When was a Database taken Offline

I am trying to find a way to figure out when was couple of my sql databases were taken offline. I checked the the logs but could not find any such info and moreover there is no default trace enabled. ...
0
votes
2answers
312 views

How to provision the SQL Server Agent service after SQL Server Edition upgrade

I have upgraded SQL Server 2008 R2 Express to SQL Server Standard Edition. After I have upgraded it, the SQL Server Agent was stopped. I have tried to start but it fails. Only when I have changed ...
5
votes
4answers
1k views

Datawarehouse bad practice?

In our Datawarehouse context, we have to update some record in fact tables inside our ETL. One thing we did is to create nonclustered indexes just before the heaviest queries, and drop them ...
0
votes
1answer
35 views

how to get child categorys based on categoryid

this is my table structure i need to find child categoryids. If CategoryID 1 then 1,2,3,4,10,12,13,14,15,16 when CategoryID 2 then 2,10,12,13,14,15,16
-1
votes
2answers
50 views

Update code works in manual stored procedure but not when run as SQL Server Agent Job

I have a stored procedure that deletes all records from an existing table, and then inserts new records. After the insert I have several update operations that change the value of one field. If I run ...
2
votes
2answers
77 views

Defragmentation of Indexes - Higher value after defragmentaion

I am trying to defragment indexes on SQL Server 2008 using ALTER INDEX--REBUILD. After defragmentation some indexes have fragmentation percentage value greater than its before defragmentation value. ...
1
vote
1answer
50 views

Best way to document Dwh views [closed]

I works in a company that provide Dwh views as an API for external Customers (We use MS-SQL 2008 & 2012). every once in a while we release new views and updates the existing views. We have ...
3
votes
1answer
188 views

Updateable Subscriptions: Rows do not match between Publisher and Subscriber

I have transactional replication with updatable subscribers set up in SQL Server 2008. It has 3 subscribers and 1 publisher. I had to setup replication again due to some errors related to the database ...
0
votes
1answer
31 views

Using dynamic database name for DML in trigger

I am using SQL Server 2008 in my application. Here I need to do database operations between multiple databases. The complexity is database names are user defined except one masster database. I can ...
1
vote
2answers
455 views

Log shipping - switchover and failback

We are doing a planned failover and switch back from the primary to DR with mirroring. We do not have a separate monitor instance. Please help me with the following 1. Is it possible to switch back ...
2
votes
1answer
97 views

Export all tables in database using SQLCMD

I'm looking to export all tables from a SQL Server Standard Edition database with data into CSV files onto a remote linux server. I setup FreeTDS and am able to connect, do SQLCMD or bcp successfully. ...
1
vote
0answers
51 views

Defragmentation of SQL Server 2008 indexes

I hate asking this question, but I am having issues defragmenting indexes. I keep using the various defragmentation methods for defragmenting a SQL Server index such as DBCC INDEXDEFRAG and DBCC ...
0
votes
1answer
184 views

Machine account causing a Token-based server access validation failed with an infrastructure error

As the error suggests the SQL log is filling with the error: Login failed for user 'xxx\xxx$'. Reason: Token-based server access validation failed with an infrastructure error. Check for previous ...
3
votes
1answer
64 views

Error when using views on a linked server

I have this query: SELECT DescTipoentrevistador FROM Alfabase.dbo.tblTipoEntrevistador WHERE CodTipoEntrevistador IN ( SELECT CASE WHEN EXISTS ...
3
votes
1answer
104 views

best way to consolidate data

I have three select statements which have the bulk of their columns which are the same except a few. So here is an example select *orgid='0' ,'P' as OrgType* , Lang ,*cast(Null as varchar) as ...
3
votes
1answer
53 views

MERGE a UNION query results down to one row per KEY value

This is a lengthy query, it polls one LIVE database for certain sales information, then a UNION runs the same exact query on the ARCHIVE database for the same information. The results show each ...
0
votes
1answer
26 views

Allow public use of functions without giving them database control

I came up with a set of functions that I would like to be accessed from a variety of places. SQL seemed like the best place for this due to accessibility, but I receive this error when trying to use ...
1
vote
1answer
121 views

Why is Excel File Opened Exclusively By Another?

I'm creating an SSIS package to loop through a series of Excel files (.xls). I create my while loop container and then create my data flow, which includes an Excel source. When I edit my Excel ...
1
vote
1answer
198 views

How to get statement which causes error 3609?

How to find out which statement causes error Msg 3609, Level 16, State 1, Line 4 The transaction ended in the trigger. The batch has been aborted.? The code seems very straight-forward: -- 1. Check ...
2
votes
1answer
280 views

Performance of query with complex where clause on 10M rows

We have a query that destroys our production server when run. It is part of a reporting functionality and the bad part looks as follows: SELECT DISTINCT mt.ID AS ID FROM ...