Tagged Questions
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).
0
votes
2answers
18 views
Which one is better way to insert data?
I have two cases
case
create proc createEmployee
@firstName varchar(255),
@lastName varchar(255) = null
as
insert into Employee_Tbl values (@firstName, @lastName)
case
create proc ...
1
vote
0answers
15 views
logon trigger to send an email
I want to create a simple login trigger.
basically if user = test , then send an email to me.
CREATE TRIGGER ServerLogon
ON ALL SERVER WITH EXECUTE AS 'test'
FOR LOGON
AS
BEGIN
IF ...
0
votes
0answers
23 views
What other type of database servers are there? [on hold]
Besides an SQL server, what our some other popular type of database servers. Where could I find out the marketshare for SQL servers compared to the others? I'm just curious. Thanks.
3
votes
1answer
111 views
How to pinpoint root cause of excessive log file growth
The log file stays pretty small (~500MB) until about 11PM, and at that point it begins growing until no disk space is available. The log file reached it's maximum size at 12:39AM, so the growth took ...
4
votes
1answer
35 views
How can a connection for one DB block a connection to another DB in SQL Server?
We have an interesting scenario. For weeks, we have been experiencing 'outages' on SQL Server 2008 -- where our websites have slowed to a crawl and mass timeouts for all customers who have DB's ...
0
votes
1answer
25 views
Inserting text with diacritics with Doctrine ORM using MsSql 2005/2008
I am having a problem inserting text with diacritics in the database, the diacritics get removed and normal characters show up instead (a, t, s), the only one that gets inserted is î. The column type ...
0
votes
4answers
57 views
What can cause Reads to slow down on SQL 2008R2?
Our primary DB is 15GB in size. The server has 16GB of RAM. We are using Simple Recovery. Lately we've noticed that our custom apps lookup's, so just basic reads with AdHoc SQL statements, have ...
3
votes
3answers
72 views
SQL Server- Table partitions on SSD
I have a table in my database that has about 250m rows. I'm new with databases but I have read up about partitioning the table to increase performance. One of the important points that I seem to ...
2
votes
2answers
40 views
SQL Server - Recursive “find all FK connections for ID through the entire DB” query
I'm dealing with a DB with hundreds of tables, with interconnecting FK references producing potentially thousands of different permutations for how for example table A and table K can join together. ...
1
vote
1answer
45 views
What is the purpose of a user's default database?
As I understand it the default database is specified so that in case you don't specify one in the connection string, it will know where to start. Is this correct?
I've never seen a connection string ...
0
votes
1answer
28 views
How to convert sql server table data into MS Access(.mdb) file
I have SQL Database table with 6664055 rows, I want to convert this SQL Server table data to MS Access format(.MDB), How Can I do this?
-2
votes
1answer
37 views
What objects can be affected in SQL Server 2012 by a DDL statement
Are they any objects that could be CREATEd, ALTERed, or DROPped in SQL Server 2012 other than the following list:
Tables
Stored procedures
Views
Functions
Triggers
Indexes
P.S. I'm only interested ...
0
votes
0answers
27 views
Table Field to Reference Field in Other Tables
Suppose I want to map a set of input values to database table fields E.g.
employeeFirstName --> emp.fName
employeeLastName --> emp.lName
... --> ...
In theory I can create a ...
3
votes
1answer
58 views
SQL Server 2000 - 'Performance: Deadlock'
We had to restart our SQL Server today, we had made no changes to it.
When it came back up we immediately started getting this error from the server
DATE/TIME: 2/27/2014 3:09:31 PM
...
4
votes
2answers
38 views
Spatial index not used
I have a table with a geometry column. For one record, there is only one Point stored. A spatial index has been created but queries searching for the nearest location do not use this index resulting ...
3
votes
4answers
169 views
indexing on multiple nvarchar(max) columns
I have multiple nvarchar(max) columns in my DB named ShipperName,ConsigneeName, ProdDesc,BillOFLading.
What I need to do is to have UNIQUE INDEX for the combination of these columns. As I am failed ...
-4
votes
2answers
56 views
Performance with IN clause
Does indexed data affect query performance? means If I passed value as 1,2,3,4... in ordered form in any IN clause, can it improve query performance? and what happen in case I pass value randomly ...
1
vote
0answers
52 views
What's is the best way to get incremental changes from production to incrementally changed development database?
I came to a new dev team where all development is on the same (instance) of an SQL Server (2005) database once in 1-2 days restored from a current full backup of production database replacing a dev ...
2
votes
2answers
66 views
Aliased Column name in SQL Server
Sometimes, when developing in a hurry, devs make poor choices on column names.
Changing them can be a challenge, having to stage code, and time migration perfectly.
I'm told that Oracle has a way ...
5
votes
1answer
198 views
Estimating IO Requirements for Bursty Usage
We have an application that queries a SQL database periodically throughout the day. There are periods of zero or only light activity, interspersed with individual requests for relatively large ...
1
vote
0answers
15 views
SQL server 2012 restore wizard freezes
I have a development laptop with SSMS Express 2012 with a 2012 db instance and a 2008 db instance. Have been using this configuration for over a year. Suddenly I am unable to use the restore ...
10
votes
0answers
91 views
SQL Server 2008 R2 index rebuild fails with severity 17
Occasionally during our index maintenance, the job will fail with a SEV 17 error where enough space can not be allocated for the object it is rebuilding. The database is laid out as such:
Data_file1 ...
2
votes
1answer
59 views
Avoiding Deadlocks
We currently have a trigger-based system in place that does the following:
When records in certain tables are modified, a trigger fires that
makes a field NULL in a varying number of records in ...
2
votes
2answers
34 views
Replication between SQL Server 2005 - 2005
I'm hoping to get some help with a SQL Server 2005 replication issue. In short, in replication monitor, (On the Publisher), on the 'Distributor to Subscriber History' tab, I see two lines under ...
0
votes
1answer
44 views
SQL Server 2008R2 - Stored Procedure with 2 updates causing deadlocks
I have a web api web service that calls an authentication stored procedure.
This stored procedure calls a different stored procedure that does 1 update:
UPDATE ...
1
vote
1answer
42 views
how determine the best path that satisfies a condition
declare @flat table
(
id int not null,
percentage int not null,
value float not null
)
insert into @flat (id, percentage, value)
select 1,10,0.333
union all
select 1,20,0.4
union all
...
1
vote
0answers
18 views
The @article parameter value must be 'all' for immediate_sync publications
I have a publication of 4 tables and many subscribers (transactional push replication), most of them being interested by one of those 4 tables.
Everything is working fine as long as I create the ...
4
votes
1answer
44 views
Drastic performance difference in View Dependencies between SQL Server 2005 and 2008 R2
Background
I am a fledgling DBA who was hired in the middle of a migration from SQL Server 2005 x64 to 2008 R2 x64. We also migrated from a local server to a colo virtual server, and moved some of ...
6
votes
1answer
177 views
Re-run a specific actual query plan
I have captured an actual query plan for a specific query.
After this I've changed a few things around (including updating the statistics) and re-ran that specific query. Now the actual query plan ...
0
votes
0answers
23 views
How to configure log shipping in SQL Server 2008 R2 Standard Edition
Could you please guide me on how to configure log shipping in SQL Server 2008 R2 Standard Edition for same hostname with two different IP's. (Primary and Secondary server)
example:
Primary machine ...
2
votes
1answer
30 views
Generate Backup list
I have the query below that returns all databases and full backup history with the last backup date and device name. I am trying to modify the query to only return all the databases and just the last ...
1
vote
1answer
32 views
How do you restore a DB to Multi-User mode when deadlocked by a sys process
I have a database that is stuck in Single User mode after a failed restore process. I have checked the sysprocesses table and none of the processes have spid > 50. They are all sa processes. Using the ...
1
vote
1answer
42 views
Partitioning a table state
So far I always used date ranges to partition my tables, however now I like to do it by state or a selected list of cities where all others that are not explicitly listed in an "other" partition, is ...
0
votes
0answers
22 views
Merge data using Integration Service
Please Consider this scenario:
I have a table in my database. I want move this data in my OLAP database using SSIS.I can move all record from my table to OLAP database.The problem is I don't know how ...
-3
votes
2answers
113 views
How to calculate the hours worked by all employees in a day? [on hold]
vinay_hours
id cico
1 2014-02-20 10:31:00.503
1 2014-02-20 13:00:00.503
1 2014-02-20 15:31:02.503
1 2014-02-20 19:00:02.503
2 2014-02-20 10:00:02.503
2 2014-02-20 18:31:02.503
expected ...
0
votes
2answers
60 views
how to store multiple value in column in sql server [on hold]
I am creating job post application. In my first table the columns are This is my master table
ID
Position
jobDescription
minExp
maxExp
LastDate
InterviewDate
Project
HiringManager
interviewer
...
1
vote
1answer
40 views
Are there reasons to not use SCHEMABINDING on database objects?
Not using schema binding seems like turning off compiler warnings - you don't find out you broke something until runtime.
The benefit is that schema bound objects protects the database from ...
-2
votes
0answers
18 views
Which databases allow signed and unsigned datatypes [on hold]
Which databases allow set signed and unsigned datatypes, i mean among prodution versions, of popular dbs like oracle, postgresql, mysql, sql server?
0
votes
0answers
30 views
SQL Server 2012 Failed to launch local ScenarioEngine.exe
I have been trying install SQL Server 2012 Developer Edition for quite some time now..
I always get "stuck" at Install Setup Files, the install wizard just hides,
Now, i reviewed the log file for ...
1
vote
0answers
16 views
Setting up triggers based on exposed columns in a view's source table
I have a table where I want to do a AFTER UPDATE trigger if one of the columns modified was in a specific view
CREATE VIEW [dbo].[iv_EmployeesView]
AS
SELECT EMPLOYEE_GUID AS EmployeeGuid,
...
0
votes
1answer
48 views
Optimising an Update statemement with a very large Where clause
I have a table (TableOne) with a field called [ReviewNote], this table has more than 1.5 million record, I have to assign keywords to each record based on the content of the [ReviewNote], using ...
-2
votes
1answer
45 views
How to prevent duplicated records when applying ORDER BY NEWID() to fetch them randomly? [on hold]
I tried using the solution provided in http://stackoverflow.com/questions/1117761/sql-query-to-return-rows-in-random-order to fetch random records in my query. But I have to add NEWID() to the list of ...
0
votes
0answers
26 views
Powershell Get-ChildItem fails in SQL Agent but runs fine in Powershell [on hold]
I am having trouble running this code through my SQL Server Agent. I am trying to remove backups with certain name and between a date range.
set-executionpolicy RemoteSigned
#backup.ps1-Credential ...
2
votes
0answers
47 views
+50
Dealing with measure groups of different granularity
Let's say I have a simple data warehouse with the following fact tables:
FactPurchase: one row per property purchased, with purchase amount, value, etc.
FactMonthlyStatus: one row per property, per ...
2
votes
0answers
43 views
Help with “Flexible” vs Fixed Tables
We are designing a database in SQL Server to handle sales commissions. A diagram of the current schema looks like this:
There are only a couple of us on the project, and our boss dropped this ...
0
votes
0answers
30 views
Sql Server Install Error [on hold]
I reviewed the previous solves for my problem, but mine is a bit different.
I am trying to install SQL Server 2012 on my local machine, and i get errors,
these are my errors :
...
2
votes
0answers
33 views
Getting “Attempt to fetch logical page in database” error when running query
When I run queries from one of my tables I get an error
Msg 605, Level 21, State 3, Line 1
Attempt to fetch logical page (1:8687634) in database 7 failed. It belongs to allocation unit ...
1
vote
1answer
57 views
Management Studio won't recognize other file extensions
I am using SSMS 2012. I am working with .PRC, .TAB, and .UDF files. I added these file extensions to SSMS so that it would treat them like .SQL files already via Tools > Options > Text Editor > File ...
1
vote
2answers
19 views
How to enable a SQL 2012 login to create, alter and drop the created databases?
I'm trying to assign a proper GRANT permission to CI login, that will be able to:
Create test DB
Alter it
Drop this test DB (and only it)
But it appears that SQL2012 GRANT CREATE ANY DATABASE only ...
0
votes
1answer
31 views
Agent Xps getting disabled automatically
In one of SQL 2012 server, agent Xps is getting disabled automatically. There is no set pattern for the same and the issue started all of a sudden. Through profiler it was found that application named ...