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

learn more… | top users | synonyms (2)

0
votes
1answer
53 views

How to insert values through inner join

Could anybody tell me how to do insert statement with inner join. i am trying to insert ProductName,ProductCompany,ProductPrice,ProductQty in Product table and CategoryName in category Table. And ...
0
votes
3answers
3k views

Can I give the same name to a table and a stored procedure?

Is it possible to name a stored procedure the same as a table? I have an existing table named 'buyers', and I'm trying to create a stored procedure named 'buyers', but I'm getting this error: ...
2
votes
1answer
20 views

Selecting closest, non expired value [duplicate]

I'm trying to select multiple rows where the value is closest to the end date but not passed, and return only those rows. Here's a sample of some data: School Code | School Year | Semester | Term | ...
0
votes
0answers
24 views

Can you use SQL Server Development Edition for a website? [duplicate]

I've got a website I'm developing, and it's database driven. If I use SQL Server Development Edition as the back end, is that "legal"? I'll be the only developer using the software, but it will be ...
1
vote
1answer
456 views

Why is CDC capture failing due to a missing dbo principal

I am having a problem running the CDC change capture job against some of my test databases. The error message I'm getting is the following: Executed as user: NT AUTHORITY\NETWORK SERVICE. Cannot ...
1
vote
1answer
89 views

Replication error: the principal “dbo” does not exist [duplicate]

I have replication set up between two servers. This morning I came in and it was failing. I was getting these errors: Error messages: The process could not execute 'sp_replcmds' on ...
0
votes
1answer
24 views

Pivot Results By Day [duplicate]

I have a table in SQL Server 2008, with mails received from a pop account. The table has the following columns: +------+----+---------+------+------+ | from | to | subject | body | date | ...
1
vote
3answers
7k views

Update existing data with excel import

I have user table in my DB. I have 1 excel sheet having list of some users (not all) with changes. How can I Update the values given in excel sheet to my user table? is it possible with import data ...
0
votes
0answers
21 views

Query to get result in Excel file [duplicate]

The following query gives me the error Incorrect syntax near 'OUTPUT'. SELECT * FROM dbo.sales ; OUTPUT USING 'Driver=Microsoft Excel Driver (*.xls); DBQ=c:\\test\\sales.xls; READONLY=0' INTO ...
8
votes
3answers
90 views

Lots of “FETCH API_CURSOR0000…” on sp_WhoIsActive ( SQL Server 2008 R2 )

I have a strange situation. Using sp_whoisactive I can see this: Ok, with this query, I can see what is triggering ( does this word exists in english? ) it: SELECT c.session_id, c.properties, ...
28
votes
5answers
7k views

Downgrading from SQL Server 2008 to 2005

Database files that are built using SQL 2008 are not compatable with 2005. Is there a work around?
3
votes
2answers
55 views

Is is possible to recover a database from the 'raw' files (.mdf and .ldf) of the old server to a new SQL Server instance on a new server?

I have a client that has POS software called Restaurant Pro Express (RPE) from www.pcamerica.com. RPE uses a SQL Server database. Their old POS server had a hardware failure, but I was able to attach ...
0
votes
1answer
159 views

Migration script fires 'The data definition language (DDL) command cannot be executed at the Subscriber'

Yesterday I had run a migration script, produced by Visual Studio 2008 schema compare option, on a SQL Server 2008 database. It had run correctly. But today, when I executed the same script, it threw ...
2
votes
2answers
49 views

Optimizing query using a WHILE statement

I'm trying to convert a view that extracts a yearly amount into something more WHILEish The query is more or less: SELECT * FROM (SELECT SUM(EmployeePaid)*2 AS Total2013 FROM TblRecords WHERE FYear ...
-1
votes
2answers
505 views

How to Execute multiple select statements in SSIS 2008 using Data flow task [closed]

I am migrating data from one database to another database using SSIS package and i need to write multiple select statements for same table depending on conditions as mentioned below. Actual Queries i ...
2
votes
1answer
38 views

Replace/upgrade mirrored server hardware

