Sp_columns Slow

Dec 3, 2007

In SQL 2005, I'm getting very slow response times with sp_columns. It takes
around 8 seconds to return the results of calling sp_columns.

Any ideas?

Thanks

-Dave

View 3 Replies


ADVERTISEMENT

Sp_columns Not Returnign Anything

Oct 13, 2006

Greetings all. I have a bizarre problem. I'm using sp columns to generate an html table with the field information of certain tables in my database. The table names are stored in an SQL Table called 'Manage_Tables' and I have 9 tables shown there. 6 out of the 9 are displaying correctly but the other 3 arent and the problem is coming from teh sp columns procedure that is returning nothing. why does this happen? all the tables are the same and have been created on teh same day by the same user with the rame rights and I have admin rights. Any clue?

View 1 Replies View Related

How To Get One Column From Sp_columns

Feb 27, 2008

Hi,
When I run sp_columns @table_name = someTable, I get many columns like TABLE_QUALIFIER, TABLE_OWNER and so on.
Is there a easy way to get only a COLUMN_NAME column?
Thanks 

View 2 Replies View Related

Underscore & Sp_columns ?!!

Oct 9, 2000

Hi friends,

I got troubles when I tried to pass table name to sp_columns via
@local_variable:

declare @tname as char(50)
set @tname = 'TB_MyTable'
exec sp_columns @tname

result of such script is:

TABLE_QUALIFIER ...[skipped]
-----------------------------------
(0 row(s) affected)

But if I will say:

exec sp_columns 'TB_MyTable'

result will be correct (all neccessary data about columns will be provided)

So, looks like if I pass table name which contains underscore via
@local_variable or SP parameter - result will be wrong.
If table name won't contains underscore - everything works fine and result
of script:

declare @tname as char(50)
set @tname = 'MyTable'
exec sp_columns @tname

will be absolutely correct.

Please, anybody can clarify this situation ???

Thanks in advance,

Michael

View 2 Replies View Related

Sp_columns Into A Variable

Mar 23, 2004

Hello,
I'm using sp_columns and would like to stock the result recordset into a variable (or simply get only the column name into a table variable in sql)

Is there any way to select only the column name and put it into a table variable ?

Thank

View 2 Replies View Related

Using Sp_columns Stored Procedure Trouble

May 12, 2005

Hello,

I'm trying to use the "sp_columns" stored procedure to pull in some
information about a table in my db, but I'm continuing to get the same
error:

ERROR [42000] [Microsoft][ODBC SQL Server Driver][SQL Server]Procedure
'sp_columns' expects parameter '@table_name', which was not supplied.

I'm not sure why, but I've re-written my code several times and can't
figure out just why this error is happening.  Here's a snippet of
the code:

Private Function GetDataType(ByVal columnName As String, ByVal table As String) As String
        Dim con As New
OdbcConnection(ConfigurationSettings.AppSettings.Get("LiquorLiabilityConnection"))
        Dim com As New OdbcCommand("sp_columns", con)
        com.CommandType = CommandType.StoredProcedure

        Dim param As New OdbcParameter("@table_name", table)
        param.OdbcType = OdbcType.VarChar
        com.Parameters.Add(param)

        param = New OdbcParameter("@column_name", columnName)
        param.OdbcType = OdbcType.VarChar
        com.Parameters.Add(param)

        Dim dr As OdbcDataReader
        Dim name As String

        con.Open()
        dr = com.ExecuteReader() 'THIS TRIGGERS THE ERROR
        While dr.Read
            name = dr("TYPE_NAME")
        End While
        dr.Close()
        con.Close()

        Return name
    End Function

Any suggestions would be appreciated.

View 3 Replies View Related

Store Return Result From Sp_columns

Oct 31, 2007

I excute sp_columns in my Stored Procedure script to get the data type of a table column.
EXEC sp_columns @table_name = 'XXX', @column_name='YYY'
How do i store the column 'TYPE_NAME' in the return row into a variable so that i can use it later in my stored procedure?
Thanks
Hannah

View 1 Replies View Related

