Microsoft's SQL Server is a relational database management system (RDBMS) that runs as a server providing multi-user access to a number of databases. It originated from the Sybase SQL Server codebase, which is why both products use the extension of SQL called Transact-SQL (T-SQL).

learn more… | top users | synonyms (2)

1
vote
2answers
549 views

Are there any reasons not enable SQLCMD-mode as default in SSMS?

I don't consider "just to ensure that sqlcmd-mode is not required by a script" a valid reason. Any things to think of before giving the order to enable this setting to my coworkers?
2
votes
1answer
337 views

Error When Restoring Log

Here is the situation. I have restored a database to replace an existing version (need to get it back to yesterday at a certain time). So I do a RESTORE DATABASE ... WITH NORECOVERY, REPLACE, etc... ...
0
votes
2answers
848 views

Create an Audit trail on SQL Server 2008 to trace all privilege users

I need to create a trace of all the commands issued by members of SysAdmin or SecurityAdmin server Roles. I figured, I could use Profiler to do that but it will not comprise all the added members. I ...
2
votes
2answers
156 views

SQL Server Timeout: Gathering server side information

We use SQL Server 2008 for our database. We use a combination of Classic ASP and .NET to connect to said database. We get random timeouts on queries that are extremely simple and when we run said ...
14
votes
3answers
8k views

Efficient INSERT INTO a Table With Clustered Index

I have a SQL statement that inserts rows into a table with a clustered index on the column TRACKING_NUMBER. E.G.: INSERT INTO TABL_NAME (TRACKING_NUMBER, COLB, COLC) SELECT TRACKING_NUMBER, COL_B, ...
4
votes
1answer
1k views

Remote queries at SNAPSHOT isolation level

I'm experimenting with snapshot isolation level. Whenever I try to access a linked server, I get an error: Remote access is not supported for transaction isolation level "SNAPSHOT" I wasn't able ...
3
votes
2answers
263 views

switch TOP clause between percentage and rows by parameter

For one report I am making query where users suppose have to choice TOP values based on percents or fix amount of rows. I have two ideas Calling two different sub sproc based on passed param. if ...
1
vote
4answers
4k views

How do I archive and restore selected tables using SQL Server?

How do I archive and restore selected tables using SQL Server?
1
vote
3answers
1k views

Can I Simply Change A Transaction Log From Unrestricted to Restricted?

I've got a database with a data file size of 674 MB and a transaction log of 6.1 GB. The transaction log is about 10 times bigger than the data file.The transaction log settings can be seen in the ...
1
vote
1answer
66 views

Any general reasonable performance tests for DBs on application server and DBs on separate server?

My company are planning to move the DBs (SQL Server 2008 R2) from the application server to another server (random distance). All servers are Windows 2003 x86. Are there any general performance tests ...
4
votes
3answers
3k views

How to make conditional ordering for two or more columns

IN MSSQL 2005 I am writing one query with conditional sort and my problem is I do not know how I can sort condidional using two columns. if i wrte code like this it is working normaly select * from ...
1
vote
1answer
1k views

How can I query the SQL Server Compatibility Level into a variable?

I know to query the current Compatibility Level of a database with declare @dbname sysname select @dbname = db_name(0) exec sp_dbcmptlevel @dbname But this seems to return its result via print and ...
5
votes
3answers
1k views

Run several commands against data in text file (SQL Server 2008 R2)

I'm new to this website so forgive me if I'm asking a rudimentary question and/or one that's been asked 100 times before. I wasn't able to find an answer during my searches here. I'd like to have my ...
1
vote
1answer
754 views

Set statistics time showing different elapsed_time than dm_exec_query_stats view

When I exec a SQL statement after setting set statistics time on and running dbcc freeproccache and dbcc dropcleanbuffers I get the following output: DBCC execution completed. If DBCC printed error ...
1
vote
7answers
993 views

Implement Database Security?

I want to implement a database security on the database i created so no one can access it from SQL Server Management Studio, and that it will be only accessible through code. Is that possible? and if ...
2
votes
1answer
876 views

Maintenance Plan fails but the query it generates Runs

I have an SQL Server 2005 Enterprise Edition whose Maintenance plan fails constantly with the error: backup MYSERVER (MYSERVER) Backup Database on MYSERVER Databases that have a compatibility level ...
5
votes
1answer
329 views

