SQL 2012 :: Server Generated A New SPID With Same Type Of Query

Feb 25, 2014

There are times when I either compile a stored procedure, or right now as I am creating indexes on tables, when sp_who2 shows a SPID assigned to my name that I do not currently have opened in SSMS. When I check the statement with dbcc inputbuffer it shows a query hitting many of the system views. Earlier this week, someone tried killing one of these SPIDS and SQL Server generated a new SPID with the same type of query.

View 5 Replies


ADVERTISEMENT

SQL Server 2012 :: Query All Columns In A Database That Have The Data Type As Integer?

Feb 20, 2014

Is there a way to query all the columns in a database that have the data type as Integer.

View 9 Replies View Related

Entity Framework: No Support For Server-generated Keys And Server-generated Values

May 23, 2008

Hello

I tried the Beta 1 of the service pack 1 to .net 3.5. If I try to add an entity (and try to save this), I get the Exception "No support for server-generated keys and server-generated values".

How can I add entities to my Sqlce- database?

I tried to give the id- column (primary key) in the database an identity, another time without identity, only primary key --> none of them worked. I always get the same error.

What do I have to change to make successfully a SaveChanges()?

Thanks for your help,
Gerald

View 21 Replies View Related

SQL Server Admin 2014 :: SPID Causing Locks With No Query Text Shown

Oct 1, 2015

I just ran into an issue with cascading locks due to a SPID on one of my production servers. When researching the lock, I noticed that there was no sql text. SP_Who 2, nor the following query captured anything,

SELECT sqltext.TEXT
, sqlplan.query_plan
, req.session_id
, req.status
, req.command

[Code] ....

I spoke to the user causing the lock and he ran into a visual basic error when this occurred and didn't close out that window. So my guess is that it's due to an uncommitted transaction. However, shouldn't I still see something if that was the case?

View 4 Replies View Related

SQL 2012 :: Task Manager SPID Blocked System

Sep 1, 2015

We had this issue yesterday, for like an hour. Suddenly, our website started to get slow and get timeout errors. After executing sp_who2 and sp_whoisactive, we found a system process blocking many other processes. Of course, it was impossible for us to kill it.

Under "Status" it said TASK MANAGER, "Login" sa, from sp_who2.
Under "sql_text" it was NULL, "program_name" empty, "open_tran_count" changed like this: 2,3,4,3,4,2,1 until it finished, and "database_name" changed from our database to master at the end, from sp_whoisactive.

Our CPU usage and memory at that moment were almost the same as any other day.

We don't do backups or execute jobs at that particular time. We don't even use "sa" account.

What could have happened? In the event viewer we've found nothing, nor in SQL server logs.

Once it finished everything was back to normal, we want to prevent this from happening again.

View 1 Replies View Related

SQL 2012 :: Drop All The Auto Generated Column Statistics?

Dec 29, 2014

My question: Is it okay to drop all the auto generated column statistics? (for the following scenario)

- I am cleaning up unnecessary objects (tables, unused indexes, overlapping statistics etc) from databases and found out there are more than 1400 auto generated column statistics on one database (lets call it A).
- Database A was used to be our reporting database but from last several years we are using database B for reporting. DB A has all the historical data while DB B only has valid records.
- We are updating all the column statistics with full scan nightly on database A and it is talking almost 2.5 hours to do that. Now I want to drop all the "unnecessary" statistics those were created when DB A was reporting database and they are no longer in use. There is no way to know the creation date of the column statistics that I know of. Statistics "last update date" is of no use because of our nightly job. So I was thinking of dropping all the auto generated column statistics and let the sql server create as it needs from now.

View 0 Replies View Related

SQL 2012 :: Adding Header Information To XML Generated File

Apr 23, 2015

I have a sql query:

SELECT
'5' AS 'value/@version',
'database' AS 'value/@type',
'master' AS 'value/name',
LTRIM(RTRIM(( [Server Name] ))) AS 'value/server',
'True' AS 'value/integratedSecurity',
15 AS 'value/connectionTimeout',
4096 AS 'value/packetSize',
'False' AS 'value/encrypted',
'True' AS 'value/selected',
LTRIM(RTRIM(( [Server Name] ))) AS 'value/cserver'
FROM dbo.RedGateServerList
FOR XML PATH(''), ELEMENTS

