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

learn more… | top users | synonyms (2)

2
votes
1answer
1k views

PK Violation after transactional replication

I have an application set up with transactional replication being pushed to a standby machine that will be used for emergency failovers. The replication appears to be working, any inserts made to ...
3
votes
2answers
635 views

can I convert an integer to base-2 without a function

Here's a bit of a challenge. I am working with the table ReportServer.Schedule and there is a column called DaysOfWeek. I may not be using the proper terminology here, but this is an integer from ...
6
votes
1answer
246 views

Is it recommended to clear the query plan cache

Pretty much as the title describes. I have just checked a SQL Server and noticed there is a lot of query plan bloat that can be fixed by proper parametrisation. After making the changes to the code, ...
13
votes
2answers
2k views

Why can't I use NEWSEQUENTIALID() as the default value for my column?

I'm trying to create a table in Management Studio and after reading about the new (from SQL 2005 on) NEWSEQUENTIALID() function, thought I'd give it a go. This is what I'm doing: But it's not ...
3
votes
3answers
32k views

SQL Server How to Set up Maintenance plan to shrink log

So I have a log file which grows very large after I run an SSIS job daily, sometimes up to 1220MB. In my database options I have set my recovery model to "FULL". When it is to FULL and I perfrom ...
5
votes
2answers
285 views

Summary of locks for a query

Does SQL Server have any simple way to fetch metrics on how many (and possibly what type) of locks a given query has taken out during the course of it's execution? Rationale... I'm in the process of ...
1
vote
1answer
214 views

ssis delete database on error

I'm writing an ssis package that imports a number of access databases nightly. Each database has the potential to have a slightly different schema. Since I'm creating the tables than doing a direct ...
2
votes
1answer
343 views

Allow a user to create folders and linked reports, but not “real” reports

I have a need to allow certain users the ability to create folders and linked reports within specified folders, but I don't want them to be able to put actual reports in those folders. Is there a ...
2
votes
2answers
1k views

Attach database from SQL Express 2008 Edition to SQL Server 2008 Enterprise Edition

My friend is stuck on moving a database stored in SQL Express 2008 Edition in a server (called server A) to SQL Server 2008 Enterprise Edition in another one (called server B). There are two SQL 2008 ...
5
votes
2answers
688 views

Performing data update operations while backing up a large SQL Server database

I have a large (in the tens of millions of records) database that I am going to perform a full database backup on. However, the database is large enough that transactions can start before and during, ...
3
votes
3answers
2k views

Faster alternative to scalar UDF with recursion?

I have a scalar function that traverses a simple parent-child hierarchy of customers to find the ancestor that's in charge of billing. Here's a simplified version of the schema. CREATE TABLE Customer ...
2
votes
1answer
2k views

SET QUOTED_IDENTIFIER issue

I have created a Database Project in Visual Studio 2010 for a database which is in 2008. I am having issues in deploying the database as I don't know why, but at the time of deployment in some ...
4
votes
2answers
168 views

Where clause for aliased column

I have a query which parses a string values from a column: SELECT left(DateTimeSent, 17) AS timesent FROM allog_07_11_e query1 When I do: SELECT left(DateTimeSent, 17) AS timesent FROM ...
0
votes
1answer
839 views

NULL values on MDX query (Total Column has Values)

I'm a novice with MDX, so sorry if I've missed something. (and sorry about my english too!) The following query: WITH SET [ROWMEMBERS] AS '{([BIN_SCH_INV_GRO].&[1]) , ([BIN_SCH_INV_GRO].&[...
1
vote
1answer
840 views

Group By part of a strings

I have a various date times stored as strings in my sqlserver database. 07/May/2012:00:01:49 07/May/2012:00:02:14 07/May/2012:00:02:26 This column is called datetimesent and it is quite easy to ...
4
votes
1answer
2k views

SQL Server Mirroring vs 3rd party replication products such as DoubleTake

I'm charged with looking after several SQL Server instances, most of which use SQL Server mirroring to replicate data for DR purposes. I automatically script logins, roles & jobs to the mirror, ...
2
votes
1answer
194 views

