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

learn more… | top users | synonyms (2)

14
votes
5answers
5k views

Possible attack on my SQL server?

Checking my SQL Server log I see several entries like this: Date: 08-11-2011 11:40:42 Source: Logon Message: Login failed for user 'sa'. Reason: Password did not match for the login provided. ...
3
votes
1answer
700 views

Is it possible to make a reference to the result of an aggregate function in a SELECT clause from the same SELECT clause?

I'm not a Database Administrator--just a Software Engineer. I would like to know if it is possible to reduce the following T-SQL query: SELECT SUM(Price * Quantity) as 'Total', SUM(Price * ...
1
vote
2answers
2k views

SQL Server Fulltext search against big amount of search terms over some period of time

I've got a task where I must do a fulltext search in SQL Server 2008 against big amount of search terms (30-60 search terms) combined with OR. Some search terms may have partial match (asterisks at ...
6
votes
1answer
526 views

Is there a way to DENY CRUD operations on connections from linked server?

I have a SQL Server instance, RPT1 (2008 R2), that was set up for "power users" to run their own queries. This server is linked to our production reporting server, PRD1 (SQL Server 2008 instance), ...
2
votes
1answer
486 views

Greater than operator ignoring a nonclustered index?

I have a pretty simple query in SQL 2008 R2 and I have a nonclustered index on the "sDate" datetime column. When I look at the execution plan for the following query it seeks the nonclustered index. ...
4
votes
1answer
1k views

Does SQL Server evaluate functions once for every row?

I have a query like this: SELECT col1 FROM MyTable WHERE DATEADD(dd, 0, DATEDIFF(dd, 0, GETDATE())) BETWEEN col2 AND col3 ; This gives a tooltip on the execution plan ...
15
votes
1answer
29k views

Varchar(Max) field cutting off data after 8000 characters SQL Server 2008

I have a field to store some data, the field is declared as varchar(Max). To my understanding this should be storing 2^31 - 1 characters but when I enter some content over 8000 chars it cuts the rest ...
2
votes
1answer
4k views

Configure second SQL Server Alias for named instance

In my devopment environment (Win 2008 server) are running two sql server 2008 instances (default and named instance). Already one Sql alias is configured and pointing to the default instance. I want ...
4
votes
2answers
658 views

Using surrogate key after merging the person's data?

This question is about business intelligence with sql server 2008 R2. If you have a person named Jim Brown with his birthdate and social security number (SSN) being located in three different source ...
2
votes
1answer
3k views

Output into temporary table

I am trying to create a procedure that will generate an xml document of a given table whilst updating the information in said table. My procedure does not recognise the use of the temporary table ...
6
votes
1answer
2k views

SQL 2008 R2 - Odd timeout issues

I'm having some recent timeout issues in our SQL 2008 R2 server. This started occurring late last week and has since somewhat improved. Issues: When using SSMS and right clicking over a ...
1
vote
1answer
199 views

Splitting a table based on business logic

This is mostly a design question and I'm looking for any feedback about the merits or flaws of this approach. Typically, I break database design into two categories, Business Logic and Recorded Data. ...
2
votes
1answer
1k views

Processing occasionally fails with “Unexpected end of file has occurred.”

I've got an Analysis Services database that's used for reporting on email activity. It mainly counts incoming and outgoing messages, who they're to and from, etc. Fact table: 11,367,910 rows Address ...
3
votes
1answer
8k views

Can I grant a user ALTER TRACE permission to a single database?

I have a development user who requires the ability to use SQL Profiler on a single database. Is there a way to enable this without granting a server-wide ALTER TRACE permission? (The user should not ...
2
votes
1answer
917 views

How would you implement conversation groups/ locking for multiple users of a Service Broker Queue?

How do you implement conversation groups for multiple users using their own instance of the user applications but sending related messages to the service broker queue? Any good example of this kind ...
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
602 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
245 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
30k 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
282 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
209 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
319 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
616 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
163 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
804 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]) , ...
1
vote
1answer
812 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
193 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
562 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 ...
10
votes
2answers
497 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
6k 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
933 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
77 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 ...
4
votes
1answer
88 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, ...
15
votes
3answers
4k views

Anybody using HierarchyId in production? Is it reliable?

Is anybody using HierarchyId in real production with tables of reasonable size, more than a few thousand rows? Is it reliable/performant? So far I have not found anyone not affiliated with the vendor ...
5
votes
2answers
7k 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
803 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
549 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
165 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
1k 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
894 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 ...