Error Finding In SQL Server

Jul 20, 2005

hi,

Is there an equivalent function in SQL server as to MYsql's
mysql_error() for easy findings of SQL errors? Couldn't find it in the
manual.... If no : What if the recommended action to take?

My SQL statement DIE's when I use it on my php page, but works fine in
the MS SQL query analyzer.


obscurr

View 1 Replies


ADVERTISEMENT

Finding 'Error Column' Causing Error

Apr 16, 2007

Good Morning,



Am I new at this so please bear with me. I searched the site and found threads on identifying the meaning of an error code and have instituted that scripting. It is telling me that I have a 'The data value cannot be converted for reasons other than sign mismatch or data overflow.' error. It identifies the colum as 5301.

I searched the threads and found one telling me I could do an advanced editor search on the lineage id to find the column being referenced. I have traced the entire process using this information and cannot find a reference lineage id of 5301. Was that thread information accurate, and if so what do I do now? If not, can someone tell me how the heck I find column 5301? I cannot load my table from a flat file because of this.



Work so far:

I have checked for integrity between column definitions and source flat file. I applied derived column changes to make the data transform to the appropriate data type/order where necessary. This part works without error. (Or seems to, there is no error output from this piece.) It is only on the final attempt to load that the process errors with these messages.



Thank you in advance to anyone who can help me.



Rog

View 7 Replies View Related

Error Finding Identity Column

Jan 13, 2008

I'm using SQL 2005 Server Management Studio -
I go to the Northwind database - new query window and paste this code, I just found on this forum, to find the Identity column:SELECT C.name AS Colname, UPPER(U.name) AS Coltype, C.status AS Cstatus,   C.ColId, C.Id AS Cid, C.length, C.xprec, C.xscale  FROM syscolumns C   JOIN sys.tables O ON C.id = O.object_id  JOIN systypes   U ON C.xusertype = U.xusertype    WHERE O.name =  'Fred' AND C.status = 128  ORDER BY C.colid SELECT C.name AS Colname, UPPER(U.name) AS Coltype, C.status AS Cstatus,   C.ColId, C.Id AS Cid, C.length, C.xprec, C.xscale  FROM syscolumns C   JOIN sys.tables O ON C.id = O.object_id  JOIN systypes   U ON C.xusertype = U.xusertype    WHERE O.name =  'Products' AND C.status = 128  ORDER BY C.colid
However, I get an error message saying:Invalid object name 'sys.tables'.
What might I be missing here?

View 3 Replies View Related

Trace Logs And Finding Error Source

Apr 19, 2006

Hi All! Looking for some help with SQL errors.
We are using SQL 2005. Our server has been failing (service just stops responding) several times a week. We don't have a DB admin, just me, the developer, so please be patient.
I can view all the errors in the existing trace through the Profiler, but not sure how to follow error to query source.
How do you use the trace logs to find the problem query?
I have two significant errors in my logs. One is Hash Warning and the other is Missing Join Operand. I'm not interested in the general causes of these types of errors, that info has been easy to find.
I don't know how to link or otherwise associate a particular instance of an error in the trace logs to the query that caused it to determine the query that is causing the trouble.
The traces are already on the server. I've never created a new trace. I believe they are generated automatically by the server...
Can someone shed some light on how these existing traces are being generated and how I can modify them to include the data I need? When I open an existing trace on the server and view the properties, events tab, there appears to be no way to select the column "TextData" (no checkboxes) for the two errors we are seeing (listed above).
If the TextData column for the errors will allow me to see the offending query, can someone please tell me how to enable that column in my traces that are currently being generated on the server?
Thank you!
 
Drew

View 4 Replies View Related

Finding Sql Server Name

Sep 26, 2007

Is it possible to find the SQL Server Name in a DTS package using vbscript. Or is there any other way if not using vbscript. I am using SQL Server 2000.

Thanks!!!

View 1 Replies View Related

Finding The SQL Server Port

Feb 17, 2005

Hello. I'm a novice with SQL Server. I set up a SQL Server instance using Enterprise Manager and I want to find out what port that instance is listening to, because it's not listening to the default.

Is there a way I can specify a port for the server to listen to?

View 2 Replies View Related

Finding The SQL Server Port

Feb 21, 2005

Hello. I'm a novice with SQL Server. I set up a SQL Server instance using Enterprise Manager and I want to find out what port that instance is listening to, because it's not listening to the default.

Everything is on my local machine, this is a development database.

Is there a way I can specify a port for the server to listen to?

View 7 Replies View Related

Finding Out Sql Server Characteristics

Nov 5, 2006