SSAS 2000 vs 2008 Cube processing times

I have been told that we can greatly reduce our processing times by rebuilding our 2000 cubes in 2008. I was told the difference is substantial (2hrs down to 20mins). Is this true? If so, why?
4
votes
1answer
583 views

SQL Server Partitioning - Parent / Child tables

I'm currently investigating implementing partitioning for a fairly hefty (800GB and growing) SQL Server database. All of the data in the tables is relatable to a date/time, however this date/time is ...
1
vote
0answers
43 views

Import CSV file into SQLServer [duplicate]

Possible Duplicate: Convert varchar column to datetime Hi I am using the SQL server Import wizard to import a CSV file into what will be a new table in my database. An example of the CSV file ...
10
votes
2answers
505 views

Is there a set based way to load/read a tree branch with HierarchyId

I am playing around with HierarchyId, and I have not figured out a set based way to do the following: insert all subtree at once retrieve all subtree at once This question is related to my ...
3
votes
1answer
7k views

moving large number of tables to different filegroups

An existing database has a large number of tables stored in the PRIMARY filegroup. I want to move theses tables and their indexes on different filegroups automatically, depending on the "prefix" of ...
5
votes
2answers
962 views

varchar performance impact

This question has been asked before ( speed impact of using varchar in MSSQL 2008 ), but the answers are not detailed enough to my satisfaction. Admitedly this is not a current issue and mainly for ...
10
votes
3answers
6k views

TSQL performance - JOIN on value BETWEEN min and max

I have two tables in which I store: an IP range - country lookup table a list of requests coming from different IPs The IPs were stored as bigints to improve lookup performance. This is the table ...
1
vote
2answers
78 views

Retrieve free data

Goal: Review data Problem: Where can I get a database with free data for SQL server? I need to review data to improve my ability as data analyst.
8
votes
3answers
2k views

Is it better to populate variables using SET or SELECT?

What is the better way (with regards to performance) to set a value to variable? By SET command: DECLARE @VarString nvarchar(max); SET @VarString = 'john doe'; SELECT @VarString; By SELECT command:...
4
votes
1answer
90 views

Issue with CAST using linked servers (possible bug?)

So I've got a some SQL Server 2008 DBs arranged in a star schema. Server A is the one users submit queries to. On Server A there is a DPV called Detection that's basically a UNION of table Detection ...
5
votes
1answer
3k views

SQL Server memory usage

I'm trying to understand more about the memory usage for SQL Server. I can't seem to figure out what's exactly stored in the memory buffer. My setup is a Windows Server 2008 x64, 8 GB RAM, ...
5
votes
2answers
8k views

Grouping records based on intervals of time

I have a table with the following schema, and I need to define a query that can group data based on intervals of time (Ex. records per minute) and then provide the sum of the changes to the ...
2
votes
1answer
829 views

Disabling Indexes and Auditing for large data import

Hopefully the title describes this sufficiently, but I have a process that runs and performs thousands of individual inserts and updates (nothing I can do to change that). My questions are: 1. Is it ...
0
votes
1answer
572 views

Stored Procedure is not returning complete result

I am using the query as mentioned in the answer accepted in the question located at Stored Procedure doesn't show result in SQL Server Now when I run this SP with the values provided in the ...
1
vote
1answer
172 views

Why is replication attempting to distribute NULL values into Identity columns

We are sporadically getting this error: Explicit value must be specified for identity column in our replication environment. I have checked the transaction command that is reporting the error and it ...
1
vote
1answer
2k views

how to set/change the font style in database?

This question may be duplicate with another but my question is this. I want to set or change the font style in header of table (like hindi font or any other) of database. I am using sql server 2008 ...
4
votes
1answer
942 views

How to query EndDate value from ReportServer..Subscriptions.MatchData

In SQL 2008 R2, I'm putting together some administrative queries on SSRS metadata to check proper configuration, and other sorts of proactive things. While querying the ReportServer db, I've been ...
2
votes
1answer
116 views

Associate a piece of data with a session