I need to add some header information to the beginning of the query:

<?xml version="1.0" encoding="utf-16" standalone="yes"?><!--
SQL Multi Script 1
SQL Multi Script
Version:1.1.0.34--><multiScriptApplication version="2" type="multiScriptApplication"><databaseLists type="List_databaseList" version="1">

Everything I have tried ends up as a failure, usually compile issues. My goal here is to be able to automare a configuration file for multiscript so I can keep my server list up to date.

View 2 Replies View Related

SQL 2012 :: Remove Auto Generated Statistics After Adding Index

Nov 21, 2014

We have implemented a very small reporting database which has a main table that started off small and has now grown to around half a million rows. Initially, there were no indexes on the table apart from a clustered index, but as the data has grown, performance has dropped and so we have added a number of indexes. This has resolved the performance issues.

Before creating the indexes SQL Server had auto created a number of statistic objects (_WA_Sys_000... etc). After creating the indexes, new statistic objects where created for the new indexes. In some cases, there are duplicate statistics (auto and index) for the same columns.Should I go through and drop the duplicate auto statistics? Will having duplicates cause issues at all?

View 2 Replies View Related

SQL Server 2012 :: Querying From XML Type

May 23, 2014

I have a plain XML variable

<BS>
<B Id="5" />
<B Id="3" />
<B Id="4" />
<B Id="6" />
<B Id="15" />
<B Id="7" />
</BS>

When I insert this into a temp table, the order get mixed up.

SELECT I.value('@Id', 'INT') ProductId
INTO #ProductList
FROM @Products.nodes('/BS/B') AS T(I)

When I select out of #ProductList the order is random and different from the XML.

View 8 Replies View Related

SQL Server 2012 :: Dynamic Return Type In A Function

Mar 3, 2015

I have created a function that will check whether the data is null or not. If its null then it will display that as No data else it will display the original value. Below is the function

GO
Object: UserDefinedFunction [dbo].[fnchkNull] Script Date: 3/4/2015 12:01:58 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

[code]...

The code is working good. However i want the return type to be dynamic. If the data type supplied is integer then i want to return a integer value like 0 if its null. if the data value is varchar then i want to return 'No Data'.

View 7 Replies View Related

SQL Query Generated.

May 2, 2008

Hi,

Is there any way to look at behind-the-scene SQL query that gets generated by SSRS engine to pull the data out of the data source (particularly SQL Server).

So far, I only know that you can see the query generated by semantic query engine by changing trace option in configuration file.

Thanks and Regards,
XL

View 2 Replies View Related

SQL Server 2012 :: Arithmetic Overflow Error For Type Varchar

Mar 11, 2014

I have the following code in a SP. The 2 if statements for the @@ Error I added only for testing as I suddenly started get the following error at the 1st @@Error statement

Msg 232, Level 16, State 2, Line
Arithmetic overflow error for type varchar, value = 10000.00000.

I cannot have this SP running minutes it must be done in seconds.

I have tried the folloiwng changes but then it takes to long.

-- set @new = 'x' + right('0000' + convert(varchar(5), round(rand() * 10000, 0)), 4)
-- set @new = 'x' + right('0000' + convert(varchar(4), right(round(rand() * 10000, 0),4)), 4)

declare @newvarchar(5),
@xstsint,
@new_retvarchar(5)
,@Cnt as int /* just for my testing */
set @cnt = 0 /* just for my testing */

[Code] ......

View 6 Replies View Related

SQL Server 2012 :: Using Lookup As Alternative In SCD Type 2 And Adding Date?

Apr 26, 2014

how i can add date using ssis or data tools 2012..My flat files had no date..den my instructor gave us a database where it has recordstartdate, recordenddate and currentdate.how i suppose to add date?

tell me the steps to how to do it?

View 2 Replies View Related

SQL Server 2012 :: Decimal Data Type Round Off The Values