Does sql server calculate views every time when someone query the views?

I wonder whether sql server calculate views every time when someone query the views. It is because everytime I query the views, it take such a long time. And when I tried to shorten the time by ...
1
vote
1answer
320 views

Fail to connect to server

I am getting this error when attempting to connect to a SQL Server 2008 R2 machine: Cannot connect to JUPITER. A network-related or instance-specific error occurred while establishing a ...
10
votes
4answers
647 views

Inaccurate 'Actual' row counts in parallel plan

This is a purely academic question, in so much that it isn't causing a problem and I'm just interested to hear any explanations for the behaviour. Take a standard issue Itzik Ben-Gan cross-join CTE ...
2
votes
2answers
2k views

Access Linked Server error “The provider did not give any information about the error.”

A little information. I'm running SQL SERVER 2008 R2 64bit. I have Microsoft.ACE.OLEDB.12.0 provider installed. On my production server I've setup a linked server to the access db using the provider ...
5
votes
1answer
230 views

Where is the information about what files each database stored for SQL Server 2008 R2

I need to find where SQL Server 2008 R2 stores what files back each database. The kicker is that the server has completely crashed (hardware failure). I've managed to recover all the .mdf/.ldf files. ...
3
votes
2answers
3k views

What is SQL Server Parallel Data Warehouse?

What is SQL Server Parallel Data Warehouse solution? What is the benefit of PDW compared to normal DW architecture based on SQL Server and SSIS, SSAS and SSRS?
1
vote
1answer
564 views

Exporting from SQL Server 2005 for import into ER Studio 9.0

I am new to ER Studio and need to create an ERD for a remote system. That system can only be accessed by LogMeIn remote control and by FTP. The remote system is running SQL Server 2005. The local ...
5
votes
1answer
6k views

Receiving “The SELECT permission was denied on the object” even though it's been granted

I'm a programmer, not a dba... I know just enough to be dangerous. I've inherited a database with a legacy user that is a db_owner for the database. We can't adjust this user's permission for ...
3
votes
3answers
5k views

How to avoid index scans in SQL Server 2005?

I have a table named Cell which has columns like Cell_ID, CellValue and CellRow. Cellrow can have values maximum 1 to 5. There is a clustered index on Cell_ID field. This table contains 100000 rows. ...
12
votes
5answers
5k views

Does restarting SQL Server speed it up?

I have noticed that some DBAs restart SQL Server very frequently, sometimes even nightly. I believe they do it to free up some memory, or perhaps to speed up queries too. I know that after a restart ...
2
votes
1answer
4k views

Comparing DISTINCT, GROUP BY and ROW_NUMBER() in SQL Server 2008 with data warehouse workloads

I recently heard the advice: "If you're using DISTINCT, I challenge you to fix your code." However, I'm wondering what considerations are behind this advice, and whether it means that I should ...
0
votes
2answers
2k views

The OLE DB provider “SQLNCLI” for linked server X reported a change in schema version between compile time X and run time X for table [tablename]

The below error starts happening once a week at the same time every week. The OLE DB provider "SQLNCLI" for linked server X reported a change in schema version between compile time X and run time X ...
3
votes
1answer
8k views

Local login impersonation not working with a linked server

I have created a linked server on my server using the following: exec sp_addlinkedserver @server=N'MyOldDB', @srvproduct=N'', @provider = N'SQLNCLI', @datasrc=N'MYSERVER', ...
4
votes
3answers
1k views

Which options to enable to guarantee full recovery in SQL Server Express 2005?

I am using SQL Server 2005 Express Edition. I noticed that Recovery Model is set to Simple, by default. I changed this option to Full but want to know which other options to enable to guarantee ...
6
votes
5answers
5k views

Auto-Commit in SQL Server and Oracle

When I worked on Oracle 8 many years before, I used to execute COMMIT command manually after each bulk INSERT. In SQL Server, Auto-Commit is ON by default which has advantages as well as hazards. I ...
6
votes
2answers
3k views

Recover accidentally deleted rows from a table

My client has accidentally deleted all the records of a table from a test database. This test database is in SQL Server 2005 Express and we don't have a backup. Is it possible to restore the deleted ...
1
vote
2answers
6k views

SSIS Script Component - How to modify the Output0Buffer