I think I want to associate a piece of data with each session. The association must have the following properties: The data being associated is provided either as a part of connection string (if ...
1
vote
1answer
381 views

Send a trigger to an application upon a specific SQL Server server usage pattern

I've been dealing with a vendor's unconfigurable application which is, unfortunately, the most feature-complete in its niche. I'm looking to augment its capabilities with on-top screen display. Its ...
4
votes
1answer
217 views

Filtered index statistics refresh threshold

We have filtered indexes in our production environment. While doing some research about them, I came across this article "Filtered indexes and filtered stats might become seriously out-of-date" It'...
2
votes
1answer
824 views

Stored Procedure doesn't show result in SQL Server

I have created a stored procedure (to be used in SSRS) that has parameters whose values are more than one. When I execute this stored procedure in SSMS by providing the values for that parameter, SP ...
3
votes
1answer
5k views

Memory utilization per database - SQL Server

I am trying to find the memory utilization per database(using dmvs) in a sql server instance, ie (Buffer Cache + Procedure Cache) over a period of time. I have the query to get the buffer cache ...
8
votes
5answers
9k views

Does SQL profiler affect server performance?

I am facing a problem where the sql server 2008 fails for some high load. I need to find that load case and need to optimize the code so that it can handle the load. I have found on the internet that ...
2
votes
1answer
4k views

SQL Server 2008 R2 64bits repair error

I had to reinstall the default server instance on one Windows 2008 R2 server. I checked that the sql groups were cleaned and the registry keys cleaned before reinstalling. After reinstalling, the ...
44
votes
4answers
14k views

What are Objective Business Reasons to Prefer SQL Server 2012 over 2008 R2?

My company is facing the decision whether to purchase SQL Server 2012 Denali or SQL Server 2008 R2 for a new database server. I am looking for objective reasons to choose one over the other. Our ...
4
votes
3answers
16k views

Slow insert in SQL Server 2008

Our products' database contains an audit trail table: CREATE TABLE gn_AuditTable( gn_ObjectId int NULL, gn_Action smallint NULL, gn_Time datetime NULL, gn_UserId int NULL, gn_Login ...
4
votes
1answer
2k views

Sum values at a group level rather than detail

I have an invoice report I'm developing for some project billing. The main tablix has several groups, in this order: ProjectGroup TicketGroup NoteGroup Details (actual billing details) The data ...
1
vote
1answer
852 views

Can you rename or name Reporting Services jobs?

In Report Manager you can create schedules, either shared or one-of's. When you create these schedules a job is created in SQL Server with names that look like guids. IS it safe to rename these jobs ...
1
vote
1answer
5k views

Clarify - Need to add Multiple foreign key constraints

I am not sure if I am thinking about this process the wrong way. Just to Surmise if I create a table(TeamList) whose sole purpose is to capture the coaches team list of players and positions for a ...
3
votes
3answers
4k views

View foreign key constraints so I can delete a table

I have copied a database I was working on so I could change some key elements of its design for my new version. I want to delete totally some tables from the database however I cannot due to some ...
1
vote
1answer
818 views

Why do I see sp_OACreate, sp_OASetProperty in sp_WhoIsActive?

I've seen this happen a few times: sp_WhoIsActive shows various sp_OA% sprocs, with my user name, but I'm certainly not running them directly. Does this reflect some kind of query rewrite process? ...
2
votes
1answer
562 views

Can you rename replication jobs?

I have snapshot replication running on three different servers, two publishers and one subscriber. The replication processes have associated jobs (either building the snap shot or grabbing the snap ...
6
votes
1answer
764 views

Including clustered index key in non-clustered index

We're running SQL Server 2008. In looking over the results of a query I ran on sys.dm_db_missing_index_* views, I see a curious suggestion for an included column. I have the following two tables: ...
3
votes
1answer
608 views

querying a linked PostgreSQL database in SQL Server 2008

We will be deploying an application with a Postgres back-end and need to provide report writing capabilities in SQL Server. I am exploring options for real-time or near real-time reporting in this ...