Sep 11, 2014

I have table with data type decimal (18,2) when i try to load more then 2 decimal it is rounding off

Example 34.456 is rounded with 34.46

I want to store 34.45 only with out round in decimal data type how can i achive this

View 2 Replies View Related

SQL Server 2012 :: Querying Table With Several Date Type Columns

Oct 30, 2014

I have a table (we will cal DateTable) with several (20) columns, each being a date type. Another table's (Project) PK is referenced in the DateTable.

I am trying to write a query that will pull all dates for a specific project from the DateTable if they meet certain criteria(i.e. if the date is <= 7 days from now.

I started with a normal select statement selecting each column with a join to the project and then a where clause using

(DateTable.ColumnName BETWEEN GETDATE() AND DATEADD(day, 7, GETDATE()) OR (DateTable.ColumnName BETWEEN GETDATE() AND DATEADD(day, 7, GETDATE())) ...

The rest of the columns(all with OR between them).

The problem with this is that because I am using OR once one of the dates meets the criteria it selects all the dates that are associated with the project. I ONLY want the dates that meet the criteria and don't care about the rest.

Obviously because I have all the columns in the select statement... So I need something like

Select ALL Columns
from DateTable d
Join Project p
where p.ProjectID = d.ProjectID AND only dates BETWEEN GETDATE() AND DATEADD(day, 7, GETDATE()))

View 2 Replies View Related

SQL Server 2012 :: Conversion Failed When Converting Varchar Value To Data Type Int

Aug 12, 2014

I am doing a Case statement to create a unified field for account type and vendor, in the code below I am receiving the error in the subject, because the account numbers have alpha characters in the string, I need to make them as OTHER if the first 2 left chars are Alpha, I thought how I have ISNUMERIC would do that but I am still getting the error.

I am also including example of how the account_numbers are formatted.

R222209
R222220
R222222
R222212
R221123
F707768

[Code] .....

View 5 Replies View Related

Query Plan For Stored Procedure Not Being Generated

Mar 13, 2008

I have a stored procedure that I want to test for performance , however, I cannot view the estimated query plan execution. I am not using any nested subqueries. Any ideas why the plan will not generate?


Thanks in advance!

View 1 Replies View Related

SQL Server SPID Connections

Nov 15, 2004

Hello -

I have a Foxpro app with a SQL Server 7 backend. The Idle Connect setting on VFP is set to indefinite. I'm having some connectivity issues where the SPID for the client seems to disappear from the active SQL processes on the server when the client sits idle for a while (10 minutes or so). On some workstations, resuming activity at the client results in the SPIDs reappearing
as if they were always there with no problem. On others, the connection is not reestablished and the client gives a 1526 (VFP ODBC) error.

Does anybody know why this might be? Are the SPID connections cached at both sides and if so, how?

Thanks.

Steve

View 2 Replies View Related

SQL Server 2012 :: Geography Data Type - Test If Point Is Inside A Closed Polygon

Dec 5, 2013

I have a closed polygon that coincidently is in the shape of Iowa :) I have a point that is within the state and a point WELL outside it, but I get weird results that I don't expect when I try to get it to tell me that the point is within the polygon. Here is some basic code, with long coordinates data.

DECLARE @g geography,
@pIn geography,
@pOut geography

