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

learn more… | top users | synonyms (1)

0
votes
0answers
5 views

Linked Server from SQL Server 2008 to Oracle not working

I have tried to make a linked server from SQL server 2008 to Oracle Server. I have successfully made a Linked Server from another machine to that oracle server but the one I'm making on my machine ...
2
votes
1answer
179 views

Why dropping all foreign keys from a script is not working? [closed]

I have sysadmin rights on a SQL Server 2008 R2 box. I found a script that can drop all foreign keys and re-add them for us when we need to after a testing import. So I execute the below code with no ...
0
votes
1answer
88 views

How to schedule jobs in Sql server 2008 for less than 10 sec?

I want to run a job every 3 seconds, however in SQL Server 2008 we cannot define an interval of less than 10 seconds. The job is used to insert/update visitor information, and segmentation ...
0
votes
2answers
59 views

Auditing the View Server State permissions on Server

We noticed that one of our servers has permissions granted to "all" users for "view server state". I am wondering if there is a way to audit the DMV's used by the user(s) on a regular basis as this ...
0
votes
0answers
25 views

SQL named instance cannot be connected by a specific user

SQL server 2008 R2. It has default instance running and a couple of named instance. - I can connect to both default instance and named instances. - User can connect to default instance but he is not ...
1
vote
0answers
40 views

What will do After Press F5? [closed]

select * from Employee; Name id Col1 Col2 Row1 1 11 1 Row2 2 12 3 Row3 3 13 30 Row4 4 14 44 Above is my table After PRESS F5 What process is running in Background ...
0
votes
1answer
43 views

How to choose suitable naming convention for Dimensional Table Column in a Data Mart?

I have done a lot of reading on naming columns for use in a data mart / data warehouse, as well as for general programming usage. For example, if I had a business branch in a normal application I ...
0
votes
1answer
49 views

How do I backup/restore database encryption key in order to restore on new server

I am currently in the process of restoring a TDE encrypted database to another instance. I have backed up master key and certificate, and have restored them to the new server fine, but I am still ...
1
vote
1answer
98 views

AWE to allocate memory in SQL Server 2008 Express with Advanced Services

I am running SQL Server Express Edition with Advanced Services on Windows Server 2008 Enterprise 32 bit OS. I have enabled "Use AWE to allocate memory" on the SQL Server, but I am not sure if this ...
0
votes
0answers
23 views

Import from one table in two tables where I need the auto-generated primary key in the second table

followning scenario: 3 Tables 1 Table name,street,country,bank This table needs to be imported to Table1 Address(Primary Key Autoincrement ID),name,street,country Table2 Address,bank So I need ...
0
votes
1answer
68 views

How can I reseed all identity columns?

I deleted all rows from 20 tables after disabling the constraints, triggers using the stored proc SP_MsForEachTable. Now before the import happens, I need to reseed all the identity columns back to ...
1
vote
1answer
59 views

SQL Server 2008 R2 - Access Failure in a query that uses Linked server

We have 2 SQL Server 2008 R2 machines. A user is running a query on Server A that joins a table in Server B. In the query he is using linked server to point Server B. User has access to Server B ...
1
vote
2answers
46 views

Merge Table Row Values to Header of Another Table

Table 1 id | Field | Values ---------------------------------------- 1 | 'Field01' |Name 2 | 'Field02' |Age 3 | 'Field03' |Gender 4 ...
0
votes
1answer
40 views

export and import all the permissions on schema objects within a database SQL Server 2008

Is it possible to export all the users roles and their permissions on schema objects within a database in a .sql file and import them later in an other database ?
1
vote
1answer
43 views

How Does Max Server Memory Affect PLE on a Host That Is Not Memory Bound?

I came across an unusual scenario on an instance where only half the physical RAM was being utilized but I was observing PLE values between 1-3 seconds constantly. Windows Server 2003, Enterprise ...
1
vote
1answer
118 views

Operand type clash: my first User Defined Type with list of Integers, how to test via SSMS

I found this wonderful code here CREATE TYPE [dbo].[StringList] AS TABLE( [Item] [NVARCHAR](MAX) NULL ); GO CREATE PROCEDURE [dbo].[sp_UseStringList] @list StringList ...
1
vote
2answers
48 views

Merits of inserting to temp table and renaming versus just adding/removing columns

If I add or drop columns from a SQL Server table I presume I get page splits or gaps. Since the size of the row has changed. When I use RedGate SQL Compare to create conversion scripts its strategy ...
1
vote
1answer
73 views

SQL Server 2008 logging [closed]

We have a SQL server that has been hardening per government STIGs. Right now we are generating almost 10GB of Transaction log every day. (run sharepoint and some other applications). I'm trying to ...
2
votes
1answer
148 views

Find if Column Belongs to User Table

I want to compute the number of columns with not null constraint in my database. So I thought about querying the table sys.all_columns: select * from sys.all_columns The problem is that it ...
0
votes
1answer
24 views

equivalent of oracle sql administration query in SQL Server 2008

I'm new to SQL Server administration, and I would like to get the equivalent of this Oracle 9i administration query : select object_type,count(*) as number from all_objects where owner='ownerSID' ...
0
votes
1answer
24 views

Need to Display Query Result without Null Values in one column

I created a query which produced four column result, I wanted to display result in which the Outstanding column > 0. My query below: SELECT CAST(xx_master_tickets.CreatedMoment AS DATE) ...
0
votes
1answer
47 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 ...
-1
votes
1answer
34 views

Issues with procedures, setting multiple values [closed]

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
95 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
148 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
24 views

CREATE DATABASE permission denied in database 'master'. unable to get the permission

I am making a database in sql server and it shows an error that "CREATE DATABASE permission denied in database 'master'" I am using the administrator log in itself. What i need to do? Please suggest a ...
0
votes
2answers
118 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
75 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
65 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
98 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
33 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
65 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
26 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
39 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
212 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] ...
1
vote
3answers
67 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
301 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
49 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
57 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
120 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
46 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
106 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
52 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 ...
0
votes
1answer
99 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
62 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
53 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
276 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
105 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
91 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
56 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 ...