Hi everyone, I'm a complete novice in databases :|
I have SQL Server 2005 Express Edition on my personal computer and need to connect to it through Java.
Therefore I need some information about it and don't know where to look. Some of them are:
=> the address of the server to connect to. This could be a DNS or IP address (I have installed the Server on my pc).
=> the instance to connect to (how can i find out where the instances are and which they are ?)
=> the port to connect to (i have no idea what this is at all)
=> the db is set to integrated security or do i have to give a username and password.
=> The name of the database to connect to (how can i find out which databases are available, if any)
note that there is no enterprise manager available. just a configuration manager, error and usage reporting, and surface area configuration.

many thanxs for reading my question.

View 3 Replies View Related

Finding The Licensing Mode For The Server?

May 8, 2000

Is there any way in which I can determine the licensing mode (per server/per seat and no. of licenses) for a particular server?

I have been working on this but no clues so far...

Thanks!
- Manoj

View 2 Replies View Related

Finding Books For SQL SERVER Replication

Oct 19, 2004

Hi,
I am new in this dbforums. i working on SQL SERVER REPLICATION. I need some books related to only SQL SERVER REPLICATION. If any body konwn then reply me

View 1 Replies View Related

Finding Installed MS Server In PCs Over Network

Dec 16, 2004

Hello y'all,
I am trying to find out if there is code to find out all the MS Servers installed over a Network.

Thanks

View 2 Replies View Related

Finding Installed MS Server In PCs Over Network

Dec 16, 2004

Hello y'all,
I am trying to find out if there is code to find out all the MS Servers installed over a Network.

Thanks

View 1 Replies View Related

Finding Port Of SQL Express Server

Jun 2, 2008

Hello,
Currently i have installed the SQL express server,how do i find out the port on which the
server is running.
regards
kaushik

View 1 Replies View Related

SQL Server Agent Not Finding The Package To Run

Nov 2, 2006

Hi, I have been searching through the posts hoping to find an answer to my problem. Most errors and problems seem to deal with Agent not being able to run packages because of permission issues.

My problem has to do with SQL Server Agent not finding the package to run. I have a proxy with a high enough level of permissions (SqlAgentOperatorRole).

The error message I get is:

Executed as user: ___/____. The package could not be found. The step failed.

The package is in a folder on our network. When I create the step I use the browser to go find and select the package. So why does it not find it at runtime? I can run it manually

My group is using 2005 for the first time. Any help you can provide would be very much appreciated.

Ricardo

View 8 Replies View Related

SQL Server - Finding The Different Records In Two Identical Tables

Jul 30, 2007

Does anyone have a good query that would return records from two tables that are found in one, but not it the other table?  In my situation I have 2 tables that are duplicate tables and I need to find an additional 3000 records that were added to one of the tables.  I also have a composite key so the query would have col1, col2 and col3 as the composite key.  So far I have tried concatenating the 3 columns and giving the result an alias and then trying to show the ones that were not in both tables, but have been struggling.  Thanks.. 

View 4 Replies View Related

SQL Server 2012 :: Finding Dependencies Of Objects

Dec 27, 2013

I need to do some clean up activities in my databases... So i intended to drop unwanted tables and views.

for that I need to find, whether the table being used by any other objects ?

How could I achieve it?

View 2 Replies View Related

SQL Server 2012 :: Finding Break In Sequence

Feb 21, 2014

I need to be able to identify breaks in a sequence so I can evaluate the data more correctly. In the sample I have given I need to be able to identify the break in sequence at 69397576, ideally I would set that as a D. My query also needs to recognize that the 3 sequences following 69397576 are sequential and would belong to that set. so the out come would look like this.

id file_name page_follow
693975631555557564_22222221114014810D
693975641555557564_22222221114014810F
693975651555557564_22222221114014810F
693975661555557564_22222221114014810F
693975671555557564_22222221114014810F
693975681555557564_22222221114014810F
693975691555557564_22222221114014810F
693975761555557564_22222221114014810D
693975771555557564_22222221114014810F
693975781555557564_22222221114014810F
693975791555557564_22222221114014810F

here is some test data.
create table test1 (id INT
, [file_name] VARCHAR(100)
, page_follow CHAR(1));
go

[code]....

View 9 Replies View Related

SQL Server 2012 :: Finding Breaks In Key Values?

Jun 12, 2014

The following is sample data I am dealing with.

SELECT * INTO TEMP
FROM
(SELECT 'AAAAA' AS CATEGORY, 'A1000' AS CODE, '01-01-2014' AS STARTDATE, '01-31-2014' AS ENDDATE
UNION
SELECT 'AAAAA' AS CATEGORY, 'A1000' AS CODE, '02-01-2014' AS STARTDATE, '02-28-2014' AS ENDDATE
UNION
SELECT 'AAAAA' AS CATEGORY, 'A1000' AS CODE, '03-01-2014' AS STARTDATE, '03-31-2014' AS ENDDATE
UNION
SELECT 'AAAAA' AS CATEGORY, 'A2000' AS CODE, '04-01-2014' AS STARTDATE, '04-30-2014' AS ENDDATE
UNION
SELECT 'AAAAA' AS CATEGORY, 'A1000' AS CODE, '05-01-2014' AS STARTDATE, '05-31-2014' AS ENDDATE) X