SET @g = geography::STPolyFromText('POLYGON((-91.119987 40.705402, -91.129158 40.682148, -91.162498 40.656311, -91.214912 40.643818, -91.262062 40.639545, -91.375610 40.603439, -91.411118 40.572971, -91.412872 40.547993, -91.382103 40.528496, -91.374794 40.503654, -91.385399 40.447250, -91.372757 40.402988, -91.385757 40.392361, -91.418816 40.386875, -91.448593 40.371902, -91.476883 40.390968, -91.490158 40.390762, -91.500221

[code]...

(1 row(s) affected)As I read that there is a distance of about 7864 meters, this is close to what I would expect, so that's ok. The point outside I would expect a distance as well so that is confusing.. Then we have the intersects, it says that the point inside does NOT intersect but the one outside DOES, this is backed up by the intersection values.

View 1 Replies View Related

SQL Server 2012 :: Arithmetic Overflow Error Converting Varchar To Data Type Numeric

Oct 30, 2014

OK, so I have this query where I'm trying to subtract values like this, when I do this I am getting (Arithmetic overflow error converting varchar to data type numeric.) I have tried many different things, and now of these work, it'll either return 0 because it loses the .XXXXX.

Convert(DECIMAL(10,7),CAST([TIME_OF_COMPLETION] as DECIMAL(10,7)) - Convert(DECIMAL(10,7),CAST([OPR_DELIVERED_TIME] as DECIMAL(10,7)) round(cast(cast(hist.[TIME_OF_COMPLETION] AS float) as DECIMAL(15, 5)) - CAST(hist.[OPR_DELIVERED_TIME] AS FLOAT),1 SELECT convert(FLOAT,CAST('735509.00053' AS DECIMAL(10,5))) - convert(FLOAT,CAST('735509.00047' AS DECIMAL(10,5)))

View 1 Replies View Related

Map Server SPID To PID In Task Manager

Aug 21, 2013

I'm trying to map the SPID of a certain process to the PID under the processes tab in task manager. I can map the PID to the KPID through the sysprocesses table but this KPID does not appear in task manager under the PID's under the processes tab. How can this be done?

View 8 Replies View Related

SQL Server Express 2005 @@SPID

Nov 22, 2007

Hi,which is the syntax for a stored procedure that return to me the exact@@SPID of my current connection?I'm using ADO in VB6 and i want to obtain @@SPIDThank uRob

View 1 Replies View Related

SQL Server 2012 :: Determine Which Column Is Causing Error Converting Data Type Varchar To Numeric?

Aug 14, 2014

I'm moving data from one database to another (INSERT INTO ... SELECT ... FROM ....) and am encountering this error:

Msg 8114, Level 16, State 5, Line 6
Error converting data type varchar to numeric.

My problem is that Line 6 is:

set @brn_pk = '0D4BDE66347C440F'

so that is obviously not the problem and my query has almost 200 columns. I can go through one by one and compare what column is int in my destination table and what is varchar in my source tables, but that could take quite a while. How I can work out what column is causing the problem?

View 3 Replies View Related

Float Type Steals My Decimal Points And Money Type Kills My Query

Mar 28, 2008

Happy Friday!
A while since I have posted a question, and this one is probably real easy.
I am trying to store numeric values from a php form in MSSQL 2000 database. However, the columns are set to float and if the value is 1.00, when entered into the table it is saved as 1

If I change the column type to money, the query fails, with an error message of conversion of datatype varchar to datatype money statement terminated.

anybody know what I need to do? do I need to do something in my query to specify that this is NOT varchar data?

View 2 Replies View Related

Sql Server 2000 - Spid Using Most Tempdb Space ?

Jan 29, 2008

Hi There

In Sql Server 2005 sys.dm_db_task_space_usage is great for tracking down temdb space issues.

I have tempdb space issues in sql server 2000, how do i get the same info in SS2000 ? IE: What spid is using the most tempdb space ?

Thanx

View 1 Replies View Related

SQL Server 2012 :: Adding Count To Query Without Duplicating Original Select Query

Aug 5, 2014

I have the following code.

SELECT _bvSerialMasterFull.SerialNumber, _bvSerialMasterFull.SNStockLink, _bvSerialMasterFull.SNDateLMove, _bvSerialMasterFull.CurrentLoc,
_bvSerialMasterFull.CurrentAccLink, _bvSerialMasterFull.StockCode, _bvSerialMasterFull.CurrentAccount, _bvSerialMasterFull.CurrentLocationDesc,
_bvSerialNumbersFull.SNTxDate, _bvSerialNumbersFull.SNTxReference, _bvSerialNumbersFull.SNTrCodeID, _bvSerialNumbersFull.SNTransType,
_bvSerialNumbersFull.SNWarehouseID, _bvSerialNumbersFull.TransAccount, _bvSerialNumbersFull.TransTypeDesc,

[code]...

However, as you can see, the original select query is run twice and joined together.What I was hoping for is this to be done in the original query without the need to duplicate the original query.

View 2 Replies View Related

SQL Server 2012 :: How To Pull Value Of Query And Not Value Of Variable When Query Using Select Top 1 Value From Table

Jun 26, 2015

how do I get the variables in the cursor, set statement, to NOT update the temp table with the value of the variable ? I want it to pull a date, not the column name stored in the variable...

create table #temptable (columname varchar(150), columnheader varchar(150), earliestdate varchar(120), mostrecentdate varchar(120))
insert into #temptable
SELECT ColumnName, headername, '', '' FROM eddsdbo.[ArtifactViewField] WHERE ItemListType = 'DateTime' AND ArtifactTypeID = 10
--column name
declare @cname varchar(30)

[code]...

View 4 Replies View Related

Am Using Sql Server 2005, Column Data Type Is Varchar, How To Write A Query To Sort

Aug 2, 2006

this data. need help
Sort following numbers by asc and desc order

Before query sort
-1.1
-8.8
-15.5
0.0
+0.5
+0.2

Sort asc
+0.5
+0.2
0.0
-1.1
-8.8

Sort Desc
-8.8
-1.1
0.0
+0.2
+0.5












View 5 Replies View Related

SQL Exception Generated By Server

Nov 11, 2006

HI all,
if this issue has been solved, please provide me the post, or I've put this issue in a wrong category please let me know.
The following is my code:
DateTime dtBFWNow = DateTime.Today;
String dtBFW_range1 = dtBFWNow.AddDays(-7).ToShortDateString();
String dtBFW_range2 = dtBFWNow.AddDays(3).ToShortDateString();
SqlDataSource1.SelectCommand = "SELECT * FROM [MORTGAGE] WHERE ([BringForwardDate] is not null) and ([BringForwardDate]>= '" + dtBFW_range1 + "' and [BringForwardDate] <= '" + dtBFW_range2 + "')";
lblHeader.Text = "Bring Forward Reminders Due From '" + dtBFW_range1 + "' To '" + dtBFW_range2 + "'";
lblHeader.ForeColor = System.Drawing.Color.FromName("#000000");
GridView1.DataBind();
When I compiled, the following exception occurred:
The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.
and the exception points right at the line: GridView1.DataBind() 
I use the webhost4life as my server provider.  My codes run fine with the server.  I mean I uploaded my program to the server, set up and run the program online, everything is fine. 
But on my PC it gives me the above exception.  I can't compile my code.  There must be some sort of setting somewhere in my PC that can't handle the exception.
Please help.
Regards.
Joey.
 

View 2 Replies View Related

How To Delete Job Generated From Master Server

Nov 12, 2001

Hi everybody.
Job was generated from from master server to run on target server
Target server does not exist any more
I want to delete this job but geeting error
"Error 14247 can't add ,update or delete job that generated from MSX server"

View 2 Replies View Related

Custom Auto Generated Sequences With Server?

Aug 31, 2014

can i create Custom Auto-Generated Sequences with SQL Server like DD-0001,DD-0002,DD-0003...... to DD-000........

View 1 Replies View Related

SQL Server 2012 :: Query To Get Min Value

Feb 7, 2014

Below is what I have so far Also I am getting other FRID besides 0 as well.

Select P.PartID, P.mansPart, P.Cost As PartCost, V.PartID, V.PartNo, V.price As VendPrice, M.title, C.CoName, P.FRID
From Parts As P
Right Join Vend2Part As V
On P.PartID = V.PartID And P.FRID = V.FRID
Left Join companies As C

[Code] ....

View 4 Replies View Related

SQL Server 2012 :: Query To Return Top 10 Tables On Each Database On Server?

Nov 21, 2013

i need a query to return the top 10 tables in each database on a server. have used EXEC sp_msforeachtable 'sp_spaceused ''?''' which returns what I need for one db but I need it to loop through and gather the info for all dbs on server. maybe need cursor not sure. for reporting reasons i would like to include the name of the server and name of database.

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved