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

learn more… | top users | synonyms (1)

-1
votes
1answer
31 views

Issues with procedures, setting multiple values

I am trying to set multiple values but I am only able to set one value. This code fails: alter procedure modifyvalue @ID int, @flight varchar(6), @destination char(10) as begin update ...
1
vote
2answers
72 views

Insert Missing Dates from a query

How can i insert missing dates from a query i created. The result below: Date Frequency 2014-05-18 5 2014-05-20 7 2014-05-25 7 2014-05-27 6 I want the result to have missing ...
1
vote
1answer
132 views

View the order of triggers firing

We have 2 SQL Server 2008 environments with some triggers against a table containing business logic Within the 2 environments, we can see that the triggers are firing in a different order (thanks to ...
0
votes
2answers
59 views

Calculate Time difference between a datetime format with the current datetime

Hi I would like to calculate the difference between a past datetime with the current datetime with the result as a [hh]:mm format.
1
vote
1answer
38 views

SQLDriverConnect fails when attempting to connect to Failover_Partner

SQLDriverConnect fails when attempting to connect to Failover_Partner. Connection string being used: Driver={SQL Native Client};Failover_Partner=tcp:dby;Server=tcp:dbx; ...
0
votes
1answer
46 views

deleting a table referenced by many foreign keys

I have a table that I want to drop and create again, because I want to add the IDENTITY property to a column, wich is not possible directly. The problem is that I can't drop it, because my column is ...
0
votes
2answers
50 views

Check Constraint with Case Statement

I want to add a check constraint on a column if entered value for column is greater than 3 than it should be saved as 1 else entered value. For that scenario I am using below query but on insertion of ...
0
votes
0answers
28 views

Update existing (old) rows vs delete and insert when needed

I'm building a database system that needs to store login tokens for a system that validates if a users login token is valid or outdated. The table is pretty simple UserID int Primary Key LoginToken ...
0
votes
0answers
30 views

sql server grants access to specific login to database [closed]

i have created website for intranet and hosted it on server. for that i needed to create login "IIS APPPOOL\hi" in sql server 2008 for my application to access my "reportdb" database. "IIS APPPOOL\hi" ...
0
votes
0answers
54 views

Will SQL Server 2014 not cause problems with a SQL Server 2008 DB?

I will be doing development work on a database created in SQL Server 2005 that will be moved to SQL Server 2008. I have no problems moving them; I've done it before and it's always been painless ...
0
votes
0answers
20 views

SQL Server 2008 ENT + add SSL to Named Instance (not default)

Need to know if anyone has seen or knows how to load an SSL Cert for a named instance in SQL Server 2008 or above? I have loaded many on the default instance but not on a Named Instance. Go through ...
0
votes
1answer
27 views

Count Function with Aggregate function inside the query

Hi my actual code is below: Select M.TicketID,M.CreatedMoment, Max(L.StatusChangeMoment)AS StatusChangeTime, Elapsed_time_in_Hours_Minutes = CONVERT(NUMERIC(18,2),DATEDIFF(minute, M.createdmoment, ...
1
vote
1answer
67 views

Best approach for populating date dimension table

I am looking to populate a date dimension table in a SQL Server 2008 database. The fields in the table are as follows: [DateId] INT IDENTITY(1,1) PRIMARY KEY [DateTime] ...
-3
votes
0answers
14 views

what is inventory cleansing and data cleaning? [closed]

Can anyone tell me the complete process of inventory cleansing and data cleansing in a data base?
0
votes
0answers
60 views

Stored Procedure's Commented line causing issues [closed]

We have a stored procedure which works as the sample mentioned below: CREATE PROCEDURE [dbo].[sdp_Test_Update] ( @ID int OUTPUT, @File_ID int, ...
1
vote
3answers
40 views

Can set unique constraint in table have data not unique SQL Server? [duplicate]

I have a table with has many rows, I want to set unique constraint for this table, but the column that must be unique, has data is not unique. Is any way to set unique constraint for this table for ...
2
votes
3answers
289 views

How to pull rows only from the weekends?

My table data is like this: ID Name salary date 1 a 100 1/08/2014 2 b 200 2/08/2014 . . . . 26 z 2600 26/8/2014 Now I want to return only rows from Saturday or ...
0
votes
2answers
46 views

Is there a way to do a textual search through all stored procedures in a table?

I've just inherited a database with a number of tables and stored procedures. I use Microsoft SQL Server Management Studio. One, or possibly more, stored procedures update a specific table. If the ...
1
vote
1answer
43 views

Cursors and concurrent users

I typically avoid cursor operations like the plaque, however, I have come across my first problem where using a cursor outperforms a query. So I am forced to use it. I have created an elaborate ...
1
vote
1answer
92 views

Pre-formated varchar variable does no work in select query

I am trying to run a select query that receives in the where clause the @Sites variable. The query at the moment is returning empty because the following line AND S.[Name] IN (@Sites) is not being ...
1
vote
1answer
39 views

Group by alternative [closed]

I have a table , that has a generic set of actions for EVERY user. However if there is a user that needs to have a unique action, that replaces an existing action, then in my query, I want to ...
4
votes
1answer
93 views

Why is SQL Server's online indexing causing blocking?

My understanding is that online indexing acquires locks at the beginning (Preparation) and end (Final) phases. However, we see a lot of DML queries blocked during the Build phase. A sampling of the ...
0
votes
1answer
45 views

Delete from table where not in another table using two columns

I am trying to get my head around this delete statement I am trying to accomplish. I understand how to delete from table where column not in ( subquery to table2) I have two tables with multiple ...
1
vote
0answers
53 views

A query that does a lot of reads, but plan is OK [migrated]

I´m experiencing a strange behaviour in a specific query in the SQL Server 2008 R2. I´ve got a query that does 19 million reads and is very time-consuming and when I try to check its cached plan, the ...
0
votes
1answer
47 views

How to generate replication snapshot without locking tables

When I reinitialize subscription and generate new snapshot it locks all tables and makes the database unusable for a very long time (never waited it out). Is there anyway to do this without locking?
0
votes
0answers
36 views

Subscription fails with Incorrect syntax near '9'

In my Distributor To Subscriber History I get the following error: Command attempted: 9 (Transaction sequence number: 0x0018E94F0000207A006200000000, Command ID: 59) Error messages: ...
1
vote
0answers
37 views

Update on a small table times out

We use Microsoft SQL Server Express Edition with Advanced Services 2008 R2 SP2 We have two locations. Each location has one sql server that serves about 20 client computers. Client computers are ...
1
vote
2answers
265 views

How can I hunt down what is trying to use SA?

I'm not sure of the change that caused this (the logs don't show anything specific) but ever since Monday afternoon I've seen the following error repeated: Login failed for user 'sa'. Reason: An ...
1
vote
2answers
50 views

TempDB will not shrink. No Open Transactions

I have a TempDB on SQL 2008 that has gotten very large (>40gb) and I want to shrink it down. I have used the dbcc shrinkdatabase, dbcc shrinkfile and the shrink command through Management Studio. I ...
2
votes
1answer
58 views

size of a primary key and foreign key

Do a primary key and a foreign key referencing it must have the same column size in sql server 2008 ? could someone indicate me a link to a documentation explaining this ? Thank you for help.
-4
votes
1answer
36 views

How to run mssql server dependent application to mysql workbench [closed]

I am very new in mysql workbench. I have created an application in c# which uses sql server 2008 r2 database. Now i have migrated my database on mysql workbench. i want to run my application now. My ...
0
votes
2answers
55 views

can we transfer sql database backup from one server to another server directly?

I want to transfer sql database from one server to another server directly, instead taking back up of that database and copy that back up in another server and then restore it. Please tell me, Is ...
0
votes
0answers
28 views

Sql Server Agent Job

In my Local SQL Server 2008 I created a scheduled job (like daily email will send to particular user from the database based on condition). Now I decided to host my schedules in hosting server so can ...
1
vote
3answers
103 views

How to separate Stored Procedures (i.e. all the business logic) from Client Database so that it only contains client data?

Scenario: Our Application Database (in SQL Server 2012) contains entire business logic in the Stored Procedures (SPs). Everytime we have to publish the DB to the client, it unnecessarily results in ...
1
vote
0answers
25 views

Cross Server and Instance Login SSIS SID or ID Issues

I have some challenging login/SID/ID issues with authentication between databases on separate instances and servers. We have a Development, Test, Pre-Production and Production server/instance ...
0
votes
0answers
21 views

Good pattern to run SQL Server 2008 CDC changes

I have CDC working on my server and it works well. I have followed various tutorials etc... I'm looking for the best way to write a SQL stored procedure that will continuously give me the latest ...
5
votes
2answers
340 views

Index seek much slower with OR condition compared with separate SELECTs

Based on these questions and the answers given: SQL 2008 Server - performance loss possibly connected with a very large table Large table with historical data allocates too much of SQL Server 2008 ...
0
votes
1answer
71 views

Update primary key column - NULL issue

I want to update a column that is a primary key using this code use BITS_TEE Update DMT_TEE_DTS_Production set ABCIndicatorCode = ( select HIST.ABCIndicatorCode from ...
1
vote
1answer
70 views

Change rowguidcol property to a different column

In my SQL Server 2008 database, I have a table with two uniqueidentifier columns. CREATE TABLE MyTable ( Col1 uniqueidentifier rowguidcol not null, Col2 uniqueidentifier not null, ...
3
votes
3answers
110 views

Adding non-nullable NEWSEQUENTIALID() column to existing table

In SQL Server 2008, I am adding a non-nullable column to an existing table, and want to make the default NEWSEQUENTIALID(). ALTER TABLE MyTable ADD MyColumn UNIQUEIDENTIFIER NULL CONSTRAINT ...
0
votes
2answers
63 views

Reading Data from SQL Server database

I want to read data from each cell of database. If the corresponding value is encountered then I have increment a variable count for that corresponding variable. Consider the following table Ques1 ...
1
vote
4answers
160 views

Large table with historical data allocates too much of SQL Server 2008 Std. memory - performance loss for other databases

Based on this question and the answers given: SQL 2008 Server - performance loss possibly connected with a very large table I have discovered memory allocation problem with SQL Server 2008. ...
0
votes
1answer
34 views

RaiseError on SQL Server stored procedures

ALTER PROCEDURE sp1 as begin IF (@PersonId=0) RAISERROR(N'Error already raised. See previous errors.', 16, 1); break end I want something like the following. If no value in the variable, ...
0
votes
0answers
44 views

Replication saying my snapshot Publication Does Not Exist. But it does exist

enter code hereI used the SQL Server (2008) wizard to create a new snapshot publication on my sever called "BlinkViewsOnly" in the BlinkDataMaster database. Publication was created successfully. I ...
1
vote
0answers
50 views

sqlcmd returning NUL instead of NULL for tinyint column

sqlcmd -E -d MyDatabase -Q "sp_helpsubscription" -s "," -o file.csv -W -u Column 23 which is suppose to be a tinyint (subscriber_type) is output as NUL instead of NULL when the value is NULL. I ...
0
votes
0answers
57 views

SQL server replication error - the row was not found at the Subscriber

I am doing transactional replication on specific tables. I am getting an error: The row was not found at the Subscriber when applying the replicated command. (Source: MSSQLServer, Error number: ...
7
votes
6answers
1k views

Estimate projected database growth

I recently started working with SQL Server 2008 as a DBA trainee. I need calculate the size of the database but also estimate its growth over recent months and the predicted growth for the next 12 ...
1
vote
2answers
185 views

SQL 2008 Server - performance loss possibly connected with a very large table

Migrated from http://serverfault.com/questions/615129/sql-2008-server-performance-loss-possibly-connected-with-a-very-large-table We have SQL Server 2008 with 3 active databases running on it. DB1 ...
0
votes
3answers
71 views

How to display posted on date and time like1 hr ago or 30 min ago

i want to show the posted date like 1 hr ago.. or 30 min ago.. declare @date datetime ='2014-07-24 11:50:22.033'; SELECT CASE WHEN DATEPART(DD,@date)=DATEPART(DD,GETDATE()) THEN CASE WHEN ...
0
votes
3answers
59 views

Matching two rows in a single table if two specific keys have different values

I have a table called settings in that there are two columns and data like following. settings value ------- ------ depots 12 projectid 156 client ...