My gps device writes its data to a text file in my server. Now i want sql server to read it and store values in a table. How to get started with this kind of a scenario? Any suggestion.
EDIT:
Consider it is an existing file with 10 rows and i have already imported it. Now the file gets updated with new 10 rows. How to import the new row...
I am having 2 databases namely ach and cart and i am having tables namelt Register and Invoice i would like to add a field in to those 2 tables . Like if i enter a value like some ccyyxxyxyxa this should be saved in the 2 tables...
...
I am trying to pull back the top five instances of certain records loaded into a table. It is important to note that I am trying to get my results out of the same table and I think there is a problem that I can't quite figure out related to the fact that this is one table. Here is the example of my query:
Select * From (
Select Top 5 ...
I have events table which include so many cols besides Id PK
and table Comments which includes text, eventId and Id PK .
how can I select the event information and it's comments in one single sql statement, how to use it and how it should look like !?
Note that EventId(Comments) = Id(events)
...
hello friends i am following 3 layer architecture for my project i mean
presentation layer, business logic layer and finally database layer
my question is that i am making a search feature for my project where i need to send parameter through a method for search query which is to make on business logic layer
i am to send parameter from ...
Hi
The database files (mdf ldf) were taken from a crashed machine and loaded using the attach method. Since everything has been working fine, except when i try to truncate the transaction log the file size does not change and i now notice that it says Not Applicable against the filegroup entry for the transaction log in database propert...
I am trying to import varchar data into a varchar data type field but I am getting a conversion error of varchar cannot be converted to date type bit? How is that when both fields are already varchar type?
Conversion failed when converting the varchar value 'JOHN KUCHTA' to data type bit.
...
I have a table named t_Student in Microsoft SQL Server 2005 database. In that table there are three columns named student_regiNo, student_Name, student_Email.
I'm using following code segment to retrieve "student_Name". But instead of showing "student_Name" it shows "System.Data.SqlClient.SqlDataReader". Whats the problem?
private ...
I connect to an SQL Server 2005 DB from SAS 9.2 via SAS/Access ODBC Driver.
In the DB, I have a table my_table, which has an INSERT-trigger that copies all the inserted rows into another table in the database. In the SQL Server environment, the trigger works normally. However, SAS Proc SQL doesn't seem to get on well with a table with t...
Hello Experts,
I have a sql(2005) view which is running very very slow its takes 5 mins to run. But when i rip out the query from view and run it naked it hardly takes 5-6 seconds.
Can some one please advise me on how i can check what's going wrong with the view
Thanks
Amit
...
I want to encrypt and decrypt data with sql server using RSA or SHA algorithm rahter than doing it at UI.
Is it possible to do this.
Some Code Snippet will be a great help
...
We have an SSIS package that runs nightly which takes the backup of a couple of production databases, restores to a staged database, sensitive information is removed and then the backup of this staged database gets restored on another server so that the hyperion guys can run their jobs. The whole process used to take around 4 and half ho...
HI all,
I have a huge sql query. When i put that query in a stored Proc it takes 5 seconds to execute which i run it just as a query it takes 4-5 seconds but when i run it in a view it takes 5 mins.
Please advise why its running that slow in a view
sql query is below:
CREATE VIEW dbo.Client_Billing_RS
AS
SELECT DISTINCT...
Hi, i need help in converting a stored procedure to a function,
CREATE PROCEDURE [dbo].[FunGetEmpExp] ( @fromdate DATETIME,@todate DATETIME)
AS
BEGIN
DECLARE @TotalYears VARCHAR(2)
DECLARE @TotalMonths VARCHAR(2)
DECLARE @TotalDays VARCHAR(2), @Duration varchar(10)
SET @TotalYears = null
SET @TotalMonths = NUL...
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 + '|'...
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...
I can not for the life of me figure out what is wrong with this code:
IF NOT EXISTS(SELECT * FROM sys.columns WHERE name = 'Report_Date'
AND object_id = OBJECT_ID('TempTable3'))
ALTER TABLE TempTable3 ADD Report_Date datetime
--Set "ReportDate" field to the date the data was extracted less one.
UPDATE TempTa...
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
-- ...
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?
...