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
1answer
106 views

Backup / Restore Distributor

I have a database architecture with: => 1 distributor running on a dedicated instance of SQL Server 2005 => 2 publishers running each on a dedicated instance of SQL Server 2000 and SQL Server 2005 => ...
7
votes
1answer
9k views

How can I tell which data sources are being used in SSRS?

We have a bunch of SSRS (2008) reports deployed to our web portal. We have edited some of the reports to use a shared data source different than the one with which it was originally deployed. I am ...
2
votes
1answer
1k views

SQL Server stored procedure permissions

I know that it's possible to set execute permissions for a stored procedure to a database role or user. My question is, how is access to any tables that the SP accesses determined? Does the ...
2
votes
2answers
1k views

SQL: revoking permissions from public in master

By default SQL grants execute permission on stored to public and also select to some table and views in Master to public...I am not 100% sure about this... What is the implication if we have to remove ...
4
votes
2answers
2k views

TSQL to find if server is listening on dynamic or static port

Using TSQL, how can I find if the MS SQL server (any version) is configured to use static port or is it using dynamic port? Script i am trying to use: DECLARE @TcpPort VARCHAR(5) ,@RegKey ...
3
votes
1answer
692 views

Will {fn concat} work without issue in MySQL, SQL Server and Oracle?

According to this (quite old) article the principle behind ODBC escape sequences is that The ODBC driver reads the escape sequence and translates it into the DBMS-specific syntax before sending ...
5
votes
2answers
3k views

How to make a unique column with default value of UUID

I have a key column for internal use which is just a increasing integer, but I would like to have a second unique column which is a UUID, but I don't know how to have a function called for the default ...
4
votes
3answers
5k views

How to create a view that refresh automatically

I was triying to create a View by the simplest way like this: Use SoccerDB; GO CREATE VIEW ExampleDBaseII AS SELECT ID, Cast(Name AS Varchar) as Name,Cast(City AS Varchar) as City, FROM Team GO ...
16
votes
1answer
2k views

Can foreign keys cause deadlocks and hinder READ COMMITTED SNAPSHOT?

This is a followup question from: http://stackoverflow.com/questions/7684477/is-it-possible-to-set-transaction-isolation-level-snapshot-automatically I'm still having deadlock/timeout situations in ...
3
votes
2answers
713 views

T-SQL: How to switch all partitions from one table to another?

Is it possible in a single statement to switch ALL partitions from one partitioned table to a staging table?
4
votes
1answer
3k views

Attaching a MDF with a missing LDF [duplicate]

Possible Duplicate: How do I attach a database in SQL Server? I was given an MDF for a database, no backups and not LDF that I was asked to attach the database to a SQL server. I get the ...
13
votes
3answers
2k views

Slow deletion of records when a trigger is enabled

Thought this was solved with the link below - the work around works - but the patch doesn't. Working with Microsoft support to resolve. http://support.microsoft.com/kb/2606883 Ok so I have an ...
6
votes
3answers
456 views

How are my SQL Server constraints being bypassed?

We have found a handful of rows in our DB that violate an active constraint. How is this possible? The constraint is active, as we can't just manually add a row that bypasses this constraint. ...
2
votes
1answer
1k views

SQL Server Error 18483 - When Setting Up SQL Distribution

I'm trying to synchronize a couple tables in one SQL Server 2000 database into another SQL Server 2005 database using replication. When I am attempting to set up my SQL Server as a distributor, I'm ...
0
votes
1answer
1k views

32-bit versus 64-bit ODP.NET to Oracle connection

I seem to be having an issue connecting a 32-bit .NET application to a 64-bit server, without a full Oracle client. If I build a 64-bit application, using the 64-bit ODP.NET dll's or a 64-bit instant ...
4
votes
1answer
254 views

What units is this metric in?

Im currently using the following query to get the Page Life expectancy from sql server: declare @PLE int select @PLE=cntr_value from psql1.master.sys.dm_os_performance_counters where ...
5
votes
3answers
1k views

Possible to detach a database from SQL Server while retaining file permissions?

When a user detaches a database from MS SQL Server, it sets the owner of the data and log files to that user. It also removes all non-owner permissions from the files. This is partially explained at ...
4
votes
1answer
272 views

