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

learn more… | top users | synonyms (2)

2
votes
2answers
178 views

How to split url in sql server like this

Here is the url www.abc.com/a/b/c/d/e/f/g/h/i I want result like this www.abc.com/a/b/c/d/e/f/g/h/i www.abc.com/a/b/c/d/e/f/g/h www.abc.com/a/b/c/d/e/f/g www.abc.com/a/b/c/d/e/f ...
1
vote
2answers
75 views

How to break down RELATIONAL data into HIERARCHY data structure?

I have a query that returns the following dataset: RELATIONid MAPid D1id D2id D3id 4999 4999 626 1250 7 5000 5000 626 1250 8 For the next step, I need to bind those ...
6
votes
2answers
178 views

nvarchar(max) converting to varchar and table optimization

I am working with a table that has all character types set to nvarchar some of them are nvarchar(max). We are converting all these to varchar and specifying a character width based upon the actual ...
-1
votes
2answers
94 views

Deadlock from select statements

I am getting deadlock from 2 select statements. What is the reason for that? And how can I fix this issue? Deadlocked processes: 11278 Victim process: 5185 Lock type: Index/(Key) Both ...
0
votes
3answers
56 views

how to set “result to text” with a tsql statement in sp?

is there any way to set "result to text" within of SP while this execute a process? a tsql stament? Thanks.
7
votes
1answer
164 views

sp_cursoropen and parallelism

I'm running into a performance problem with a query that I can't seem to get my head around. I pulled the query out of a cursor definition. This query takes seconds to execute SELECT A.JOBTYPE FROM ...
-1
votes
2answers
63 views

how can I delete records when my disk drive is full?

My data folder of SQL as filled up the space of my local drive. I have 150KB free space left in the drive. So I have to delete some records to regain space. But when I run the delete query it says ...
0
votes
1answer
48 views

How would I grant select on a table being used in a different database to a user role in SQL?

I have a view that's selecting rows from a table on a different database. When calling this view from my application I get an inner exception thrown saying the application user is not able to access ...
3
votes
1answer
123 views

Hiding a SQL Server vs Turning Off SQL Browser

Can anyone explain the difference between turning off the SQL Browser service and Hiding an instance through the SQL Server Configuration Manager? I've always assumed they do the same thing and have ...
2
votes
2answers
980 views

what is relation between sql server back file size and space required for restoring database

I am using sql server 2008. I have taken full backup of my database. Its backup file file (.bak) is around 750 MB. Sql Server is installed on c drive which contains 5 GB free space. When i try to ...
1
vote
1answer
27 views

Import .bak into SQL Server 2008 Management Studio

I have a custom program that uses a database. I have little knowledge of servers but the way it works is by using a "local" server in the same computer as the one where the program is installed. I am ...
0
votes
0answers
22 views

How to Backup a Database with Specific Date Range in SQL Server 2008? [duplicate]

I have a database around 160 GB size. I want to backup the database with specific date range. Example the database contains from 2013 to until today. I want to backup database from '2015-01-01 ...
18
votes
5answers
44k views

How do you kick users out of a SQL Server 2008 database?

We need to do a restore, and cannot because other users are connected. We thought we had disconnected every process, but apparently not. How can we, from Management Studio, kick off everyone else so ...
1
vote
2answers
28 views

Custom ORDER BY

Are there other ways to use ORDER on my results? 20150507094958A DISPOSED 2015-05-07 09:50:00.853 Samuel MONEY 20150507094958A DISPOSED 2015-05-22 09:25:00.000 Jeff AUTOMOBILES ...
2
votes
0answers
35 views

Upgrading SQL Server 2008 Standard to Enterprise

I'm trying to do the upgrade but when it asks me for the Product Key for the current version, I can't find it. When I go on the MSDN website for it, it says that a key is not necessary for this ...
1
vote
0answers
6 views

Database engine installation failed

Being asked to implement an application for purchasing management, the database managing system which I have to install, is SQL Server 2008. I am having some issues while installing the main ...
6
votes
3answers
15k views

How to view an encrypted view or stored procedure

