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

learn more… | top users | synonyms (2)

-3
votes
0answers
13 views

sql query for interchanging rows and columns [on hold]

My data looks like: orderA file1 file2 file3 file4 file5 orderb file7 file8 file9 file10 file11 I want output as like OrderA file1 file2 file3 ...
3
votes
2answers
189 views

Only show results greater than a certain number when summing two values together

I have a query that sums up two values in the same table and then calculates one as a percentage of the other select account_no, 100*((sum(COMMISSION/100)) / (SUM(AMOUNT/100))) from accounts etc ...
0
votes
0answers
10 views

Combine multiple same rows into one row by using Id

This is my table: ID Contact Id Ad-type Ad-Title Images_Path 1 2 Houses For Sale lands/im1.jpg 2 2 Houses For Sale lands/im2.jpg I need output like this: ...
1
vote
2answers
174 views

Why does FETCH NEXT return second row after opening cursor?

I have a cursor declaration: DECLARE idCursor CURSOR FOR SELECT DISTINCT [id], [data] FROM #tempRemaining OPEN idCursor And the statement: SELECT DISTINCT [id], [data] ...
2
votes
1answer
20 views

Hosting SQL Server and SSIS/SSRS in same VM

I have SSIS / SSRS and large number of databases currently being hosted on the same prod server (SQL1, SQL Server 2008R2). Since SQL1 already has SSRS/SSIS installed, would it be a good option to ...
0
votes
0answers
21 views

Linq Query Optimization [on hold]

Urgent,I am really in trouble. can anybody help me? my query is slow: I have created a view in sql server containing nested loops like this: Tis is my view: SELECT dbo.VE.V, dbo.VE.Operation, ...
0
votes
1answer
12 views

Do we have logging feature for SQL AUDIT like we have it for transaction and error logs in SQL server 2008?

Do we have logging feature for SQL AUDIT like we have it for transaction and error logs in SQL server 2008 ????
1
vote
1answer
44 views

microsoft sql server schema [on hold]

From blog.sqlauthority.com: Protecting ISV database access: in custom ISV (Independent Software Vendor) applications, the database schemas are usually complex, and in the case of applications such ...
0
votes
0answers
19 views

What is the syntax to sp_recompile logon trigger?

I would like to recompile my logon trigger using sp_recompile. But I can't figure out the syntax. E.g. these don't work: sp_recompile '[Tr_Logon]' sp_recompile '[Tr_Logon]' ON ALL SERVER ;)
12
votes
1answer
843 views

Best way to write SQL Query that checks a column for non-NULL value or NULL