Export Sp_columns Result Into A Temp Table?

Mar 1, 2004

Can anyone show me the syntax for exporting the result of sp_columns into a new table?

I've tried using "SELECT EXEC sp_columns...INTO 'column_info'" but I keep getting syntax errors that are unclear to me.

Any help would be greatly appreciated.

ab

View 3 Replies View Related

Sp_columns In SQL2K5 Gives No Rows For Function That Return Table

May 9, 2006

Some automated tools use sp_columns to find out the columns for a table, view or UDF that returns table.

In SQL Server 2000 it gives columns back but in SQL Server 2005 it does not, compat level set at 80 and 90.

Does anyone have an idea what id going on here?

Repro script below. I expect the script to return information about the two columns in the table defined in fnTestColumnsFromFunctions().

if exists (select 1
from sysobjects
where id = object_id('dbo.fnTestColumnsFromFunctions')
and type in ('IF', 'FN', 'TF'))
drop function dbo.fnTestColumnsFromFunctions;
go

create function dbo.fnTestColumnsFromFunctions()
returns @TestTable table
(
ttID int,
ttName varchar(50)
)
as
begin
return;
end
go

declare @dbname sysname;
declare @n int;
set @dbname = db_name();
exec @n = dbo.sp_columns
@table_name = 'fnTestColumnsFromFunctions',
@table_owner = 'dbo',
@table_qualifier = @dbname,
@column_name = null,
@ODBCVer = 2;

if exists (select 1
from sysobjects
where id = object_id('dbo.fnTestColumnsFromFunctions')
and type in ('IF', 'FN', 'TF'))
drop function dbo.fnTestColumnsFromFunctions;
go

View 7 Replies View Related

Why So Slow?

Nov 13, 2003

I am writing a data access web page, but I find that the excution speed is too slow.
My data base is just a data table which have five columns: id, code, quantity, price and Date. The data base has about 45000 rows. When I use OSQL or Query function, speed is just fine.

Here is the main code which I think cause the speed slow:

string conn = ConfigurationSettings.AppSettings["connectionstring"];
SqlDataAdapter adapter_2 = new SqlDataAdapter("select * from table",conn);
DataSet ds = new DataSet();
adapter_2.Fill (ds,"table");
DataTable YahooOrders = ds.Tables["YahooOrders"];
DataRow[] product = new DataRow[20000];

.......

foreach (string s in split) // actually the split here has only one string in it
{
product = table.Select ("code like '"+s+"%' and Date >='"+minDate+"' and Date <='"+table.Select("Date = Max(Date)")[0][1].ToString()+"'");
foreach(DataRow myRow in product)
{
int count = Convert.ToInt32(myRow[2]);
itemQuantity = count + itemQuantity;
revenue = Convert.ToDouble(myRow[3]) * count + revenue;

// get product code, ignore repeated code
int myIndex=code.BinarySearch( myRow[1] );
if ( myIndex < 0 )
code.Add(myRow[1]);
}
orderQuantity = product.Length + orderQuantity;
}
The first foreach actually excutes just one time, so it won' t cause any speed problem.
The second foreach' s job is to sum each column of specified rows which is product here.
So, any ideas about this?
Thanks!

View 8 Replies View Related

Too Slow

Mar 8, 2001

All,

Actually from the application the developers are using count(column) to know the no. of rows resulted by a statement which joins many tables but its taking lot of time.

Is there an easy way to get the count of records(result set) of the output.

I cant use sysindexes b'z i need the count of the output genereted by the SQl Statement which joins many tables and retrieves many rows.

Thanks,
Sajai

View 2 Replies View Related

MS SQL Slow Down

Mar 24, 2006

Hi fellas (and girllas),

Got a problem (duh!). My MSSQL Server lags. Now, mind, it doesn't lag all the time. And it seems to be independent of the # of users trying to access the server. And it random clears itself up. And the problem doesn't present itself in SQL MGR, just on the web app we're running on it.

Setup:
SQL Server 2k running on 2k3 w/ IIS & backup exec.
All SQL data files are on a raid5 SCSI U160.