I am working on a third party database. When I try to view the definition of a view by right clicking, CREATE TO and then to NEW QUERY EDIT WINDOW, I am getting an error: This property may not ...
2
votes
1answer
28 views

Pivots giving too many results

I'm trying to learn how this pivot thing works. I don't think I'm understanding it quite right. I just want to do a simple count for a bunch of item types that have some statuses. The table I'm ...
1
vote
1answer
57 views

Upgrade to SQL Server 2012 [closed]

We are currently running SQL Server 2008 Standard edition, 4 processors / 16-core and 32 GB RAM. In the last 3 months number of requests per week raised from 11.1 millions to 72.1 million and the ...
2
votes
1answer
22 views

How to do housekeep the database in sql server 2008 by specific date range?

I have database with around 160 GB size. The database contains the data is from 2013 to until today, there are 180 tables, I want to remove the records in specific date range like 2013 to 2014 in all ...
1
vote
0answers
45 views

Moved tempdb, now File 'tempdev2' does not exist

I moved the tempdb first locating the files: use master select name, physical_name from sys.master_files where database_id = DB_ID('tempdb'); GO then I moved each file: use master go alter ...
1
vote
1answer
38 views

SQL Server Failover cluster installation fails `RequireKerberos` to value '1'

Hi I am trying to create a SQL Server Failover cluster. Windows Cluster is configured and working as expected but now when I try to install SQL Server it throws the following error: OS: ...
3
votes
1answer
25 views

Information about a column and the data it holds?

I'm working with a table that has 3 different dates associated with each item in the table. I don't understand what each time is so I want to know if there's a standard place that the person who made ...
1
vote
0answers
24 views

How Columns_update() Function Works in Trigger To Find Updated Columns Name

I am in confuse about trigger function Columns_Update(). i Have Basic Idea about this function that it returns a varbinary and it is use to get updated Columns in Trigger even i have Find The code ...
2
votes
1answer
26 views

SELECT all rows when a variable is null [closed]

How do you select all values when @Troop is NULL. And if there's a better way to do this all together then what would that be? WHERE DateModified BETWEEN @BeginDate AND @EndDate AND ...
6
votes
1answer
237 views

Suppressing the SSMS prompt to save changes

Is it possible to configure SQL Server Management Studio (SSMS). so that the dialog box shown above does not appear when I close an unsaved query window?
-2
votes
1answer
42 views

Recursive cte addition in SQL

I need to add the total value to the parent nodes.(totaling the total value to base to top levels). 118 records are there and 1-8 levels. Root ACCCODE='00001' Root ACCPARENTCODE='0' Eg: adding ...
1
vote
2answers
49 views

Rollback Committed transaction in SQL Server

Is it possible to rollback a committed transaction? I have deleted all the data in a table. The delete statement is inside Begin Transaction and I have committed the transaction with a commit ...
2
votes
1answer
53 views

Searching SSIS packages for the use of specific tables

I have a number of SSIS packages, how can I search them to find the use of specific tables? I need to make tables changes and I am trying to assess the impact of these.
5
votes
1answer
390 views

How unsafe is it to change the data source of repl_distributor on a publisher

Here's my situation. Reporting Server (SQL 2008) is distributor/subscriber cluster for a SQL 2000 Transactional Publication Reporting Server was migrated to new SAN Reporting Server fatally crashed ...
3
votes
3answers
220 views

Make a column for each count(*) in a day of the week

I have a table of people who are doing piece work. Every entry in the table has a user-ID, name, and a Date for each report they enter. I need to make a weekly report of what these people have done ...
0
votes
1answer
261 views

EXEC Multiple procedures in parallel?

SQL Server 2008. I have several stored procedures. I would like to execute them all in parallel, not serially. How can I do this?
0
votes
2answers
81 views

AVG function returns wrong average

I have a simple table with a column of type REAL. There are 2 rows in the table and the values are 0.23 and 0.24. If I run the following: SELECT AVG(MyColumn) FROM dbo.MyTable I would expect to ...
4
votes
2answers
26k views

Get the 2nd or 3rd occurrence of a value in a delimited string

I have the following table: ========================================================== | Name_Level_Class_Section | Phone Num | ...
13
votes
1answer
298 views

