Tagged Questions
3
votes
1answer
35 views
Convert SQL Server 2012 SSIS package to 2008
I've created a few SSIS packages in SQL Server 2012 that I need to run on SQL Server 2008. I've been told that it is impossible in their current state.
Is there a way to convert the 2012 packages to ...
1
vote
2answers
43 views
SQL Server Memory Clerk Description
Trying to understand different memory clerks reported by sys.dm_os_memory_clerk however, not able to find description of the each individual memory clerk either on web (google and binged) or in SQL ...
4
votes
2answers
65 views
Should I use a composite or single-column index?
I have the following columns in my database table (Medicines).
ID bigint,
MedicineName nvarchar(50),
BrandName nvarchar(50),
MedicineCode nvarchar(20),
and price,quantity.
I am making a stored ...
2
votes
2answers
40 views
Is there a standard way to use common data and procedures across multiple databases?
We have several independent databases that have data and code in common, not in the sense that it is accessed between the databases but in the sense that the data means the same thing in each ...
1
vote
2answers
81 views
Database running out of space
My database has 16MB of space left.
I used to just truncate as I was taught but I found these links that advise against truncating:
...
1
vote
3answers
34 views
How to create new users for restored databases?
I am not too familiar with SQL Server and am facing the following problem: The server was freshly installed and the only existing login is sa.
Then a couple of databases were restored from earlier ...
1
vote
0answers
44 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.
4
votes
2answers
91 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 ...
0
votes
1answer
43 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 ...
1
vote
1answer
44 views
Get the 2nd or 3rd occurrence of a value in a delimited string
I have the following table:
==========================================================
| Name_Level_Class_Section | Phone Num |
...
10
votes
2answers
216 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
...
-1
votes
3answers
79 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 ...
0
votes
1answer
49 views
Can I use the database and query it while full-text indexing?
I need to index my database, but I need to query it while it is indexing, it may take a long time, can I do that?
2
votes
1answer
113 views
Cannot connect to SQL Server after setting sa password to blank
I have installed SQL Server 2008 R2 on a Windows 2008 server. I need to set the sa password to blank for some reasons to make an application works; but it seems like the password changes automatically ...
-1
votes
1answer
61 views
Validate each parent intermediary is also a parent to itself
I have a table for which I want to validate where each parent intermediary is also a parent to itself. How to write query to validate this?
COLUMN DATATYPE DESCRIPTION
...
6
votes
1answer
129 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. ...
0
votes
3answers
78 views
How to find all positions of a string within another string
How can I find all the positions with patindex in a table or variable?
declare @name nvarchar(max)
set @name ='ali reza dar yek shabe barani ba yek '
+ 'dokhtare khoshkel be disco raft va ali ...
6
votes
3answers
259 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
vote
1answer
52 views
SQL Server-MySQL master-master replication
We are looking into setting up a master-master replicated MSSQL database and I am interested to hear of any potential pitfalls that we may run into along the way and generally any advice that you ...
-1
votes
2answers
94 views
Validate every client has a valid gender
I have table CLIENT which have columns are
COLUMN_NAME DATA_TYPE DESCRIPTION SOURCE TABLE
ClientPK int Identity column
ClientID int Client ID PARTY ...
2
votes
2answers
29 views
sysjobhistory “sql_severity” codes
Where can I find out what the different "sql_severity" codes mean in the sysjobhistory table?
Eg what does 0 mean?
I've inherited a report that excludes ones with a 0 as "0 is not a real error"?
I ...
3
votes
1answer
47 views
What is the safest way to run SSIS on Multiple Named SQL Server Instances?
I have an Active/Active SQL Server 2008 R2 cluster. There are two named instances on each node and no default instance.
I need to deploy SSIS packages to the different instances. To do this, I ...
4
votes
2answers
110 views
How can I reliably track stored procedure ( and functions ) use over time?
I have a lot of stored procedures and functions in database, many are not used any more and I want to remove them. How can I find them reliably ?
I have seen answer that suggests looking into plan ...
0
votes
1answer
34 views
IIS Application pool running under network service can't connect to SQL Server
I just deployed an ASP.NET MVC 4 application to IIS 7 but when I browse it i get the following error:
Cannot open database "PCSPI" requested by the login. The login failed.
Login failed for user 'NT ...
7
votes
1answer
118 views
Automatic decimal rounding issue
The question is relatively simple. I need to calculate 3 columns where the mid results are huge decimals, and I'm running into a problem early on with SQL Server basically rounding the decimals ...
2
votes
2answers
102 views
Is there a difference in performance between @date and getdate()?
Usually I use the getdate() function in my where clauses to go back in time.
Something like:
DOC.DATUM >= DATEADD(DD,-1*SSN_SDO.DANA_ZA_POVRAT,GETDATE())
Will SQL Server 2008R2 perform faster ...
2
votes
1answer
56 views
Is replication from SQL Server 2008 to PostgreSql possible?
Is it possible ? Sql Server as publisher(master) and PostgreSql as slave(subscriber) ? Any type of replication really.
1
vote
1answer
82 views
Total Memory used by SQL Server (64 bit)
My knowledge on the subject suggests that perf counter SQL Server:Memory Manager: Total Server Memory only gives you buffer pool memory. There is a column called physical_memory_in_use in a DMV named ...
0
votes
1answer
81 views
Is it there anyway to restore updated records in Microsoft SQL Server 2008 R2?
We have an test database configured with our web application. Due to internal web application error the entries were get updated in the database. Is it there any way to recover the updated records?
...
5
votes
2answers
140 views
Maximum memory setting in SQL Server
I'm running SQL Server 2008 and a web based application, on a single dedicated server, with only 2Gb of memory available.
As is noted elsewhere, SQL Server regularly takes up to 98% of physical ...
1
vote
2answers
35 views
Modifying replication distributor & publisher
I have a SQL Server 2008 transactional replication setup as follows:
192.168.100.1 <-- Distributor
192.168.100.2 <-- Publisher
192.168.100.3 <-- Subscriber
Our network team want to change ...
1
vote
2answers
80 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' ...
3
votes
0answers
38 views
Error statement is not logged, only *password-— with many dashes
I use extended events to store database errors, like this:
CREATE EVENT SESSION [ErrorCapture]
ON SERVER
ADD EVENT sqlserver.error_reported
(
ACTION
(
sqlserver.client_hostname,
...
0
votes
2answers
81 views
Sync Indexes between two tables
I need to automate and Sync only indexes between two tables ( Primary and Stage_Table) within the same database.
I tried using SSIS SQL Server Objects Task, but looks like it works only when we sync ...
0
votes
0answers
29 views
Deleted a file accidentally, I need to remove it's entry, I don't need it's data because it contains only indexes [duplicate]
I have a C# program to deal with a big database, I need the databas not to be the buttle-nick of my program, in the database, to increase performance, I have created a filegroup with a single data ...
1
vote
1answer
35 views
Publishing stored proc execution in transactional replication
In SQL 2008 R2, I am going to update a table which will affect 25 million rows, table is currently replicated (transactional replication). To minimize the impact on replication can I create a stored ...
4
votes
1answer
131 views
Indexes file damaged, was on ramdisk
I have put some of my indexes into a filegroup that contains one file, that file is on the ramdisk, the performance is great, but the problem is that the file was deleted incorrectly (the file ...
7
votes
3answers
321 views
Worse performance on a new server
We've been on a dedicated server (single quad-core, 6 GB RAM) and are moving to a new dedicated server (2x hex-core, 32 GB RAM). Both are Windows Server 2008, SQL Server 2008. The performance on the ...
5
votes
3answers
101 views
How does “Be made using the login's current security context” pass the users password to remote server
Say you have a SQL Server with a "Linked Server" to another server - said "Linked Server" is set to use "Be made using the login's current security context" as its authentication model.
How does the ...
1
vote
3answers
135 views
Performance issues moving 1 million rows between tables
I want to replicate 1 million rows from table1 to table2. I have written a job with a query like this:
delete from table1 OUTPUT *.delete into table2
I am executing this job every hour, but it ...
2
votes
1answer
65 views
Visualiser for spatial query results
This question Whats the easiest way to get sql 08 spatial data onto a map? (and many other articles) recommends Craig Dunn's Geoquery, but all the download links appear to be kaput.
SQL Server ...
0
votes
3answers
135 views
Easier way to handle so many isnull() situation
Is there any good way to avoid writing so many times isnull() function inside sproc ?
I have stored procedure that use almost 30 times isnull() function, I think that I am miss a concept , but until I ...
4
votes
1answer
71 views
SQL Server 2012 indirect checkpoint
I am trying to understand where to draw a fine line for Indirect Checkpoint that was introduced in SQL Server 2012.
Based on my understanding
SQL Server does checkpoint to flush dirty pages out to ...
2
votes
1answer
47 views
How to enforce a nullable foreign key?
I have a relation between two tables. The foreign key table can have a row related in the primary table. There's a way to enforce the value of the FK column to be NULL or one of the values of the PK ...
0
votes
1answer
23 views
How to get default locking hint of a table
Is there is any way to get default locking hint using a query. I want to know whether the locking use by my transaction is tablock | rowlock | nolock etc.
2
votes
2answers
71 views
Using T-SQL to dynamically create Extended Properties
I would like to add Description and Status in the Extended Properties of a large database to all my tables and columns so that someone can fill in the values.
It would be very laborious to add these ...
2
votes
3answers
172 views
Msg 21, Level 21, State 1, Line 1 Warning: Fatal error 9001
We recently moved to a SQL Server that's on a VPS and every now and then we get a 9001 error when trying to do an update.
Rebooting the server fixes the problem.
I changed the maximum server memory ...
1
vote
1answer
40 views
Key lookup partition pruning
I have a query inner joining multiple tables all of which are partitioned and have 10 partitions each:
SELECT A.COL1, B.COL2, C.COL3
FROM A
INNER JOIN B ON A.ID = B.ID
INNER JOIN C ON A.ID = C.ID
...
0
votes
0answers
48 views
Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON' [closed]
I have 4 SQL Server 2008 instances from which I need to pull data using OPENROWSET. I am adding this data to a table on server 1. Server 1 and 2 are in a cluster, same as 3 and 4. I am remoted into ...
0
votes
3answers
93 views
Is transaction log lost after backup on SQL Server?
I have database that has regular nightly backup (full recovery, full backup). I noticed some irregularities in data and wanted to check out transaction log to see what happened. I restored earlier ...