App:
Intranet App developed by us for us. ASP.NET & VB.NET.

Symptoms:
When queried server takes a LONG time to respond. So long infact it has become counter productive. When taking a look at the server, the CPU usage hovers between 50-75% and spikes up to 90% every now and then just for kicks. The memory usage is 2.35gb out of 4gb. To fix this we have to kill and restart all the SQL services.

Any thoughts on what to look at? There're indexes on the required FKs and the heavily queried columns. We're at a loss here.

Thanks for any helpful help!

=Me!

View 3 Replies View Related

MS SQL Very Slow

Apr 7, 2006

Database has its few HUGE tables, but I experienced queries against few other very small tables to be incredible slow.

Anybody has the same or similar problem?

View 1 Replies View Related

App Slow.

Apr 15, 2008

A vendor's application is performing slow. Vendor tested it in QA and it's slow. End-users run it in PRD and it's slow. The application calls SP1, and SP1 calls SP2. Inside SP1 has a cursor. I believe as the db gets larger. The application is going to be even slower. What can I suggest to the vendor in order to fix it? Tell them to re-write the application code? Eliminate cursor?

Thanks

View 9 Replies View Related

Why Is My CTE Very Slow ?

May 27, 2008

Hello,

I have 4000 record in my table employee. it takes 13 sec to get data. It this normal ? What is wrong ?

Thanks

Code Snippet

CREATE FUNCTION [dbo].[VrniStrukturo] (@id_sod int)
RETURNS TABLE
AS
RETURN
(
WITH tree(id, parent_id, naziv, nivo) AS
(
-- Base case
SELECT
id,
parent_id,
naziv,
1 as nivo
FROM employee
WHERE id = @id_sod

UNION ALL

-- Recursive step
SELECT
e.id,
e.parent_id,
e.naziv,
eh.nivo + 1 AS nivo
FROM employee e
INNER JOIN tree eh ON
e.parent_id = eh.id
)

--SELECT *
SELECT id
FROM tree
--ORDER BY nivo, priimek, ime
);

View 5 Replies View Related

Our DB Becomes Slow Sometimes

Sep 13, 2006

There re certian times when I want to execute a sql request (select for example) then It gets too long before I get an answer. (that happens only some times exceptionnaly). What does that mean, is it that somebody is using heavily the DB or may be using Entreprise manager or what exactly
and how can I know who is responsible for taking all SQL server resources at that specefic time. What command or what tool can I use pls for this purpose.
Thanks for your help.

View 9 Replies View Related

Slow DTS

Aug 20, 2005

Hello,Were using the data transfermation service to copy in an Ingres II 2.5database to an SQL Server 2000 database. Small databases don't present anissue, but when pulling one across that's about 20GB its been taking between12 and 24 hours. Both systems are relitively quick boxes and neither of themare tapped out on processor, disk I/O or network resources.I do have the "Boost SQL Server priority on Windows" checked under it'sproperties and all the processors are checked to be used.Does anyone know if there's a way to tweak SQL Server or Ingres to handlethis a little quicker? Or even an idea where the bottleneck could be may behelpful.Thanks,John.

View 1 Replies View Related

Slow CLR TVF

Nov 20, 2007

I've got a performance question about a clr tvf that I have created. When I query the function it takes about 30 seconds for it to execute as apposed to < 6 seconds when I execute the same code in a console app (the 6 seconds includes outputting the returned data to the console, without writing the output to console it executes in about 1 second). Both the function and the app are iterating (>40,000) and returning ( >10,000) the same number of rows. I've noticed the following when viewing the executions in the PerfMon:

* the sqlclr tfv kicks the % Processor Time up to 30 for 30 seconds, the console app has % Processor Time at 9 for about 2 seconds
* .NET CLR Memory - Allocated Bytes/sec spikes anywhere from 1 to 3 times during the sqlclr query at about 44MB/sec. It barely registers if at all when the console app runs.
* In either case, % Time in GC is at zero.

