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

learn more… | top users | synonyms (1)

1
vote
1answer
26 views

How to update a single record in a table based of foriegn key ID in another table?

I am still very new to sql. I am having troubles updating one table. I am sending information from a web application into Microsoft SQL 2008 database. I have a table called EmployeePermissions that ...
0
votes
2answers
47 views

Are #tables and #procedures 'not best practice' or 'bad practice'?

I am working on a project and part of it is an interface tool that executes SQL code stored in a xml file to import/export files. In the file, temp procedures and temp tables are used quite heavily ...
0
votes
1answer
51 views

SQL Server : slowness / CPU issues [closed]

We have a SQL Server with about 15 databases and about 60 + users accessing any of these databases. Each database is designed to serve different data set (meaning - we have multiple roles in each ...
1
vote
2answers
37 views

Proper Shutdown of SQL Servers in a Cluster

I was just wondering what the best approach should be for shutting down an Active/Active Cluster where both nodes need to be shutdown for disk maintenance. I was thinking of this process: Open ...
0
votes
0answers
36 views

Track record deltas/changes on SQL Server 2008

Trying to build some sort of ETL process that copies rows from SQL Server into Elasticsearch indexing server. My ETL process should be able: Detect new rows inserted to the SQL Server table. Detect ...
4
votes
3answers
114 views

Virtual Log Files (VLFs) Fragmentation

I have a database with 160 VLFs. How do I determine whether the VLFs are fragmented? Further, how do I find the percentage of fragmentation? Another thing that I want to confirm: Are the following ...
2
votes
2answers
324 views

In SQL Server 2008, in DMV sys.dm_db_index_phsicial_stats, what does compressed_page_count mean in comparision with page_count

In SQL Server 2008, DMV sys.dm_db_index_physical_stats, what does compressed_page_count mean in comparison with page_count. I have a table with the following info: Object_id Index_type_desc ...
1
vote
1answer
34 views

set date value based on other row values

Sorry for the Header, I can't find the right way to describe what I want, possibly the reason why I can't get a solution by googling :) ... Here my problem: I've got a table with the following ...
0
votes
1answer
180 views

Validate each parent intermediary is also a parent to itself

I want to validate where each parent intermediary is also a parent to itself. So this query should return invalid parents in SELECT if table has any. I need to do is first of all get all parents ...
-3
votes
0answers
58 views

how to query to get data from multiple tables [closed]

i'm having data like this in two tables i want like this The query I'm using right now is: Select A.TaskCode,A.SubTaskCode,A.TagNo,A.TruckNo,A.Location ...
1
vote
1answer
116 views

change display of rows into single row in SQL server 2008

I have created a db that contains the following 2 small tables Here is the db script USE [Test1July] GO /****** Object: Table [dbo].[Hotels] Script Date: 07/01/2014 22:33:33 ******/ SET ...
5
votes
3answers
232 views

Backup not creating a new file

I run a daily backup of my database through command prompt: c:\sqlcmd -H localhost -Q "BACKUP DATABASE test TO DISK='c:\test.bak'" But the new backup replaces the previous backup. Please tell me ...
0
votes
1answer
29 views

Coalesce per row - get all Detail IDs grouped per HeaderRow e.g. Invoice1 | 1,2,3 Invoice 2 | 4,5,6

I have the following demo data (taken from Adventureworks) SalesOrderNumber SalesOrderDetailID SO43659 12 SO43659 11 SO43659 8 SO43659 9 SO43660 ...
5
votes
2answers
3k views

Data type for storing an array of flags (a bitmap/bit array)