SQL Server 2008 Replication - Fixed Overhead of Replication?

We are using SQL 2008 Transactional replication to replicate data from our production database to our reporting database. We recently created a new 'Global' database that we would like to have ...
2
votes
1answer
297 views

SQL Server 2008 R2 DETA Error: Can not get minimal database information in allotted time

I have a 18,6 GB SQL Server 2008 R2 profiler trace file. Trace file recorded at tuning profile. When I submit this trace file to database engine tuning advisor I get this error: Error: Can not get ...
1
vote
1answer
352 views

Query optimization: Which is better in my case - CURSORs or a Set-based approach?

First of all, I can describe the schema of the table, but my table itself is around 80GB so I am hoping some expert eyes can look at any obvious optimizations that can be performed. I am carrying out ...
4
votes
2answers
2k views

Does the compatibility level for sql server work reliably for scripts?

We have some DB scripts that need to be migrated from SQL Server 2008 R2 back to 2005, often scripts created in SQL Server 2008 / 2008 R2 won't run on a SQL Server 2005 installation (which some ...
0
votes
1answer
896 views

Using Sync Orchestrator to Syncronize two SQL CE 3.5 Databases

I am trying to set up synchronization between two SQL Compact 3.5 databases using SqlCeSyncProvider. I am able to create a scope for the two databases, which creates a meta table. When I try to run ...
6
votes
3answers
3k views

SQL Server - what isolation level for non-blocking select statements?

I have a long running transaction (called, say, T1) that performs some deletes, updates and inserts on a table in SQL Server 2008 R2. At the same time, another process periodically runs select ...
5
votes
1answer
526 views

How can I design a table for quick versioning of textual data?

Version i am talking about here is not of version control systems. Like in SO i got some textual data(compare them to questions) that could be versioned(in the sense edited, saved, rollback). Content ...
8
votes
3answers
7k views

How to free SQL Server memory?

I have a SQL Server sandbox installation on my local computer. I have set the memory SQL Server instance can use to 1000 mb. When running an intensive operation, memory usage rises up to 1000 mb. When ...
1
vote
2answers
1k views

SQL Server 2000: Can't DROP VIEW?

I have SQL Server 2000. I want to clean it by dropping obsolete and unused objects. One of the views causes me an error. I try to give more information but I still have no clue what the cause is. ...
8
votes
3answers
309 views

Included Index Vs Filtered Index