I need to extract the date that the value in CODE column changes to another code for each value of CATEGORY and if there is no change, to record the original CODE value and its startdate for each CATEGORY.

View 3 Replies View Related

SQL Server 2012 :: Finding First And Repeated Values

Aug 26, 2014

I'm trying to come up with a query for this data:

CREATE TABLE #Visits (OpportunityID int, ActivityID int, FirstVisit date, ScheduledEnd datetime, isFirstVisit bit, isRepeatVisit bit)

INSERT #Visits (OpportunityID, ActivityID, FirstVisit, ScheduledEnd)
SELECT 1, 1001, '2014-08-17', '2014-08-17 12:00:00.000' UNION ALL
SELECT 1, 1002, '2014-08-17', '2014-08-17 17:04:13.000' UNION ALL
SELECT 2, 1003, '2014-08-18', '2014-08-18 20:39:56.000' UNION ALL

[Code] ....

Here are the expected results:

OpportunityIDActivityIDFirstVisitScheduledEndisFirstVisitisRepeatVisit
110012014-08-172014-08-17 12:00:00.00010
110022014-08-172014-08-17 17:04:13.00001
210032014-08-182014-08-18 20:39:56.00001
210042014-08-182014-08-18 18:00:00.00010

[Code] ....

Basically I'd like to mark the first Activity for each OpportunityID as a First Visit if its ScheduledEnd falls on the same day as the FirstVisit, and otherwise mark it as a Repeat Visit.

I have this so far, but it doesn't pick up on that the ScheduledEnd needs to be on the same day as the FirstVisit date to count as a first visit:

SELECT*,
CASE MIN(ScheduledEnd) OVER (PARTITION BY FirstVisit)
WHEN ScheduledEnd THEN 1
ELSE 0
END AS isFirstVisit,
CASE MIN(ScheduledEnd) OVER (PARTITION BY FirstVisit)
WHEN ScheduledEnd THEN 0
ELSE 1
END AS isRepeatVisit
FROM#Visits

View 3 Replies View Related

SQL Server 2008 :: Finding Column Within All Tables In DB

May 1, 2015

I am trying to find a way where I can search for a column that is associated in all tables of the database. I have created a query but is not executing correctly.

SELECT t.name AS table_name,
SCHEMA_NAME(schema_id) AS schema_name,
c.name AS column_name
FROM sys.tables AS t8
INNER JOIN sys.columns c ON t.OBJECT_ID = c.OBJECT_ID
WHERE c.name LIKE '%Status%'
ORDER BY schema_name, table_name;

View 3 Replies View Related

SQL Server 2008 :: Finding Permissions That A User Have

May 4, 2015

Is there anyway to find the permissions assigned to user. What level of access the user has in each db and the tables & is he able to see jobs. Each object and permissions

View 6 Replies View Related

SQL Server 2008 :: Finding Tables With No Createdate?

May 4, 2015

In our Production db we have all most all tables have the column created or createdate.

I need to find out all tables without the created or createdate column

SELECT t8.name AS table_name,
SCHEMA_NAME(schema_id) AS schema_name,
c.name AS column_name
FROM sys.tables AS t8
INNER JOIN sys.columns c
ON t8.OBJECT_ID = c.OBJECT_ID

[code]....

View 2 Replies View Related

SQL Server 2008 :: Finding All Relations Between Tables?

Sep 1, 2015

Below I have a query which list the relations (constraints) between tables.

I want to list all the relations which are visible in the Database Diagrams.

The list is not complete. How do I get a complete list ?

--
-- Query to show the relations (constraints) between tables.
-- This does not show the complete list
--
SELECT A.constraint_name,
B.table_name AS Child,
C.table_name AS Parent,

[Code] ...

View 4 Replies View Related

Finding Port Number In SQL Server 2005

Feb 13, 2008

I know the ..Program FilesMicrosoft SQL ServerMSSQL.1MSSQLLOGErrorLog on the server contains the information. But that needs I to RDP to the server or open the file remotely. Is there any other way to find out the port from my SSMS connection?