We are deploying new VMs for a mirrored database that is in high safety mode with automatic failover and also going from SQL Server 2008 to SQL Server 2008R2. Most of the documentation I've come ...
2
votes
0answers
29 views

Connecting to SQL Server using PHP, ODBC, and Windows authentication [migrated]

I'm trying to use PHP to connect to an ODBC data source using Windows authentication. I can connect just fine to the server in SQL Server so I know it's running. When I try to run the command ...
4
votes
1answer
63 views

Why do async_network_io wait types occur?

Last week something strange happened on our database. All of a sudden, the application blocked for our users who were not able to save new entities etc. After looking at the Activity Monitor of the ...
1
vote
2answers
16k views

How to disable ldf file or limit its size [duplicate]

Possible Duplicate: Why Does the Transaction Log Keep Growing or Run Out of Space? My .ldf file size keeps increasing. I already tried to shrink it but after that it just grows again. How ...
3
votes
0answers
100 views

How to manage hundreds of SQL jobs? [closed]

I work in Microsoft SQL Server database and I have to monitor and manage hundreds of SQL Jobs to see which job will execute on what day and what time. I also have to troubleshoot the failure of the ...
2
votes
2answers
1k 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 ...
3
votes
1answer
550 views

Grant User Permission To Restore Database And Access that database in sql server?

I want to create a user having db_create, db_restore server roles and will be db_owner of that database. But there is only 1 server role available, that is db_creator, which can create database and ...
1
vote
1answer
230 views

SQL Server: update trigger fires before insert trigger

I have an application with a SQL Server-hosted database. I do not have access to the application code, but I do have full access to the database. I have added my own custom auditing to a table to ...
3
votes
4answers
4k views

SQL Server 2008: how much RAM memory should SQL Server use in a 8GB RAM server?

We have SQL Server 2008 and 8GB RAM in a customer, hosted in a Windows 2008 R2 SP1, and consider the following amount of free memory: and consider the following running programs: Scenario: ...
3
votes
2answers
99 views

Queries on database migration

I have a SQL Server 2008 database of size around 1 TB. I want to migrate it to SQL Server 2012. I have few queries: To migrate, I will take full backup of 2008 and restore it on 2012. I want to know ...
5
votes
2answers
504 views

If I update a column record in a table, will indexes that do NOT have this column in it be affected?

