SQL Server 2008 (major build version 10.00.xxxx). Please also tag with sql-server.

learn more… | top users | synonyms (2)

0
votes
0answers
10 views

SQL Sum column til value and then increment group and continue summation

I've run across an interesting problem that I'm not sure how to tackle. I've been charged with finding a solution to the following scenario, and I'm not really sure where to go with it. Here is the ...
0
votes
2answers
63 views

How to resolve Geospatial Data over linked server causing error?

Update of the issue. The exact error is Failed to initialize the Common Language Runtime (CLR) v2.0.50727 with HRESULT 0x80131022. You may fix the problem and try again later. The error is happening ...
0
votes
0answers
15 views

login failure for sa to unspecified DB

I have a pair of SQL Server 2008 R2 DB mirrored and I'm seeing a login failure approximately every one minute. [417593] MSSQLSERVER Type: FAILURE AUDIT Computer: EVS-DBSERVER-2 Time: ...
0
votes
1answer
17 views

Change path to log shipping folder

We are moving our back-end storage so will need to change the paths for our log shipping. Can we do this without interrupting our log shipping? i.e. Just change the paths in the 'Network path to ...
0
votes
1answer
25 views

Updating and/or inserting several rows in the same SQL statement

I am implementing an account "ability" type thing - a users account is given the abilty to do one or many things in the system, like (simple examples) cancel orders or pay invoices. I have a table ...
0
votes
1answer
28 views

Random performance of stored procedure across databases

I have a stored procedure that is installed on 30 databases across 4 servers. We encountered an issue last night where 3 of these stored procs are now taking over 8 minutes (one 18 minutes!) to ...
0
votes
3answers
30 views

Page life expectancy very low on certain time?

Everyday we receive an alert on a specific period (03:00 AM - 04:00 AM) indicating that Page life expectancy is too low : SCOM :Alert: SQL DB 2008 Engine Page Life Expectancy is too low We have ...
0
votes
1answer
42 views

How do I run a query only asking for a max date of attendance?

I'm new to SQL and the school I work for wants to run a query on students' transcripts. We want to find out the most recent school the student attended prior to coming to ours. I think I need to use a ...
0
votes
0answers
10 views

SQLCMD is not working in pre-deployment script in sql project