I'm assuming that there are some configurations I'm ignorant of that can help me tune the execution. I can't imagine that it takes SqlServer that long just to iterate through the records.

View 4 Replies View Related

Dog Slow

Jul 17, 2007

I have recently decided to make the change from Microsoft access to SQL Server believing that it's a bigger faster beast with better parameterized queries and triggers and all that. BUT.I have some client data that I imported from their original paradox files.The invoice lineitem file contains over 1 milliion records.When I open this table in access and click show last record, the record is displayed in about 1 or 2 seconds.I used the upsize to SQL Server tool in Access to shift my data into SQL Server.When I use the Express Mangagement tool to open the same table and say show me the last record, it takes 17 minutes.I admit that most numeric data types have been translated to floats, so that's probably not good.But I cant alter them from floats to numeric or decimals using the table design tool.Do the conversion anomalies make up the whole reason why SQL Server seems so incredibly SLOW! ?????????

View 2 Replies View Related

BCP Out Slow?

May 1, 2007

I am running the following BCP to extract a table with 156641604 rows.



bcp TestDB..data out test3.bcp -T -b1000000 -a32000



When running this i notice that the disk read bytessec counter in performance monitor on the drive that has the database devices is only reading 30mbsec. I am writing the bcp file to a different drive. Both drives are far more capable of achieving much higher IO. Is this a limitation with BCP or are there futher switches available that would speed this process up. Also the drives are both local so the bottle neck is not network. Any ideas?

View 5 Replies View Related

My Sql Express Is So Slow?

Aug 25, 2006

Has anyone else noticed delays with SQL Express? I'm not really talking about delays on the queries but just delays in general response. For example: everything is running great, then for about 2 minutes I get connection timeouts etc can't even open stuff in the management studio without getting timeouts ... then as strangely as it started everything goes back to normal and requests are served again.
The server has nothing on except 1 website, its Win 2003 Server. 512MB Ram on a PIV. The memory usage is low and during the "lockups" the machine isn't showing any processor usage and SQL mem usage is around 40Megs.
I am not using User Instances either. Nothing in the event logs. What is odd, is its happening on 3 of my machines ..... all with different sites, the only thing in common between them is SQL.
thanks,
-c

View 1 Replies View Related

VERY Slow SQL Query

Mar 8, 2007

This sounds like a pretty easy one.  I have a SQL 2000 database with 2-3.4GHZ CPUs and 1GB of RAM.  I have one database on it.  I go in Query Analyzer on another machine and run a simple query like 'SELECT * FROM USERS'  which should return 15,000 rows. 
 
IT takes 30 (thirty) seconds to finish this query.  OMG
 
Where do I start to decipher why on Earth this takes more than .01 seconds?
 
Thanks.

View 8 Replies View Related

Slow Performance

Mar 24, 2007

Hi all...
 
I  need urgent help, about someting:
i've developed and deploy an aspnet web site (data works with sqlserver), but after a few minutes working with some users, the permormance slows and  stop the site.
 
please help me what should i do......

View 3 Replies View Related

Application Is Very Slow

Oct 7, 2007

 Dear All,Finally I completed my project. Thanks all you helped me to do it.Now I have the biggest problem. In my application the Data grid is filled with Data from SQL server table which has large number of records. When I run my queries in SS Management Studio it runs very fast. To fill data to datagrid it takes lots of time. How can I reduce this time. How can I increase the performance of my Application.Thanks,Janaka   

View 4 Replies View Related

Very Slow Connection

Mar 5, 2002

Hello,
We have Sql Server installed on the Windows 2000 machine.
There are 2 databases that the employees access on it.
When the machine is just started, there are no problems but after some time the connections get really really slow and then eventually become impossible to connect. We did not have this problem before until we had a computer crash and then Sql server was installed on a new machine. The problems started here. We had 64mb of ram and we put in another 64mb thinking this would solve it but it did not.
On the task manager the cpu percentage stays constant at 100% and the virtual memory increases and increases very slowly until it has reached it's maximum (which is 600mb).
Any information would be greatly appreciated.
Thanks very much,
Kostas

