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).
1
vote
0answers
8 views
Clear sql database but dont drop it
Hi Database administrators,
i'm working on a school project where i got a SQL server with a database for my team.
I already imported a local database witch was created with the Entity framework by ...
5
votes
4answers
10k views
Restoring a backup to an older version of SQL Server
When trying to restore a backup to a SQL Server Express 2008 database I got the following error:
Restore failed for Server '...\SQLEXPRESS'. (Microsoft.SqlServer.SmoExtended)
...
0
votes
0answers
63 views
What are my options for building a SQL Server lab in cloud?
There is an excellent post by Jonathan on SQLSkills detailing setup of a completely free SQL Server playground locally using VirtualBox and Windows/SQL Server evaluation editions. I am planning on ...
2
votes
2answers
191 views
Accessing a network share via a SQL Server 2012 Availability Group
If you have a SQL Server Cluster called CLS, with machines CLS1 and CLS2, accessing:
\\CLS\network\path
is equivalent to accessing either
\\CLS1\network\path
or
\\CLS2\network\path
depending ...
4
votes
3answers
44 views
How to reduce network latency during mirroring?
We are using SQL Server 2008 R2 Standard edition for mirroring.
But we found out that network latency is too high. It takes nearly four times time to complete a transaction while mirroring is active. ...
0
votes
2answers
31 views
SQL Server: Change drive letter (which contains system dbs)
Is it possible to change driver letter for a volume which holds only system databases safely?
What precautions should be taken and how should it be done (I know I can just go to computer management > ...
0
votes
1answer
18 views
Database management tool for compact edition (.sdf) database
What is the best database management tool for remotely managing a compact edition (.sdf) database created in WebMatrix?
1
vote
1answer
33 views
Data Migration from Oracle to SQL Server [duplicate]
If you need to do a data migration from an Oracle database to SQL server, what approaches and technical solutions are the best practice?
Our database has about 100 million rows and a total of 52 ...
2
votes
2answers
35 views
Table restraints to limit value insertions based off of other values in a row
Using SQL Server 2008 R2
Is it possible to limit what values are allowed in a coulumn based off of other values in the row.
Ex:
myTable:
ID, Test_mode, Active
1 , 1 , Null
2 , 0 , 1
...
9
votes
2answers
185 views
How to avoid using variables in WHERE clause
Given a (simplified) stored procedure such as this:
CREATE PROCEDURE WeeklyProc(@endDate DATE)
AS
BEGIN
DECLARE @startDate DATE = DATEADD(DAY, -6, @endDate)
SELECT
-- Stuff
FROM Sale
...
2
votes
0answers
6k views
SQL Server named instance - can connect remotely, but not locally
I have an instance of SQL Server on my machine.
Machine: Bert01
SQL Server instance: Bert2008
I connect to it using SSMS putting Bert01\Bert2008 in the Server name box, using sa and the .
When I ...
0
votes
1answer
33 views
Moving one TempdB on 3 instance server
I have a large virtualized SQL Server (Full 2008R2).
I run 3 SQL instances and would like to relocate the TempdB database file to another location, splitting off from the TempdB log file.
The trouble ...
-4
votes
0answers
32 views
How do I create rows of test data in each table? [closed]
I am currently working on an assignment. Part of the assignment states "create a minimum of 15 rows of test data in each table and create at least 3 queries that joins two tables and returnes values ...
0
votes
4answers
253 views
How can I convert an Oracle dump file into SQL Server?
I want to ask about converting Oracle dump files (.dmp) into SQL Server files (.bak) where during conversion I don't have to be connected to any database server.
I've searched for related ...
4
votes
2answers
83 views
Re enable Windows Authetication in SQL Server
My old employee has disabled Windows Authentication in our server. Now I'm not able to access the SQL Server even though I have Administrator access to the server. I need to reset the sa password.
I ...
2
votes
3answers
50 views
Auditing specific database events in SQL Server
For auditing purposes, we have a requirement in which we have to enable Auditing for theses events:
DBA Logins
Changes made by DBAs LIKE INSERT, DELETE, UPDATE, ALTER (etc.)
Changes made by our ...
42
votes
4answers
3k views
Why are numbers tables “invaluable”?
Our resident database expert is telling us that numbers tables are invaluable. I don't quite understand why. Here's a numbers table:
USE Model
GO
CREATE TABLE Numbers
(
Number INT NOT NULL,
...
1
vote
3answers
3k views
How to create and send mail in SQL Server 2008?
I want to send E-mail from SQL Server 2008. What are the basic steps for that? Can you explain me if someone used this facility.
Any help will appreciated.
this link will helpful as commented by ...
2
votes
0answers
29 views
SQL Service Broker stops working
I'm new in using service broker. Our existing service broker suddenly stops working and I can't figure out why.
When I try to enable service broker (which is already enabled) I get this in SQL error ...
6
votes
3answers
240 views
Installation of SQL Server RAID 10 vs RAID 5
I am new to setting up SQL Servers and Vms. My predecessor used Raid 5 for C Drive where the SQL installation resided and RAID 10 for both database files and database logs.
I was wondering whether ...
-1
votes
3answers
67 views
How to restore SQL Server 2008 R2 backup to SQL Server 2008 [duplicate]
I am unable to restore a backup from a 64-bit instance onto a 32-bit instance.
Source Server:
Microsoft SQL Server 2008 R2 (SP1) - 10.50.2500.0 (X64)
Destination server:
Microsoft SQL Server ...
1
vote
1answer
40 views
SQL Server getting the 2nd and 3rd occurence or getting the 3rd value between two symbol in a string
I have the following table:
==========================================================
| Name_Level_Class_Section | Phone Num |
...
0
votes
2answers
69 views
Working Linked Server Query fails in sp_send_dbmail
Take the following example:
EXEC msdb.dbo.sp_send_dbmail
@recipients = 'me@whatever.co.uk' ,
@query = 'SELECT TOP 10 * FROM LINKEDSERVERA.DATABASE.dbo.TABLE' ,
@attach_query_result_as_file = N'True' ...
1
vote
0answers
41 views
Re enable Windows Authentication [closed]
My old employee has disabled Windows Authentication in our server. Now I'm not able to access the SQL Server even though I have Administrator access to the server. I need to reset the sa password.
0
votes
2answers
43 views
Can't use SQL Server database on a networkpath
I am working on a project for a very long time now. It's a .NET application which works with a SQL Server database (.mdf, LINQ to SQL). Now I am almost finished and wanted to run some tests.
But ...
1
vote
1answer
59 views
Databases list not showing up?
This morning when I logged into SQL Server Management Studio (v 10.0.16) I clicked on the databases node and saw all by db's (they are hosted remotely) as I have done for the last 3 years. This ...
-1
votes
1answer
35 views
SQL Server does not exist or access denied [closed]
Anybody can assist on how to resolve this kind of error? I have already checked the windows firewall in the server but still fails to connect. I have also tried to do TELNET and fails to connect also.
...
0
votes
1answer
41 views
Copy tables from a stand-by database
I want to explain the following. I have a database that is a recovery db from our main environment. This database is kept up-to-date through log shipping. However, I want to copy all tables from this ...
0
votes
1answer
24 views
distribution.dbo.MSdistribution_history comments explanation
The comment column of distributor.dbo.MSdistribution_history contains comments such as
<stats state="2" fetch="11554" wait="214007" cmds="17898546" callstogetreplcmds="106880">
...
1
vote
3answers
68 views
Document database structure for auditors
I am DBA for a Microsoft SQL Server 2008r2.
Due to an audition, I need to provide data structure of my database, to people without an explicit IT background.
I guess they would like the traditional ...
6
votes
1answer
123 views
How to shred .docx XML?
I am trying to import a xml (actually a docx file) to a sql server 2008 database. I am almost a novice in XML programming. I googled a lot but almost all the examples there are with simple xml file. ...
3
votes
2answers
1k views
How to import a varbinary(max) column with bulk import?
I have a varbinary(max) column that I need to bulk import. The data I'm putting into this column is a byte[] in C#. How do I format the data in the comma-delimited file used for bulk import? In ...
0
votes
1answer
36 views
convert(varchar, getdate(), 112) or convert(varchar(8), getdate(), 112)
Which sql command is recommended to convert a date to yyyymmdd?
1) convert(varchar(8), getdate(), 112)
or
2) convert(varchar, getdate(), 112)
I notice that if I used I use the 2nd one, it seems ...
4
votes
1answer
84 views
CTE memory space
How do CTE memory space work? When you have complex SQL statements executing with the CTE and you get unusually large result set, can it increase the logical reads of the query?
I have a CTE that is ...
-3
votes
1answer
19 views
Microsoft Assessment and Planning Toolkit for Windows server 2003 [closed]
Can anyone please tell me where I can find Microsoft Assessment and Planning Toolkit for Windows server 2003?
I tried using version 8.0 but it fails to install on Windows server 2003.
thanks
2
votes
3answers
867 views
Cannot connect to MS SQL 2008 R2 by DBVisualizer. “Native SSPI library not loaded” error
I try to connect to MS SQL 2008R2 database by DBVisualizer.
I use jTDS driver, but following error occurs
An error occurred while establishing the connection:
Long Message:
I/O Error: SSO Failed: ...
2
votes
2answers
68 views
Is there a fast way to change column type without dropping the clustered index?
I have a large table that is clustered index on a bigint. We would like to change it to just an int to reduce the space and improve the performance. However, dropping the clustered index and recreate ...
1
vote
2answers
81 views
sql server 2008 execution plan different on two production servers
We have two servers running SQL server 2008 R2, with identical databases, where we implemented a datawarehousing solution. The cube processing operation was taking a VERY long time in one of the ...
2
votes
0answers
26 views
How to remove leaf member values?
I have a dimension hierarchy that is related to multiple fact tables with different granularities. In the case of one fact table, it relates to the middle level of a three level hierarchy.
When you ...
2
votes
1answer
26 views
Full text catalog
I am using SQL Server 2008 R2.
I need to find when and which user created full text catalog.
also, who added/modified/deleted the fields(that were full text index) in that full text catalog.
0
votes
2answers
48 views
Running the following query within a scheduled job
I am looking at running the following query within a scheduled job weekly:
Select TOP 10
s.database_name,
m.physical_device_name,
CAST(DATEDIFF(second, ...
2
votes
0answers
38 views
The Login is from an untrusted domain - domain setup with computer level login
I have a Sql Server 2008 R2 database I'm attempting to connect to using ADO.NET using integrated security in the connection string.
The database resides on a 64 bit Windows Server 2003 machine. The ...
6
votes
3answers
599 views
Connect to SQL Server behind NAT from remote machine
The scenario is that this is a SQL Server behind a corporate firewall with your standard setup to allow only minimal outbound traffic and zero inbound. However, port 80/443 are open, per the usual ...
-1
votes
1answer
49 views
Single quote issue
I have to update a column where I am giving query which is
Update Table
Set col = '[189] IS NOT NULL and [189] <> '''
Where colid= 198
But it's giving output:- [189] IS NOT NULL and ...
8
votes
1answer
236 views
DELETE vs TRUNCATE
I am trying to get a greater understanding on the differences between the DELETE and TRUNCATE commands. My understanding of the internals goes something along the lines of:
DELETE -> the database ...
3
votes
2answers
51 views
Table partitioning filegroup
Can I use the same filegroup for multiple tables when partitioning a table? I partitioned a items table by year. It created five filegroups. Can I use the same file group for orders table or will I ...
1
vote
1answer
10 views
Create File Stream Enabled Database in Network File (NAS Server)
I want to create a filestream enabled SqlServer database using NAS server as the storage. I already passed the creation of DB step. Look at my previous question Creating SQL Server database with data ...
0
votes
1answer
36 views
Autogrowth of SQL Server database and log file
I am confused what this autogrowth property does for any database or log file in SQL Server.
According to my understanding
If we set autgrowth for database as restricted then its size will ...
0
votes
1answer
92 views
SQL Server 2005 Transactional Replication
I am in the process of replicating my companies databases from SQL Server 2005 to SQL Server 2012 using Transactional Replication. When complete we will be running preliminary tests on the database, ...
5
votes
1answer
77 views
Efficiently Filter Large Set With Disjunctions
Let's say I have a single table
CREATE TABLE Ticket (
TicketId int NOT NULL,
InsertDateTime datetime NOT NULL,
SiteId int NOT NULL,
StatusId tinyint NOT NULL,
AssignedId int NULL,
...