In terms of performance if I have a table like so: CREATE TABLE [TESTDATA].[TableA]( [Col1] [nchar](5) NOT NULL, [Col2] [nchar](2) NULL, [Col3] [float] NULL CONSTRAINT [TableA_PK] PRIMARY ...
9
votes
4answers
2k views

How will large index INCLUDE fields effect system performance?

This question is about SQL Server index performance with a varchar(2000) as an INCLUDE in a covering index. I’m trying to improve performance in an slow and unstable database application. In some ...
3
votes
1answer
76 views

Problem with clustered index? Or bad indexes? (SQL Server 2008 R2)

I have this query (it was running in 2 minutes). With new indexes, it takes 40 sec: This is the execution plan: [![100% use][1]][1] [![it's not heavy][2]][2] [![not at all][3]][3] I can't ...
1
vote
1answer
683 views

SQL Server Error - HRESULT E_FAIL has been returned from a call to a COM component

I have a huge 200MB .SQL file. When I try to open this in SQL server management studio 2008, I get the error -Error HRESULT E_FAIL has been returned from a call to a COM component. What could the ...
3
votes
1answer
86 views

Is it possible to validate more than one parameter simultaneously into a Stored Procedure in sql?

On Microsoft SQL Server 2008 I realized a stored procedure which contains more than 20 parameters, in this SP I update or insert data into table which does not accept null values. I need to evaluate ...
-5
votes
1answer
67 views

Split after comma into separate row [duplicate]

id name books 1 dan history,physics,english 2 ron chem,social,biology 3 mon it,ece,eee I need an output as id name books 1 dan history 1 dan physics 1 dan english 2 ron chem 2 ron ...
1
vote
1answer
126 views

Backup SSRS Encryption Keys Using Powershell

I have made the following script from google for backing up the SSRS Encryption keys: cls $pwd = "sa@123@123" $SSRSClass = Get-Wmiobject -namespace ...
9
votes
6answers
32k 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?
0
votes
3answers
73 views

Min(date) in sum case statement [closed]

I'm trying to write a statement where the settled date is less than the min(duedate) but I'm getting this error: Msg 130, Level 15, State 1, Line 32 Cannot perform an aggregate function on an ...
3
votes
2answers
45 views

Bitemporal Table with changing schema

I have to design a database covering business assumptions using MS SQL-Server 2008 R2. The current data of the tables will be exported to text files and used as input for a certain application. I ...
1
vote
1answer
45 views

Missing diagram option SSMS

I would like to create a relationship between to tables. Normally and in previous versions of sql server and the management studio I would go to database diagrams and draw the relation in the diagram. ...
0
votes
1answer
130 views

Insert/Update SQL Server Stored Procedure

I have to insert or update into a table depending on a record. I am using a stored procedure to do this. I am very new to SQL Server and stored procedures. I tried to follow various articles and ...
27
votes
2answers
63k views

How to identify which query is filling up the tempdb transaction log?

I would like to know how to identify the exact query or stored proc which is actually filling up the transactional log of TEMPDB database.
22
votes
1answer
39k views

How to force drop database in SQL Server 2008

I'm trying to force drop a database, but after dropping the database, when I try to recreate the database, I'm getting the error cannot create file C:\Program Files.....[databasename].mdf because ...
3
votes
1answer
676 views

SQL Script to Drop old AD logins, Inactive SQL Logins and all related Users

Related Question: SQL Server script to delete accounts no longer in Active Directory Whilst the above question points out the rather handy sp_validatelogins procedure, i'd like to extend this ...
2
votes
1answer
50 views

How can I optimize searching a column for a sub-string in SQL Server?

I have a very basic table: CREATE TABLE [obj_local] ( [obj_id] INT NOT NULL, [value] NVARCHAR (1000) NOT NULL ); This table stores a lot of data, and I need to search ...
3
votes
3answers
2k views

Setting up SQL Server 2008 R2

I need to set up a SQL Server for a development environment for a client. First I installed SQL Server 2008, I was able to connect to it from SQL Server Management Studio fine but when I tried to ...
3
votes
6answers
5k views

Trigger Performance : Is Using Trigger is a good way?

We are using SQL Server 2008 for a j2ee web application. I need to maintains the audits for updates for each column with their previous value and new value on one of my table which is very heavy, ...
1
vote
1answer
50 views

Why is FORCE JOIN option slowing down query and forcing execution plan to sort prior to joining tables?

I'm linking Orders data with the Results data for those orders. Here's the SQL query for joining and selecting the ; with orders as ( select o.*, otr.*, oo.* from Order o inner join ...
-2
votes
0answers
22 views

When backup a database [closed]

If you don't have space limitations, which would backup would be the argument about when a database (how many times at week, month, etc). I estimated that my database in 5 years will be at most 10 gb. ...
0
votes
1answer
114 views

reuse of temp table getting more time to execute

i'm creating temp table as, SELECT T.CD, T.OBJECT_CD, T.PRICE INTO #TEMP FROM TABLE_NAME T EDIT : ADDED CLUSTERED INDEX TO TEMP TABLE CREATE CLUSTERED INDEX IX_Temp_OBJECT_CD ...
2
votes
2answers
798 views

How to get OUTPUT $action, Inserted.*,Deleted.* records in In SSIS

I was just wondering, in MERGE in T-SQL, you can output the OUTPUT $action, Inserted.* and Deleted.* records. I want to ask how can I get OUTPUT $action, Inserted.*, Deleted.* records in SSIS?
0
votes
2answers
65 views

Dynamic Filters in SQL server [closed]

I have problems with my dinamic filter in 'sql server'. My problem is that the filters aren't working. When I try to execute the store procedure I just get all the data without filtering. I'm new ...
3
votes
1answer
281 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
11 views

SQL Server Merge - returning error messages properly - finding record where error occured

I have a table structure like: Parent - Child 1 - Child 2 - Child 3 In two databases, one of them has some extra fields. I want to get the data(which can be huge) from one database into another ...