View 1 Replies View Related

Slow Query?

Mar 16, 2001

Hi,
I have a query which has suddenly started responding slow.
CAn anyone tell me what could be the possibilities?
I tried update stats(I am on sql 70-though it's done auto but i did it manually again)
I used union all in place of union but had no big effect.any othe thought?
Thanks!

View 4 Replies View Related

Slow Queries

Mar 15, 2001

Hi,
Some of my queries are running too slow.It's taking as long as 30secs .Earlier the same query was taking less than 5 secs.
I understand the db has grown BUT I do not know to look at this query where should i start from and what should I look into.
It is on production server.
the db size is 15GB and unallocated is 9GB.
log space used is 4%.
TIA.

View 1 Replies View Related

Backups Slow After SP3

Aug 6, 2001

After I installed SP3 on a production SQL box, backups are a lot slower. Anybody have any suggestions?


Thanks in advance
Joe

View 1 Replies View Related

SQL Agent Job Very Slow

Jul 21, 2000

I am configuring a new Server running SQL Server 7.0 sp2.
I have a job that runs a large process. From the SQL Agent job, the processing time is over 8 hours. If I run the same process from a query window, it takes an hour and a half. On my 6.5 database, the job takes 2 - 3 hours from the scheduled task. What is going on with SQL Agent? I have not been able to find any information on memory and SQL Agent.
Any help would be greatly appreciated!
Thanks
Trina Blazek

View 2 Replies View Related

DTS Running Too Slow

Aug 8, 2000

I have a dts job set up to transfer 550,000 records from a dbf file into a sql server. If I just let it run, there is a 9-10 minute delay, then it starts. If I try to schedule a job, it fails completely. I looked up ways to get it to execute quicker, mainly going to the advanced tab of the transform arrow and making the inserts 1000 at a time, the table locked, turning constraints off. Any advice on how to speed it up or why the job is failing?

View 7 Replies View Related

Slow Performance Using DTS Sql 7

Mar 30, 2000

I need to transfer a database from one server to another, I'm using the DTS utility because the servers have different sort orders. our database size is about 5GB which include about 2500 tables. Using DTS is taking many hours to transfer all objects and data. is there a better/faster way to do this?
Any help would be appreciated, Thank you

View 3 Replies View Related

Backup To Slow

Jan 10, 2000

Hi,
Does any one have an idea why the backup to disk it takes 6 Hrs and to Tape it take 1 Hr.? Also what will be the diference
bettewn creating the a backup device and just creating the file on the fly when I setup the backup?
Thanks Felix.

View 2 Replies View Related

A Very Slow Query

Oct 12, 2000

Hi,

I have a query that takes minutes to execute, even through there are about 300,000 records are being processed. I would appreciate any help with optimizing that query.
I have two tables: User and Usage. Table user has two fields: User_Id and Date_Created and a non-clustered index on User_Id. Table usage has two fields also: User_Id and Date_Used and non-clustered index on both fields. The User table is populated when the user registers. The Usage table is populated every time the user opens a document.

Here is what I need to do: get the number of users from the Usage table who opened a document at least once after they have registered during the last 30 days for each day in the time frame, where the time frame varies.
For example, if the time frame is 8/01/00 - 8/31/00, I need to get the following data:

date returns
---- -------
8/01/00 10 (10 users returned to the document between 7/2/00 and 8/1/00)
8/02/00 15 (15 users returned between 7/3/00 and 8/02/00)
.
.
.
8/31/00 20 (20 users returned between 8/1/00 and 8/31/00)

Here is my query:

SELECT [date],
(SELECT count(distinct user_id)
FROM usage u JOIN [user] ON u.[user_id] = [user].[user_id]
WHERE u.[date] BETWEEN usage.[date]-30 AND usage.[date]
AND u.[date]>[user].date_created
GROUP BY usage.[date])returns
FROM usage
WHERE [date] BETWEEN @date1 AND @date2

This query works fine, but too slow. We use MS SQL server 7.0.

Thank you,
Yana

View 2 Replies View Related







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