We currently work with table named tb_tranfers. This table has 40 millions rows and is ~26 GB in size (11 GB Data, 15 GB Indexes) 10 to 15% of the rows are soft deleted rows (DeletedDate Is Not ...
9
votes
8answers
3k views

Is changing the SQL Server port really that much safer?

SQL Server's default port is 1433. I've been told by our admin that the port has to change "for security reasons". Is it really that much safer to change the port? If the server is behind a firewall ...
0
votes
1answer
273 views

DBCC CHECKDB Data Purity errors but no rows found

Any idea why the value -96.00 is out of range for the normalization_data column (defined as numeric(14,2) )? DBCC CHECKDB with DATA_PURITY flags this row: Msg 2570, Level 16, State 3, Line 1 Page ...
3
votes
2answers
23k views

SQL Server 2008: How do I change the default schema of the dbo?

When I attempt to change the default schema of the dbo in SQL Server Management Studio, the ALTER fails and states that the dbo account's schema cannot be changed. Are there any tricks that can make ...
2
votes
2answers
6k views

SQL Server 2008 collation arabic

We are currently having a problem loading arabic into a SQL Server 2008 database. We want to load بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ but in the database it changes to بِسْمِ اللَّهِ ...
4
votes
1answer
990 views

Why are Stored Procedure schema changes not being replicated when using ”initialize with backup”?

In SQL Server I have set up transational replication using the "initialize with backup" option. Data is being replicated fine, as are schema changes to tables. However, schema changes to stored ...
4
votes
6answers
4k views

Any way around unique index 16 column max

According to the CREATE INDEX documentation: Up to 16 columns can be combined into a single composite index key. We've got a table with ~18 columns that need to form a unique combination. This ...
7
votes
2answers
473 views

SQL Server schema intact but every record from every table is gone

We recently set up a new virtual machine running Windows Server 2008 and slapped a copy of SQL server 2005 on it. The server had running and in use without a hitch for about two weeks. The only real ...
2
votes
3answers
168 views

SQL Server Express acting strange

I'm not an IT pro, but a web developer that happens to have his own blog. The blog is hosted on a private VM on which I have both IIS and SQL Server. Sometime my blog, which is not super busy stops ...
0
votes
1answer
456 views

Small Squares or Blocks after string in table field

My problem. I'm running SQL Server 2005 in a Development (Dev) and Production (Prod) environment. I created a view that extracts data from a Navision database to SQL using a pass-through query ...
12
votes
6answers
2k views

Identical(?) SQL Server 2005 machines; query takes 2sec on one, 15min on the other

The Environment: We have two 32-bit Windows Server 2003 R2 machines running SQL Server 2005. The hardware configurations are identical servers with Xeon 5160 CPU, 4GB RAM, and 13GB RAID0. AWE and ...
8
votes
2answers
463 views

Mirroring the Distributor

Has anyone had success with mirroring the distribution database? We have a dedicated server as a Distributor. It handles all our push replication from prod to reporting. We'd like to build an ...
2
votes
1answer
1k views

SQL Server Replication causing locks on table

we have three MSSQL 2005 servers (database is set to compatibility level 80 for legacy reasons) which we have just set up Transactional Replication w/ Updateable Subscriptions on. Two which are ...
2
votes
2answers
48 views

SQL Server 2000 - Is this table needed?

SQL Server 2000 I've been tasked with cleaning up an SQL database of which I have no history working with so I'm not familiar with the tables within. Short from dropping a table and seeing if anyone ...
3
votes
1answer
9k views

SQL Server Agent Job Step “Run As” dropdown

When creating a job step in SQL Server 2008 R2 Agent, the third dropdown in the General page is "Run as:" - but this is empty, and seems to always be empty! What is it for? Thanks
5
votes
3answers
806 views

Does SQL server optimize or pre-parse stored procedures?

Despite what DBAs will tell you ("use stored procedures because the server will optimize them thus they are faster than ad-hoc queries"), I have heard that SQL server does not actually optimize stored ...
5
votes
2answers
2k views

Two relationships to same table

i have one transaction table, each transaction has 5-6 contacts involved. each contact has the same fields like name, address, cell, email etc. So the best thing I guess is to use the same contact ...
3
votes
2answers
231 views

How to know dependency on a table

I have a Database Called Total and I have about 40 tables in it.I am trying to move the tables in the database into a different server So I have prepared all the create table scripts but the problem ...
8
votes
2answers
10k views

Difference Between Row Level and Page Level Locking and Consequences

When attempting to run my Maintenance Plan, I receive the following error: Executing the query "" failed with the following error: "The index "" (partition 1) on table "" cannot be reorganized ...
3
votes
3answers
2k views

Trigger shouldn't block insert

I have a trigger on insert but if the trigger fails the insert fails too. is there a way to let the insert proceed even if the trigger fails? EDIT: I use a trigger to send a email when a new record ...
7
votes
2answers
666 views

Code creates different plan when ran ad-hoc vs. in a stored procedure

I have a delete statement that is using a bad plan when run inside a stored procedure, but is choosing a much better plan when run ad-hoc. I have rebuilt all the indexes for the tables used by the ...
0
votes
2answers
4k views

Hide column if any value is null or zero via proc sql or view [closed]

Given either of the two following datasets Kağıt Cinsi Sarı Yeşil Mavi Kalın 4 0 5 İnce null 0 3 or Kağıt Cinsi ...
2
votes
4answers
2k views

What impact do indexes have on the performance of table modifications? [duplicate]

I have always wondered what the effect indexes have on table modification in SQL Server. Will modification of a table will be slower with an increased number of indexes applied to that table? My gut ...
2
votes
1answer
227 views

stored procedure times out while subsequent runs take 1/6 the time

So I have this stored procedure which is running very slow (and timing out) in one particular production environment. This stored procedure produces an xml of profile data. In all other ...