I remember in SQL Server 2000 you could find the information by choosing Properties of a connection in EM and click on the Network Configuration button. (I know it works when you are ON THE SERVER! But when I tried from my desktop, pressing the button didn't do anything)


Canada DBA

View 2 Replies View Related

Finding SQL Server Performance Throughput Load

Aug 31, 2007

Hello!! guys..

I am using sql server 2005 enterprise edition in the clustered environment with netapp storage (one server) I monitor the server performance, basically using windows performance monitor counters such as avg.disk queue length,avg. disk reads/sec, avg disk writes/sec, processor time, available memory Mbytes, cache hit ratio etc. and using some sql server dmvs .

At this point all looks good.

My problem i dont know how much load sql server can handle more .How much it being utilized now? whehet it has reached its limits...how do i know it is just about to reach its linits??

how much throughput sql server is handling at present, how much more it can handle if incoming traffic increases.

Basically i want to find performance baselines , how much more it can handle so that i can plan for the future ..

How do i measure all this?
what are different methods available if i want to handle increased incoming traffic? (e.g. adding multiple servers etc.)
It will be really great if someone can share his experience on this..

Is there any article/white paper on this ..

Any suggestion/help appreciated

Thanks

View 1 Replies View Related

Urgent: Finding Sessions In SQL Server 2000

Feb 9, 2006

Hi,

Can you help me how to find out sessions in SQL Server 2000.

Also is there any way to see the outstanding sessions for a database?



Thanks in advance,

Vasu.

View 4 Replies View Related

Finding All SQL Users Permissions And Access On Every Server And DB?

Sep 18, 2007



Hello team, I have learned quite a bit from everyone here. I have decided to post a question for you guys and see what the best method is. Our Sr. DBA has asked me to get a list of all of our users permissions on all of our databases. We have about 20 SQL servers some of which have more databases and instances than I have fingers and toes. Can anyone recommend any solution to this problem? Perhaps there is a script I can download/write which will help me on this? Thanks in advance.

View 10 Replies View Related

SQL Server 2012 :: Finding Unused Stored Procedures

Mar 3, 2014

How do you find stale stored procedures ?

In a scenario where a developer created a slight modification of a stored procedure because he was afraid of breaking something else and took the easy way out, and a few more later down the line, multiple versions of a stored proc. doing slightly different things are just laying around.

"Last used" would be useful piece of information to determine the most recent date a stored procedure was called, either by the application itself or by another stored procedure itself called by the application.

Any stored proc not used for more than say 6 months would then be identified as a candidate for clean-up.

So - short or creating - after the fact - a trigger to update the usage date upon each call - which means a lot of work and no result for the next six months, how can one go about this ?

And could this be done in SS2K8 ?

View 5 Replies View Related

SQL Server 2008 :: Finding Only Fields That Don't Match In Two Different Tables

Feb 12, 2015

I have two table People and Employee, both have firstname and lastname as fields

I want to display only the names that don't match on firstname and lastname

View 3 Replies View Related

SQL Server 2008 :: Finding Database Connections Not Visible

Jul 15, 2015

I need to find a way to identify SPIDS where queries are connected to certain databases using the 4 dot notation instead of actually being connected to the database in question.

For instance, I connect and my default database is MASTER. In MASTER, instead of typing USE MyDb ahead of my query, I just type my query as:

SELECT Col1, Col2
FROM MyDB.dbo.MyTable

The above is the simple scenario. We usually have queries connecting 3 or 4 user dbs together. So database1 might have a query pointing to database2. What I need is a way to identify the SPIDS that are connecting to database2 despite being in database1.

View 4 Replies View Related

SQL Server 2014 :: Finding NULL In CASE Statement

Sep 15, 2015

The below code returns a NULL for all the Differential backups. I am trying to return the word Differential when there is a NULL because I can tell from when the NULLs occur that those are my differential backups. How can I get the result I want?

SELECT
CONVERT(CHAR(100), SERVERPROPERTY('Servername')) AS Server,
msdb.dbo.backupset.database_name,
msdb.dbo.backupset.backup_start_date,
msdb.dbo.backupset.backup_finish_date,

CASE
WHEN msdb..backupset.type = 'D' THEN 'Database'

[Code] .....

View 9 Replies View Related

DB Engine :: Finding User Who Updated The Table Last In Server?

Sep 22, 2015

How can i find the users of the table who updated it last (or) Owner of the table not the schema

View 4 Replies View Related

SQL Server 2012 :: Select Statement - Finding Duplicate Records

Feb 18, 2014

I am trying to build a select statement that will

1). find records where a duplicate field exists.
2.) show the ItemNo of records where the Historical data is ' '.

I have the query which shows me the duplicates but I'm stuck when trying to only show records where the Historical field = ' '.

Originally I thought I could accomplish this goal with a sub query based off of the original duplicate result set but SQL server returns an error.

Below you will find a temp table to create and try in your environment.

create table #Items
(
ItemNovarchar (50),
SearchNo varchar (50),
Historical int

[Code] ....

Ultimately I need a result set that returns 'ATMR10 MFZ N', and 'QBGFEP2050 CH DIS'.

View 3 Replies View Related







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