I need to store a bit array for each record of a table, supporting the following operations: Testing if a bit is set, and setting a bit (using SQL) Querying and setting the value using ADO 2.8 (not ...
0
votes
1answer
24 views

Index Maintenance Plan

At our organisation we are migrating to SQL Server from visual foxpro dbf and hence had no maintenance plans and have no DBA. We have gone through our backup plans and Index maintenance is only index ...
-2
votes
1answer
41 views

Using the “Select Top (100) percent vs. Select * , or selecting any column” [closed]

I wrote the first query below that I was hopeing to give me the exact same results that the 2nd query does, but it seems there is one recrod different: SELECT DocumentSourceName FROM ...
2
votes
1answer
37 views

Centralized master data shared among other several DBs

I'm researching and investigating about all possible ways to create a master data database for my portfolio of applications. To give you a quick overview, an example will come in handy: I want to ...
1
vote
4answers
109 views

Is it ok to change from full recovery to simple recovery in Sql Server

I have an old database - a users membership/role that was setup automatically by an ASP.Net 2 application years ago: The Sql Server version currently running is: Sql Server 10.5.1617 The users ...
1
vote
2answers
896 views

rsExecutionNotFound when directly accessing an SSRS report

I have an SSRS report that can I access from the Web Portal but once I try to access it directly through the URL, I get the following error: Execution 'xxx' cannot be found (rsExecutionNotFound). I ...
0
votes
1answer
28 views

How to Sum Each Enum Value in a Different Column and Don't Repeat Person's Name?

Let's say I have a table with SellerId, DateTime, ProductType to register each time a a Seller sells a product. The ProductType is from ENUM type with { 0=Phone, 1=Recharge, 2=SimCard }. Then I have a ...
2
votes
4answers
9k views

How to create and send mail in SQL Server 2008?

I want to send E-mail from SQL Server 2008. What are the basic steps for that? Can you explain me if someone used this facility. Any help will appreciated. this link will helpful as commented by ...
5
votes
1answer
4k views

Difference between EXEC() and sp_executesql with no parameters?

I just learned about the new sp_executesql stored procedure. I like the fact that there's a way to execute parameterized code from within SQL Server. But, I'm wondering what the difference is ...
1
vote
2answers
254 views

Alternatives to joins using Linked Server and OPENQUERY

In my environment, we have a server that stores sales data and another server that stores our HR data. For some reports, we need to combine sales data with employee data. Our sales server contains ...
4
votes
2answers
831 views

Why did my UPDATE statement not complete?

Good morning. Running SQL 2008; Mgmt Studio 2008. I am working with a MS SQL job that we have created for our MS CRM 4.0 implementation. For anyone familiar with CRM, this job purges the ...
2
votes
1answer
53 views

Moving Clustered Index to new filegroup results in excessive filegrowth

I've Moved the clustered index on large tables to new filegroups to defrag, compress, and to recover space more easily from the original "primary" filegroup. Problem: A 315GB compressed Clustered ...
3
votes
1answer
492 views

Backing up file groups with restore to earlier backup

I have a task: I have created a database with a filegroup lamb that has a few tables. I need to extract a csv into a table in a filegroup named lamb and back up that filegroup. Then extract another ...
1
vote
2answers
271 views

Adding Data to Multiple Tables Using Single Query [closed]

I want to add data to multiple tables using a single INSERT INTO query, can I do this? Please guide me and provide me syntax if this is possible.
0
votes
1answer
103 views

Copy+Pasting currency value from SSMS 2012 to excel does not complete or calculate new value

So I'm trying to copy and past some query results into excel, and for some reason it seems to be not properly completing the first value. Let me explain what I mean by this. In excel the cells I am ...
0
votes
0answers
28 views

SSIS - the 1st item in the data flow package view always imports way slower than the others

In the SSIS data flow task, I've been importing CSV files to my SQL Server via Flat File Source -> OLE DB Destination. When I'm setting things up in the package design preview, if I have just one ...
0
votes
1answer
33 views

High Service Broker queue

My production database suffers from a large Service Broker message queue. It is around 2 million. I would like to decrease it as small as possible. I have tried dbcc ...
1
vote
1answer
35 views

Get data per Customer and per Date

How will I get the all the date even though there is no order between two dates? Sample Table OrderID | Date | CusID 33942 | 6-21-2014 | 6005 34059 | 6-20-2014 | 4003 53333 | ...
1
vote
1answer
280 views

Increasing time-out period for schema compare (windows server 2008, Sql Server 2008 R2 and VS2012)

I need to increase the time-out period for schema comparisson using visual studio 2012 to compare two sql server 2008 r2 database on a windows server 2008. I believe this is somenthing I need to set ...
3
votes
2answers
3k views

Connect to SQL Server 2012 from an Windows XP client

We have an SQL Server 2012 Standard database, to connect to it we use SQL Server 2008 Management Studio (since 2012 SSMS is not supported on Windows XP). The problem is that SQL Server 2008 gives all ...
8
votes
4answers
10k views

How to detect any changes to a database (DDL and DML)

There are a lot of databases on my client's sql server. In common, these databases is under development, so developers can design, refactor, do data modifications and so on. There are some databases ...
1
vote
0answers
42 views

How do I analyse DBCC Showcontig of a table? [closed]

Can somebody help me how to analyse the DBCC SHOWCONTIG output for a table. Before: Table: 'table1' (795); index ID: 0, database ID: 7 TABLE level scan performed. - Pages ...
1
vote
2answers
135 views

Improving a search query

I have a query for search function. Basically search function allowed user to define what they "have" and "want". Then this query will filter out all the possible result which created by other user. ...
0
votes
2answers
13 views

SQL Server Management Studio is not available

When I installed SQLManagementStudio_x64_ENU.exe I am not able to connect to my server. In the image (1) session, I am not getting server name. Also in (2) session also I am not getting it. Is there ...
3
votes
3answers
2k views

Sql Server 2008 R2: Simple recovery model with transaction log backups

I'm busy reviewing my SQL Maintenance plans and I'm a bit confused with the recovery model option on the databases, specifically related to point in time recovery. Here is my scenario: I have two ...
-1
votes
0answers
29 views

Is there any Microsoft SQL Server database hosting service for desktop applications ? (not web hosting) [duplicate]

i am wondering if there is MS SQl Server hosting service provider for desktop applications,not web hosting services, i do not have asp.net web application or site, i have a .net application which is ...
0
votes
1answer
56 views

UPDATE not working properly with linked server

Please see a question I asked here earlier: http://stackoverflow.com/questions/24324823/update-not-working-properly-with-linked-server Dommer suggested using OPENQUERY and this does appear to resolve ...
0
votes
0answers
19 views

Check if any user uses a database? [duplicate]

I'm going to drop a database. I want to monitor if any user is still using the database for a couple of months. Besides profiler, is there a better way to monitoring activities on a database?
1
vote
2answers
48 views

Making a Database Online [closed]

I am so confused with this issue, I have vb.net application and it has a sql database . Now, I want this application to access the sql server from anywhere , because there are many clients sharing ...
1
vote
0answers
41 views

Stored procedure taking much longer than query [closed]

I have a simple code segment that runs in about 1 second when run alone, but more than 5 minutes when deployed as a stored procedure. I'm using sql server 2008. Unfortunately, I can't post the code ...
6
votes
2answers
4k views

SQL query slow-down from 1 second to 11 minutes - why?

Question: I'm porting the below query (listing tables by foreign key dependencies) to PostGreSql. WITH Fkeys AS ( SELECT DISTINCT OnTable = OnTable.name ,AgainstTable = ...
1
vote
2answers
45 views

How to get the first or last row in ordered result set, depending by column value?

I have the follwoing result set from the table PUNCHREPORT EMPLID Name PUNCHDATE PUNCHTIME DEVICETYPE .................................................................. 70 ...
0
votes
1answer
68 views

how service sid operate under the covers?

This question is out of curiosity and it left me in confusion whether service account as any role to play in sql server startup and shutdown? Can anybody explain how sql server 2008 Service Sids work ...
1
vote
1answer
23 views

Security access to a table

I have a database and table dbo.Test_Table, with list of Users under Security -> Users. those users have access to all the tables in my database. I would like to know how do I assign certain users to ...
2
votes
1answer
123 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
0answers
15 views

SQL Server 2008 database is not coming online after restore.. Pleae need help asap

I have restored a 1TB database and now it shows the restore completed 100% but the database is not accessible. sp_who2 has a SPID 50 performing this restore but current command its showing is ...
0
votes
0answers
22 views

Reducing log files? [duplicate]

I have a database that has a log file of nearly 80 GB. Database size 180 GB. The recovery is set to Full. What is the correct way to shrink the log file without using the shrink option in SSMS as ...