I have a Winform App that we uses internally that I publish through ClickOnce with SQL Express 2005. The app also references a couple of Microsoft.SqlServer dll's. I am trying to figure out how the Specific Version settings work. I have SQL 2008 installed on my machine they have 2005.
If I select Specific Version = false will it ca...
I have a query that's selecting a bunch of fields related to names and addresses of customers but it boils down to:
SELECT DISTINCT a, b, c, ... FROM big_dumb_flat_table
it returns a bunch of records (10986590). When I replace the commas in the select-list to format it as a pipe-separated concatenated string:
SELECT DISTINCT a + '|'...
How can I alter Update Stored Procedure so if developer want to set only Size then he/she does not requireed to pass TimeStamp. Moreover, then what will be execute code for this procedure?
Scenario:
Update TimeStamp = getdate() field whose SizeID = 1 AND Size =Large
Note: This field Parameters and condition parameters must be dynamic ...
Assume a table named 'log', there are huge records in it.
The application usually retrieves data by simple SQL:
SELECT *
FROM log
WHERE logLevel=2 AND (creationData BETWEEN ? AND ?)
logLevel and creationData have indexes, but the number of records makes it take longer to retrieve data.
How do we fix this?
...
Hello
I have a records like this:
start, end , total
830 , 1300, 5
1400, 1430, 2
that I'd like to expand to:
instance , total
830 , 5
831 , 5
832 , 5
...
1299 , 5
1300 , 5
1400 , 2
1401 , 2
...
1429 , 2
1430 , 2
How can I do this using SQL in MSSQL 2005?
EDIT...
HI all,
I'm having some difficulty understanding the rationale behind group by aggregation in sql server 2005.
I have the following query which works fine and returns one row for each contact.id and the 1st occurence of event
SELECT
contact.id
,MIN(eve.date_created)
FROM _contact contact WITH(nolock)
INNER JOIN table2 tb2 WITH (nolock)...
I have a need to monitor a subset of fields on a table and perform a task when one of them changes.
I am using a trigger on the table update which and then am looking at the changes as follows:
-- join the deleted and inserted to get a full list of rows
select * into #tmp from (select * from inserted union select * from deleted) un
-- ...
Maybe I need more coffee this morning but here goes...
I have a very simple inventory system. Right now I have two tables: Items and Inventory.
Items
Id
Title
YearReleased
Inventory
Id
ItemId(Foreign key to Items)
Quantity
QuantityOnHand
Each item has one inventory and each inventory belongs to one item. The relationship betwe...
hello,
i want to restore database from file(Tasks->Restore->Database. atrer i select from device and select file) via sql server management studio.
After that i get this error:
The operating system returned the error '5(Access is denied.)' while attempting
'RestoreContainer::ValidateTargetForCreation' on 'E:\Program Files\Microsoft SQL...
I have a SQL 2008 R2 Database with about 2 million rows in one of the tables and am struggling with the performance of a specific query when using parameterized SQL.
In the table, there's a field containing a name in it:
[PatientsName] nvarchar NULL,
There's also a simple index on the field:
CREATE NONCLUSTERED INDEX [IX_Study_...
A while back when I was performing some bulk inserts of data into my SQL Server database, I disabled a number of indexes to improve the insert performance. I now need to go back and rebuild/re-enable them.
Unfortunately, I'm not sure exactly which indexes I disabled.
Is there a way I can query to identify which indexes are disabled an...
In my stored procedure, I make a temp_tbl and want to add several columns in a cursor or while loop. All works fine the cursor (the creation of a temp_bl but I can´t add the column when the column string is in a varchar variable.
WHILE @@FETCH_STATUS = 0
BEGIN
SET @webadressenrow = 'Webadresse_'+CAST(@counter as nchar(10))
A...
Hello All,
I'd like to set up a coldfusion page that will pull the status updates from my own facebook account and twitter accounts and put them in a SQL database along with their timestamps. Whenever I run this page it should only grab information after the most recent time stamp it already has within the database.
I'm hoping this wo...
If I am using SQL Server Management Studio on my local machine to execute a query which is manipulating data on one or more remote servers, where does the actual computing take place? Is it using my local resources or that of the remote server?
...
I get an "Class not registered" error whenever I attempt to connect to the integration services on sql server 2005 from within SQL Managment Studio 2008.
Is there a workaround? or do I have to downgrade to SQL managment studio 2005?
...
I'm using Microsoft SQL Server 2005, and am relatively new to SQL in general.
There is a relationship between two tables, "Resources" and "Group_Resources", in the database "Information". Resources has a foreign key, "id", in Group_Resources, named "resource_id". There is a foreign key constraint, "fk_gr_res_resources", between the tw...
I'm trying to do the same thing as in this question, but am having problems.
Can you share with me how you prepared your objects prior to inserting and updating the database?
I have a List<myObject> that I want to store as a VarBinary(max) in SQL Server 2008.
...
I have 3 tables, say images(id), news(id), types(id, category, obj_id, type)
For example, categories of news A are black, red.
data struct is like
{
types(xxxx1,red,news_A,news)
types(xxxx2,black,news_A,news)
}
now I need find out all images with type red and black.
In this case, I need images_B
{
types(oooo1,red,images_B,i...
I have a query, say Select foo from bar
Foo is a string field, and will always start with "http://".
I want to replace "http://" with "xml://" during the select, so all foo values come back as xml://..., instead of http://...
Is there a way to substitute on the fly, during the query?
...
I am trying to create a statement like report for invoices, I have it so far that it displays the invoice and the amount due and also the payment if it has been paid, I have all this in a table with the invoice on 1 line and the payments on another with them grouped. What i really what to achieve is to have them ordered by date and for i...