I have sql project in visual studio and I created pre-deployment script /* Pre-Deployment Script Template --------------------------------------------------------------------...
0
votes
0answers
31 views

How to deal with linked server in SQL queries

I am creating a new database which will connect to several databases via linked servers. The problem I am trying to solve is that I have development, test and production environment with different ...
0
votes
2answers
35 views

Can I tell if a stored procedure has executed against a particular database?

As a result of a release a db is behaving "unusually". I suspect a stored procedure was missed during release, but my dba is telling me 100% it was executed. Is there any way to definitively prove ...
8
votes
2answers
107 views

Increase a counter for each changed row

I'm using SQL Server 2008 Standard, which doesn't have a SEQUENCE feature. An external system reads data from several dedicated tables of the main database. External system keeps a copy of data and ...
1
vote
2answers
21 views

issues with creating varchar returning functions [closed]

I have an issue while creating functions in sql server, am very new to sql server Below mentioned is the code which i used, please any issues with syntax. CREATE FUNCTION Fn_Check_Customer_Credit (@...
2
votes
1answer
26 views

Large Number of ALTER TABLE Statements

I am managing a database in SQL Server 2008. Across about 15 tables, I have 1600 VARCHAR columns that need to be changed to NVARCHAR. I was able to generate all the appropriate ALTER TABLE ...
0
votes
0answers
15 views

Unable to get 10.0.6547.0(TLS1.2) build link

Team Need your help to get TLS 1.2 build link for sql server 2008 SP4, I want to enable TLS 1.2 for this. https://support.microsoft.com/en-in/kb/3135244 above link does not route to correct download ...
2
votes
2answers
105 views

XML Parsing Illegal XML character error in SQL 2008

I was running this query in SQL Server 2008 (10.0.5890), Collation: SQL_Latin1_General_CP1_CI_AS SELECT CAST(event_data.value('(event/data/value)[1]', 'NVARCHAR(max)') AS XML) AS DeadlockGraph ...
0
votes
1answer
45 views

Improve SQL query performance, need help

I don't see any missing indexes on the execution plan apart from Hash Match, Parallelism and Index Scan. I get 218,673 rows in 5 minutes. Planning the improve the performance. Here is the sql query, ...
3
votes
2answers
64 views

SSAS where are olap cubes stored

Getting started on creating data cubes with SSAS. I understand the various types of OLAP options ROLAP, HOLAP and MOLAP. However, when creating a data cube using SSAS (at least for 2008 version) I do ...
0
votes
1answer
16 views

Query to map a particular database to a syslogin

I need to map a database to a syslogin. Following is the query I have used to create login and make it a db_owner but after the execution, I can see a tick as db_owner for that database in ...
1
vote
0answers
27 views

SQL Server 2008 : Agent's scheduled jobs [closed]

I have a situation with some of the scheduled tasks when they are completed a messages appears on the activity monitor that reads performing completion action and in some cases it is taking very long ...
0
votes
1answer
44 views

Restore of database failed .bak file SQL Server 2008

I have faced following error during restoring database: TITLE: Microsoft SQL Server Management Studio Restore failed for Server (Microsoft.SqlServer.SmoExtended) ADDITIONAL INFORMATION: ...
0
votes
0answers
38 views

sql the job was stopped prior to completion by shutdown sequence 0

I've transaction replication set up and running fine but today my Log Reader agent started having this warning : sql the job was stopped prior to completion by shutdown sequence 0 . The job was ...
1
vote
1answer
35 views

Table frequency metric Count (minimum 2 hits every 5 seconds using a datestamp within 24 hours)

I need to find out how many times a table has an insert within a 24 hour period per 5 seconds, if the table is inserted at least twice (2x) or more for each 5 seconds of the day, it should be counted. ...
2
votes
2answers
313 views

Recommended memory configuration for many SQL Server instances per server

I am currently managing a server cluster for a SaaS system. We currently have 6 SQL servers running MSSQL 2008 R2. Each server is a quad core virtual machine with 16GB of RAM provisioned on a server ...
19
votes
2answers
2k views

If positive, sum all items. If negative, return each one

I am needing to find a way to SUM() all of the positive values for num and return the SUM() of all positive numbers and an individual row for each negative number. Below is a sample DDL: Create ...
3
votes
1answer
80 views

Decrypting Previously Encrypted Data Returns NULL

I'm having trouble decrypting data that has previously been encrypted and stored in a table. After opening my symmetric key and encrypting the data using EncyptByKey(), I get NULL values when ...
1
vote
0answers
31 views

SQL Server Maintenance Plan Help

SQL Server Maintenance Plan Help I'm using SQL Server Maintenance and found a way to selectively turn on and off various features of the plan via it's associated job shown in Figure A. This can be ...
0
votes
2answers
38 views

KILLED/ROLLBACK query doesn't stop running

I've tried to kill a query on ms sql server management studio. Now it has the status killed/rollback. When I use: kill 74 with statusonly it doesn't make any progress. It is still at 0%. How can I ...
9
votes
0answers
246 views

ROW_NUMBER() OVER (PARTITION BY B,A ORDER BY C) doesn't use index on (A,B,C)

Consider these two functions: ROW_NUMBER() OVER (PARTITION BY A,B ORDER BY C) ROW_NUMBER() OVER (PARTITION BY B,A ORDER BY C) As far as I understand, they produce exactly the same result. In other ...
1
vote
0answers
18 views

Automatically updating Remote Server(B) Table when there is a Update in Server(A) Table with different schemas

I am having an Update trigger in Server A calling a Stored Procedure on Server B(through Linked Server) to update rows in Table2 in Server B, whenever there is a update in rows in Table1 (in Server A)....
1
vote
1answer
58 views

Trim a value in an xml column in MS SQL Server

I have a database with an XML column. I am trying to update (trim) an xml value of the xml column. I am running on Windows, SQL Server 2008 Express. I did not find any way to trim directly in Xquery ...
1
vote
1answer
56 views

Help me about syntax STUFF (SELECT… for XML PATH)

Here is script of 3 table: create table products( pid varchar(10), pname varchar(20)); create table [Order Details]( oid varchar(10), pid varchar(10), quantity int); create table orders ( oid ...
0
votes
1answer
146 views

Please explain why deadlock is detected in my example

I think Deadlock will happen when T1 lock tabA and T2 lock tabB. Then querying T1 to tabB (locked by T2) and T2 querying to tabA (locked by T1). So T1 and T2 will wait and wait till end of life! But ...
3
votes
2answers
104 views

Collect disk space metrics for whole SQL Server instance

I am quite new to SQL Server. I would like to collect database disk space metrics for the SQL Server instance as a whole. I have found a code sample that can collect disk space information per ...
3
votes
1answer
242 views

Is there a better alternative than LIKE for this query?

I am trying to retrieve data from a table where there are codes for projects which are identified by the first three numbers, the rest are unique. So, for example, the query is: SELECT * FROM TableA ...
0
votes
1answer
20 views

SQL export select statement to Excel using script

I have a project that requires me to create a script for migration between test and live data-bases. What i want to do is create an extract from the test database into an excel sheet or a txt file ...
1
vote
2answers
93 views

Can I convert date format for this value '19920000'?

I have a value 19920000. This is date format yyyyMMdd. I want to save by date field in the table. You may see it is invalid data because day and month value is zero. Can I convert date format to this ...
2
votes
1answer
34 views

Pre-checking execute privs for SPs

We have a number of DBs where EXECUTE privs are required on a SP by SP basic. We have other DBs where we don't need to do this at all. In the latter case, I understand that this is a blanket GRANT, ...
1
vote
0answers
41 views

How to convert datetime string of different formats in a valid datetime in SQL 2008

I have a table in SQL database in which there is an NVARCHAR(MAX) column. In it, the data is stored as 'Datetime1&Datetime2&Datetime3&Datetime4...'(& separated dates. I know this is ...
0
votes
0answers
12 views

Transient Log Shipping Restore Error - Could not redo log record (172980:741440:22), for transaction ID (0:1889746485), on page (1:28106052)

I'm running SQL Server 2008 r2 sp3 and am taking transaction log backups every 5 minutes from my primary server in a log shipping scenario. I have multiple standby servers that are log shipped to. On ...
1
vote
0answers
32 views

Migrating from DEV SQL Server to PROD - Any Point to Script the Statistics from DEV to prod?

I have a new database (powers a new website) in a dev environment. I have everything scripted out to create the DB, objects, and data in my production environment. In that DB, auto create and auto ...
4
votes
2answers
337 views

How do I order by NULLS LAST if my database doesn't support it?

Select FullName, Login FROM [User] ORDER BY FullName desc, login asc Results FullName Login ----------------------------- ------------------------------ M...... ...
0
votes
1answer
66 views

Effect of Reorganizing and Rebuilding an index [closed]

What are the effects of Index Rebuilding and Reorganizing on clustered and non-clustered indexes. How does these 2 operations affect the logical storage and physical storage of data in Hard disk?
1
vote
0answers
22 views

Minimum permission needed for GRANT CRUD ON

I have a certificate set up to do cross database CRUD operations. The certificate is linked to a user in each destination database. I sign any stored procedures in the source database with the ...
0
votes
1answer
50 views

SQL Server : View names

I'm coming from an Oracle background and came across code to create a SQL Server view which I've never seen before. We have a view called viewA (for example) Within the script to generate the view I ...
0
votes
0answers
39 views

Export Stored Procedure Results To CSV

I have seen many options for doing such, however most of them involve using bcp or using exec master..xp_cmdshell which I am unable to use on my server (security restrictions). I was looking at ...
0
votes
1answer
23 views

Howto transfer tracefile into a trace table without loosing the sort order?

I have traced some data into a trace table into Sql Server using the Profiler GUI. This table has the following structure: It contains the SQL statements as well as execution plans in the TEXTDATA ...
1
vote
1answer
28 views

Combining multiple-row data into a single row

I have a table that has columns like following ID Number Value1 User1 Value2 User2 Value3 User3 -- ------ ------ ----- ------ ----- ------ ------ 1 123 0 Jack 1 123 ...
1
vote
0answers
31 views

Re integrate MSSQL 2008 to new Active Directory

I have a server which was joined to an AD Domain, then installed with MSSQL Server 2008 R2 and System Center Operations Manager 2012's Reporting Server on it. The same server had the Active Directory ...
0
votes
1answer
32 views

Upgrading SQL Server 2008 failover cluster node to SQL Server 2012 failover cluster node [closed]

Please I want someone to help me with step by step method of upgrading SQL Server 2008 with failover cluster node on two different machines to SQL Server 2012 without losing the existing settings/...