I've query executing ~2 secs in MSSMS (returning 25K of rows)
Same query used in .NET (sqlReader) exetuting few minutes!
I've also tried to execute only reader
(commented all code in while loop just leaving reader.Read() ) - still same!
Any idea what's up?
...
How are CLR (.NET) objects managed in SQL Server?
The entry point to any CLR code from SQL Server is a static method. Typically you'll only create objects that exist within the scope of that method. However, you could conceivably store references to objects in static members, letting them escape the method call scope. If SQL Server ret...
Hello everyone! I am making an SQL database that stores contacts. I want to be able to delete contacts, and the correct id for each contact is crucial for my software connecting to it. Lets say I have contact James and he is the first one. His id is 0. I add Mary and her id is 1. If I delete James, how can Mary's id be set to 0 instead o...
When using SqlCommand to execute a non-query (such as a database restore), is it possible to programatically get the text that would normally be posted to the "Messages" tab if using the Management Studio? And if so how?
...
I'm using the export data wizard in sql server 2005.
I've got a table with null values in many of the fields. I'd like to keep these fields as I export to .csv but they are being replaced with empty strings.
I've tried changing the 'nullable' checkbox for the fields in the wizard, but that doesn't seem to do anything. Also tried usin...
Is there to way write a T-SQL command to just make it sleep for a period of time? I am writing a web service asynchronously and I want to be able to run some tests to see if the asynchronous pattern is really going to make it more scalable. In order to "mock" an external service that is slow, I want to be able to call a SQL server with...
Can anyone please send me the script to delete the old backup files greater than 2 days from the disk automatically? I am using SQL Server 2000.
...
I have the following code:
sql =
"select distinct [name] from tblCustomers left outer join tblCustomerInfo on tblCustomers.Id = tblCustomerInfo.CustomerId
where (tblCustomer.Name LIKE '%@SEARCH%' OR tblCustomerInfo.Info LIKE '%@SEARCH%');";
using (SqlCommand command = new SqlCommand(sql, Connection))
{
c...
We have combined primary key with fields no, id and groupno
From Access, a WHERE condition such as WHERE no = '' & groupno = '' executes faster while the same thing slows down updates in SQL.
Once we have provided individual index of no & groupno, will it be faster?
Does it consider it as a combined key if we provide primary key with ...
i'm new to silverlight and i'm porting from asp.net 2.0. I have done many data binding applications in asp.net where i use sql server 2005 and use it's tables and access them via sqlconnection object and perform all kind of database related functions. Can any one tell does silverlight 2.0 supports such kind of facility. If so can i use a...
I'm using one SP performing all CRUD operations
So, basically I'm executing same SP depending what action necesary:
eg
-- for select
exec USP_ORDER @MODE='S', @ORDER_DATE='2009/01/01'
-- for update
exec USP_ORDER @MODE='U', @other_params
-- for insert
exec USP_ORDER @MODE='I', @other_params
-- for delete
exec USP_ORDER @MODE='D', @ID=1...
Hi there.
I'm experimenting with CTE's in SQL Server but have reached a dead end with getting the following scenario to work. I have a hierarchy table similar to this:
Node(ID:439)
Node(ID:123)
Node(ID:900)
Node(ID:56)
Node(ID:900)
Expected results:
NodeID ParentNodeID
439 0
123 439
900 123
56 439
90...
I have a database in which the main table has a really badly named primary key field which I want to rename. This primary key field is referenced by about 20 other tables and about 15 stored procedures.
What is the easiest way to rename this field everywhere it is referenced throughout the database?
...
i want to learn everything from scratch about reporting server,,can you tell me the practical steps needed for that,,,Is there any video tutorial for studying about that
...
Hi all
I need to create a new db in Sql Server, and move some data from an Oracle db to this Sql Server db; I read that this function can be implemented by using SSIS or the SQL Server Migration Assistant for Oracle; I wonder if someone can point me to a tutorial or a document where I can see how this task is performed step by step
The ...
I'm currently experiencing some problems on my DotNetNuke SQL Server 2005 Express site on Win2k8 Server. It runs smoothly for most of the time. However, occasionally (order once or twice an hour) it runs very slowly indeed - from a user perspective it's almost like there's a deadlock of some description when this occurs.
To try to work ...
Given a typical 3 tiers app deployed at two remote sites. The db behind the two installations contains exactly the same structure and same data. There needs to be a replication mechanism between the two backend db to keep them in synch. The native replication feature of SqlServer would do the job. However, the business layer of the app k...
As far as I know, in MS SQL Server 2000+ stored procedures are compiled, and run faster than normal non-compiled queries. I wonder if MS SQL Server also compiles LINQ to SQL queries, and caches that compilation, for performance purposes.
...
I have a query that looks like this:
SELECT OrganizationName, OrganizationID, ReceivableStatus, InvoiceFee
FROM v_InvoicesFreelanceOutstanding
ORDER BY OrganizationID
The data from that might look like this:
OrganizationName OrganizationID ReceivableStatus InvoiceFee
--------------------------------------------------...
Hi All,
I've inherited a less-than-ideal table structure, and I'm trying to improve it as much as I can without tearing down and rebuilding. There's currently at least two levels of data for everything, the legacy data and the marketing override data. I'm trying to find all the records within the legacy data that don't yet have a mark...