I've a script component which accepts records from SQL Azure database table. The script then invokes a web service, which returns the number of failed and success records. For all the records, I ...
3
votes
1answer
1k views

Are there disadvantages to using Full-Text Search in SQL Server?

Are there disadvantages to using Full-Text Search in SQL Server? Is there much of an increased CPU or memory load on the server?
2
votes
1answer
378 views

How often do you back up the distribution database for transactional replication when sync with backup is set to true for the distribution database?

I'm trying to figure out how often to back up the distribution database when "sync with backup" is set to true. If I understand this correctly, sync with backup ensures the distribution database can ...
4
votes
2answers
1k views

Read-only copy of SQL Server database

We have main database, through out day we insert/update this DB through main application(windows). We have another web application which is suppose to just display content from main DB but instead we ...
3
votes
1answer
338 views

“SELECT TOP N” returns the wrong results

Supposing I have a table foo similar to: ident int, primaryKey, auto_increment someNumber int statusId int ... where the someNumber column is, except for a few special cases, equal to ident. (in ...
2
votes
2answers
885 views

AUTO_UPDATE_STATISTICS and FULLSCAN in SQL Server 2008 R2

Is it possible to force FULLSCAN when statistics are updated automatically by SQL Server 2008 R2? If not, is a planned UPDATE STATISTICS WITH FULLSCAN the best way to keep statistics up-to-date? ...
4
votes
6answers
2k views

SQL Server: why to use a backup device?

When taking backups from databases, is it "good practice" to use logical backup device for backup location? What is the benefit of using backup devices?
4
votes
4answers
9k views

MySQL vs SQL Server Express (Compare Free DBMS)

I am searching for a comparison table between MySQL and SQL Server Express. Comparisons should include... Usage limit Tools (management/dev/backup/monitoring/...) "simultaneous connection" It's ...
8
votes
3answers
3k views

How to stress test a SQL server?

I've been tasked to stress test our MSSQL Server and MySQL Server. I would like to know if there are any tools or scripts which I could use on our current systems and the new system to compare ...
1
vote
2answers
631 views

SYMMETRIC key & certificates role in sql server?

1) CREATE SYMMETRIC KEY SecureSymmetricKey WITH ALGORITHM = DESX ENCRYPTION BY PASSWORD = N'StrongPassword'; I'm trying to figure out about the sql Server encryption. once ive executed ...
3
votes
1answer
660 views

SQL Server symmetric key & certificates games by Hacker?

1) CREATE SYMMETRIC KEY SecureSymmetricKey WITH ALGORITHM = DESX ENCRYPTION BY PASSWORD = N'StrongPassword'; I'm trying to figure out about the SQL Server encryption. once I've executed ...
2
votes
1answer
1k views

Is this a good way to store XML data in SQL SERVER 2008?

I'm doing a feasibility study for storing data in the following structure with SQL SERVER 2008: -MYTABLE |ID|RECORDS|BRANCH_OFFICE|MONTH|YEAR The RECORDS column has the XML data type and it will ...
5
votes
2answers
2k views

SQL Server - Tempdb data/log file placement

Currently we got TEMPDB Data (number of data files:2) and LOG file on same drive. On monitoring we have found I/O issues on TempDB. We got an extra drive available - should we move the TempDB Log ...
0
votes
0answers
116 views

how do i bulk copy a huge amount of data and keep the same table updated through stored procedure in SQL SERVER [duplicate]

Possible Duplicate: How to move data from big table In my project i need to fetch datas from different tables in a data base and create a new table with the same colmn names for all those ...
9
votes
2answers
955 views

INT or CHAR for a Type Field

What is the best design for a table, a Type field that is of int or char(1)? In other words, given this schema: create table Car ( Name varchar(100) not null, Description varchar(100) not ...
3
votes
3answers
3k views

How to move data from big table

There is a big table (5-6 million records). I have to move 90% of old records to other database(table). Solution?
1
vote
1answer
577 views

powershell to connect to SQL and display a friendly message when it cannot connect

We check our SQL servers using powershell. The script goes through all servers in a text file and sends the output to a text file when it can connect. But when it cannot connect, it displays error in ...
11
votes
0answers
1k views

Passing array parameters to a stored procedure [duplicate]

Possible Duplicate: Technique for sending lots of data into stored proc I frequently come across the situation where I want to pass an array of Ids as a parameter to a stored procedure. ...