I have a SP with a parameter that has NULL as default value and then I want to do a query like this: SELECT ... FROM ... WHERE a.Blah = @Blah AND (a.VersionId = @VersionId OR (@VersionId IS NULL AND ...
1
vote
2answers
52 views

SQL Server : Tracking a slow running query on completion

Am trying to work on script for slow-running queries. I understand that we can get the list of slow running queries using sys.dm_exec_requests. Say, I have a query Q1 which is running very slow, say, ...
1
vote
1answer
23 views

How to update/insert/inject nodes into XML

I have an application which stores optional Site information in an XML field. Sample table: CREATE TABLE [dbo].[Sites]( [SiteID] [int] IDENTITY(1,1) NOT NULL, [SiteName] [nvarchar](80) ...
2
votes
3answers
60 views

updating the entire column with datetime values based on other values in the row

I have a very large table [server].[dbo].[MyTable] where I need the SQL statement to fill the column 'ToDateTime' (currently full of NULLs) according to the following logic: Only add a value to ...
0
votes
2answers
37 views

How to add deleted user in sql server? [duplicate]

I have set up sql server 2008 in windows server 2008 r2 and it works fine. However, I have deleted the my user from logins in the sql server accidentally and now I cannot find a way to log in to the ...
0
votes
0answers
9 views

Are tables during a merge function updated dynamically?

If for example, I have a column age in both tables. My merge condition for two tables is when table1.age=table2.age. My WHEN MATCHEDinstruction is to increment table1.age by 1. So if a row with age=5 ...
-3
votes
0answers
22 views

what is other way of use Limit function in MSSQL server [migrated]

How to use LIMIT function in SQL Server. I need to create a pagination using SQL Server data and I need to fetch the data using $start and $pagesize. This is the query used: SELECT * FROM ...
1
vote
0answers
16 views

Why do async_network_io wait types occur?

Last week something strange happened on our database. All of a suddon, the application blocked for our users which were not able to save new entities etc. After looking at the Activity Monitor of the ...
1
vote
1answer
32 views

Database compatibility level [duplicate]

We are on SQL Server 2008 R2 and have DBs compatibility level set to SQL 2000 or 2005. What are differences in compatibility level across the versions ? Are there any advantages changing it to 2008 ...
2
votes
0answers
29 views

Server Logon Trigger fails after deleting many records in “Logon-Table” -SQL Error 2801

We have a server logon trigger defined that logs every login with information like windows/sql user name, client and time in a table. The table doesn't have clustered index, but it does have a ...
2
votes
1answer
30 views

Select columns dynamically from sql server table

Lets say I have a table that actually store record which looks like Create Table dbo.Info ( SN int primary key identity(1,1), FirstName nvarchar(50) not null, LastName nvarchar(50) not null, ...
2
votes
2answers
47 views

JOINS - optimize cost of LIKE/OR criteria

The Active table has the Account Name in 1 column and the Master table has the Account Name in any one of 6 separate address columns and I'm trying to match them. Also, they don't necessarily exactly ...
1
vote
1answer
20 views

Are there security vunerabilites/implications with SQL Mail, currently using SQL Server 2008 R2

I am an accidental DBA and responsible for series of data load jobs. I would like to use SQL Mail for altering me to job failures. SQL Mail is not currently turned on are there security concerns in ...
1
vote
2answers
59 views

Restore SQL Server 2008 database onto SQL Server 2014?

I have a backup file that I need to restore daily on schedule based. But the backup file is from SQL Server 2008 and restore destination is SQL Server 2014. And also the backup file is from cross ...
1
vote
0answers
42 views

Database fragmentation and heap SQL Server

We have critical performance issues with our production database (its around 300 gb size) We have run the following script for a few huge tables : DECLARE @db_id SMALLINT; DECLARE @object_id INT; ...
0
votes
1answer
26 views

Microsoft SQL Server partitioning with on premise server

I'm planning for a small hosted ASP.NET application which uses a Microsoft SQL Server 2008 database. One of the users which uses the application doesn't want his data to be stored in a remote database ...
0
votes
0answers
12 views

SQL - ignore new columns in Access

At my company we download an Acces DB daily, SQL pulls that file to update a Spotfire file. Sometimes the Access file has had columns added. This causes an error in SQL and stops the Spotfire ...
3
votes
2answers
45 views

Historical dbcc checkdb results

Is there a better way of accessing historical dbcc checkdb result history (if output logging was not used at runtime) than xp_readErrorLog? EXEC xp_readErrorLog {0-20}, 1, N'CHECKDB'; SQL Server ...
0
votes
0answers
18 views

Unicode character replication MSSQL to MYSQL in Symmetric DS

I'm doing replication from MSSQL to MYSQL using symmetricds and it is working fine. Now , the problem is: In the SQL Server table , I have a column defined as NVARCHAR(20) which accepts unicode ...
0
votes
0answers
21 views

Data transfer in sql server 2008

I have following requirement In SQL server 2008,Trying to implement in stored procedure source table T with 100000 records need to be insert into destination table T1.A Job will be schedule for this ...
6
votes
2answers
152 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
vote
2answers
67 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 ...
0
votes
3answers
44 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.
6
votes
1answer
136 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 ...
0
votes
1answer
46 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 ...
-1
votes
2answers
76 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 ...
3
votes
1answer
101 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 ...
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 ...
1
vote
2answers
26 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
28 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
1answer
22 views

Index design question

This query runs for 60 seconds: SELECT mychecklis0, .... FROM dbo.MyChecklistStatus mychecklis0_ WHERE mychecklis0_.AppFormSubSectionId=@P0 AND mychecklis0_.ProfileId=@P1 There is an index created ...
-1
votes
2answers
55 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 ...
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 ...
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
52 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
28 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
25 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: ...
2
votes
1answer
36 views

SQL Server 2008 Edition Upgrade Enterprise Evaluation to Standard problem

On my Windows Server 2012 machine SQL Server 2008 evaluation time has expired. After Edition Upgrade nothing happens, SQL Service doesn't start. In service log still is information about expired ...
3
votes
1answer
24 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
15 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 ...