SQL Server recreating plans each day

We have this problem in our production environment. Microsoft SQL Server 2008 R2 (SP1) - 10.50.2500.0 (X64) - Enterprise Edition (64-bit) on Windows NT 6.1 (Build 7601: Service Pack 1). SQL Server ...
3
votes
4answers
3k views

query processor ran out of internal resources and could not produce a query plan

This is showing up in the logs several times a night. How do I find the query causing the issue? SQL Server 2008 R2 Sp1.
14
votes
3answers
4k 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 ...
2
votes
4answers
1k views

Working Linked Server Query fails in sp_send_dbmail

Take the following example: EXEC msdb.dbo.sp_send_dbmail @recipients = 'me@whatever.co.uk' , @query = 'SELECT TOP 10 * FROM LINKEDSERVERA.DATABASE.dbo.TABLE' , @attach_query_result_as_file = N'True' ...
1
vote
0answers
65 views

SQL Server 2008: DoMiniDump () encountered error (0x80004005) - Unspecified error

We're running a SQL Server 2008 database and are getting the following output(error?) in our logs: 06/23/2015 21:56:41,Server,Unknown,Process 214:0:42 (0x73b0) Worker 0x0000000BB2CC61A0 appears to be ...
3
votes
1answer
6k views

How do I alter index rebuild an entire database?

I want to reorganize the indexes of all tables in my SQL Server 2008 database, named 'db'. I try the following command: ALTER INDEX all ON db REBUILD And I get the following error: Cannot find ...
2
votes
4answers
89 views

SQL Server 2008 backup script

I have a lot of SharePoint 2013 databases to backup and if update fail to restore, so I want to automate this operations. ALTER DATABASE [TEST_1] SET OFFLINE WITH ROLLBACK IMMEDIATE GO BACKUP ...
1
vote
0answers
63 views

Export using BCP as ASCII text

I have a script that stores data in a temporary table to be exported by running BCP using xp_cmdshell. The trouble is that BCP insists on exporting the data in Unicode and I need it to be in ASCII. ...
1
vote
1answer
50 views

Dropping old and creating a new clustered index

I am wondering what is the best approach for dropping and creating a new clustered index on a table within SQL Server 2008. My primary concern is the length of time it will take to perform this ...
0
votes
1answer
45 views

How to make sum of minutes into (Hours : Minutes) format

How to add (sum) two fields (Data Type=Money) into hours:Minutes format Query: SELECT ( SELECT ISNULL(SUM(action.service_time), 0) AS Expr1 FROM dbo.act_reg AS action INNER JOIN dbo.act_type ...
8
votes
3answers
483 views

Accidentally change database name (SQL Server 2008)

It didn't happen to me YET. But I was thinking about this. I was messing around with my training environment, and by mistake I clicked in the database name, and then I touched the letter A. Let's ...
3
votes
1answer
236 views

SQL Server DOUBLE keyword

There is a reserved keyword DOUBLE in SQL Server, but I know that it's not a data type (other languages' double is float or real in SQL Server); does anyone know why this is a keyword? I've tried to ...
1
vote
0answers
140 views

How to create a Linked Server from SQL Server 2008 to DB2?

( This is an edit...the real post was really big ) I'm having problem with my SQL Server 2008 to DB2 linked server. I'm getting this error: TITLE: Microsoft SQL Server Management Studio The ...
3
votes
0answers
88 views

Bad Plan after a couple of days

I have this query that runs fine for a couple of days (from the application) and then slows down to where it can't even finish. If I rebuild the plan, it flies. There is a signifigant amount of data ...
0
votes
0answers
16 views

Better diagnose information in sqlcmd

I'm tired of running SQLCMD scripts that include a large number of files: :On Error exit :r ".\tables\table01.sql" :r ".\tables\table02.sql" ... :r ".\tables\table99.sql" ... and getting ...
2
votes
2answers
85 views

SQL Server 2008 - combined index + other separate index on one column

Lately I've been refactoring the SQL Server indexes of the products that I have developed for my employer. One of these products is an online dashboard containing multiple user levels. Each user (on ...