|
That seems to have worked perfectly.
Thanks very much for the help.
- Aaron
|
|
|
|
|
What is the best way to test T-SQL stored procedures?
Do You use some special tools for this task?
Wojtek
|
|
|
|
|
I make a copy of the database to my local machine and run the stored procedure on that copy for testing. It's pretty easy and then you don't have to worry about affecting live data.
|
|
|
|
|
Could also run it within a transaction and roll it back
only two letters away from being an asset
|
|
|
|
|
Maybe, but it is safer to run it on a copy of the live database rather than the live database itself.
|
|
|
|
|
Absolutely agree, but of course if you don't have a test database...you should be flogged anyway.
only two letters away from being an asset
|
|
|
|
|
I know it is a couple of days early, but I'm in the process of moving house so I'll probably forget if I don't say this now: Happy Birthday!
|
|
|
|
|
query analyzer
|
|
|
|
|
Hi,
Thank You for answers.
I also test stored procedures on copy of DB, but I thought there are some special tools to perform tests?
Maybe do You know any?
Wojtek
|
|
|
|
|
I'm building the dts from scratch... The goal is to build a dts to export some data (sql statement is a must) from one table to a text file. I've built a package, connections (two of them, one for the sql server, and one for the text file), steps (only one), one task with one custom task, and two transformation objects (there are two columns in the select clause in sql statement). There are absolutely no transformations included, only copy od the selected data. However, when I execute the package, I get the following error:
"Incomplete file format information - file cannot be opened."
DataSource property for the text file is "DTSFlatFile". I can't figure out what's wrong... help...
|
|
|
|
|
may be u didnt selected the right option!
|
|
|
|
|
Hi ,
I want to replicate the database beetween two sql 2000 servers .
And i am going step-by-step as suggested in the code projects replication article , in that article the have suggested that we have to change the
MSSQLSERVER service startup account to the any account which is defined in SQL
SERVER under systemadmin server role. And i am also going exatly they have written , but sql server is not permitting me to logon using any logon account which is defined under sysadminserverrole.
If anybody have the solutions/sugestions regarding this problem please
send me.
Thanking You,
In advance.
param
|
|
|
|
|
Hi,
I am looking for a good article that will explain to me the BASIC's of the dataset and datatable and in particular performance issues. The article should not be overly complex particularly as to how to access them etc - just an overview.
In particular, I'm putting together my first real program of any substance and the database is growing with tables galore and so far at least 15 datatables that I use to varying degrees. I am now thinking about memory and processor demands particularly as I'm aiming the program at the home PC user and not even a so-called power user either.
I'm now considering creating another datatable that consists of parts of other datatables allready in existence. Does creating "child" datatables use up substantially more resources or does the datatable only reference data that is already in memory in the other datatables?
There are of course many ways of skinning a cat and using the VS2005 IDE seems to tempt one to take the easiest course which may not be the most efficient in terms of memory usage, CPU usage etc.
Am I being paranoid?
Glen Harvy
|
|
|
|
|
I can't think of any articles off the top of my head, but you could look into the PerformanceCounter class or keep it simple and monitor your application's performance in terms of memory/cpu usage with the Task Manager. Hope this is a start for you because there are many ways you can go abouts with testing the performance
I'd like to help but I don't feel like Googling it for you.
|
|
|
|
|
Thanks for the tip - amazing how you can overlook the obvious ie Task Manager
Of immediate concern is my assumption that once a dataset is created and tables loaded I assume another datatable referencing tables within the dataset is only going to increase resource usage minimally.
Is this the case?
Glen Harvy
|
|
|
|
|
Glen Harvy wrote: my assumption that once a dataset is created and tables loaded I assume another datatable referencing tables within the dataset is only going to increase resource usage minimally
I'm not 100% percent sure what the ramifications are on the resources when tables reference each other
too much daily WTF for someone... - Anton Afanasyev
|
|
|
|
|
hi all,my table contain 5 rows with the id of 1,2,3,4,5.if i delete the 3 record then my table will contain 4 records(1,2,4,5).when i enter new record the the new record id will be 6 but i need it like 3..is it possible...is yes tell me how to do...?
ayyp
|
|
|
|
|
ayyp wrote: is it possible
Yes, but it will be an expensive operation. I don't recommend trying.
|
|
|
|
|
Not a good idea. However, if you must do this the easiest way would be:
When you delete from the table [A], insert the deleted id into another table [B].
When you insert a new record into [A] read the minimum from [B] and delete the record from [B]. If none exists in [B], get the max from [A] and add 1 to it.
Make sure that the calls are wrapped up in a transaction or stored procedures.
Ian
|
|
|
|
|
I'd NEVER actually do this:
NOTE: the idcolumn must have a default value of zero.
CREATE TRIGGER CheckIDCol ON dbo.MyTestTable
FOR INSERT
AS
declare @IDVal as int
declare @nCount as int
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE
BEGIN TRANSACTION
select @IDVal = max(idcolumn) from MyTestTable (TABLOCKX) --<code>bad idea</code>
set @nCount = 1
while (@IDVal >= @nCount)
begin
if not exists(Select IDColumn from MyTestTable where IDColumn = @nCount)
begin
break
end
set @nCount = @nCount + 1
end
update MyTestTable set idcolumn = @nCount where idcolumn = 0
COMMIT TRANSACTION
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
I have an excel spreadsheet as a database for a small project I am working on.
I have two sheets "Billing" and "Statement".
Basically the excel spreadsheet is a mess, and I cant change to much, as I only have read access to the file.
Now what I do is, I give the columns and worksheets new names, when getting info using a SELECT statement.
Here is my statement:
SELECT [DATE] as tblS_Date, mid([2ND REFERENCE_],1,9) as tblS_CellNr, mid([Cell Number],2,9) as tblB_CellNr, [Total___] as tblB_Total FROM Statement as tblS INNER JOIN Billing as tblB ON tblS.tblS_CellNr = tblB.tblB_CellNr
Say values in db:
2ND REFERENCE_ = "885551234"
Cell Number = "0885551234"
I convert these to with the use of the MID function:
2ND REFERENCE_ = "885551234"
Cell Number = "885551234"
My problem is, I cant get the JOIN part to work(join on cell phone numbers as primary/foreign keys)... It does not pick up the new names, and I cant use the defaultvalue from the spreadsheet as primary keys, as the info first need to be converted using "MID". How can I work around this?
Really, really appreciate the help!
-- modified at 5:35 Friday 18th August, 2006
|
|
|
|
|
You should be able to put your MID functions in the JOIN clause:
SELECT
[DATE] as tblS_Date,
MID([2ND REFERENCE_],1,9) as tblS_CellNr,
MID([Cell Number],2,9) as tblB_CellNr,
[Total___] as tblB_Total
FROM
Statement as tblS
INNER JOIN
Billing as tblB
ON MID(tblS.[2ND REFERENCE_],1,9) = MID(tblB.[Cell Number],2,9)
|
|
|
|
|
Michael Potter wrote: You should be able to put your MID functions in the JOIN clause:
SELECT
[DATE] as tblS_Date,
MID([2ND REFERENCE_],1,9) as tblS_CellNr,
MID([Cell Number],2,9) as tblB_CellNr,
[Total___] as tblB_Total
FROM
Statement as tblS
INNER JOIN
Billing as tblB
ON MID(tblS.[2ND REFERENCE_],1,9) = MID(tblB.[Cell Number],2,9)
Hi Michael.
Thank you very much, the query worked perfect.
Regards
Playout
|
|
|
|
|
Hi,
I have two Access databases each with different tables in. There are two tables in each of them I need to join, using ado.net and vb.net...
costToCompany.mdb (tblEmployees)
Accounts.mdb (tblLoanAmount)
The relationship is EmployeeID in both tables.
How would the select/join statement look like?
Appreciate the help.
|
|
|
|
|
There are two other solutions to this...
1. You could just create another Access DB that has all the tables from both DB's as Linked tables, then just query that DB.
2. You could load data from both DB's into an ADO.Net DataSet, relate your tables and work on the data from there.
Steve
|
|
|
|