Forum: MS SQL Apr 7th, 2009 |
| Replies: 2 Views: 1,325 there are other ways you could do this, but here's one
select
CAST(Reference AS INT) as REFERENCE
from tablename |
Forum: MS SQL Apr 3rd, 2009 |
| Replies: 19 Views: 1,289 Awesome, you happen to know what the issue was with the one we were working with? |
Forum: MS SQL Apr 2nd, 2009 |
| Replies: 19 Views: 1,289 the stop table is only used in the subquery and can't be referenced outside of it
i don't get why, but it looks like the isdrop =1 is not just joining on those records
try adding this piece in... |
Forum: MS SQL Apr 2nd, 2009 |
| Replies: 19 Views: 1,289 its not late, only 5, just got a few left before work is done though, there is some data in here that isn't jiving
this will do a partial update, but might help determine what is going on
add... |
Forum: MS SQL Apr 2nd, 2009 |
| Replies: 19 Views: 1,289 so close, just something in there i'm just not catching right now, one last try for the evening, cross our fingers
UPDATE jobhistory
SET modifieddt =
(SELECT top 1... |
Forum: MS SQL Apr 2nd, 2009 |
| Replies: 19 Views: 1,289 but all stop.stopcompletiondatetime are not null? |
Forum: MS SQL Apr 2nd, 2009 |
| Replies: 19 Views: 1,289 hmmmm,
run this
select jobhistory.histjobid, stop.stopcompletiondatetime
from jobhistory
inner join jobxstop
on jobxstop.jobid = jobhistory.histjobid
inner join stop |
Forum: MS SQL Apr 2nd, 2009 |
| Replies: 19 Views: 1,289 sorry long day already, i didn't have the join on the original table, lets go back to your query the first time with that one line removed
UPDATE jobhistory
SET modifieddt =... |
Forum: MS SQL Apr 2nd, 2009 |
| Replies: 19 Views: 1,289 i can't completely tell the structure, but i believe this will work, just make sure you do a backup first!!!
UPDATE jobhistory
SET modifieddt =
(SELECT stop.stopcompletiondatetime
from... |
Forum: MS SQL Apr 2nd, 2009 |
| Replies: 19 Views: 1,289 you have this in here
INNER
JOIN stop
ON stop.stopcompletiondatetime = jobhistory.modifieddt
which will not work, because stopcompletiondatetime does not equal your modifieddt |
Forum: MS SQL Mar 17th, 2009 |
| Replies: 2 Views: 669 select p.ID,
(SELECT SUM(i.IncomeAmount) from Income i where i.PersonId = p.ID) AS INCOME_AMOUNT,
(SELECT SUM(o.OutcomeAmount) from Outcome o where o.PersonId = p.ID) AS OUTCOME_AMOUNT
from Person... |
Forum: MS SQL Mar 17th, 2009 |
| Replies: 2 Views: 525 select top 3 *
from tableName
order by col3 desc |
Forum: MS SQL Mar 10th, 2009 |
| Replies: 6 Views: 897 Ok, just wanted to make sure we aren't chasing a ghost
Rather than just adding the parameters with a name and value, try to add them with a name and type
SqlParameter param1 = new... |
Forum: MS SQL Mar 10th, 2009 |
| Replies: 6 Views: 897 For starters lets start off with syntax:
Did you see this line?
SqlParameter("@ResultTime", ddRTime.Text.Trim()));
your parameter is named @RTime |
Forum: MS SQL Mar 10th, 2009 |
| Replies: 6 Views: 897 Are you sure you set the column's data type to datetime? It sounds like you are using varchar |
Forum: MS SQL Mar 8th, 2009 |
| Replies: 10 Views: 1,681 Ahhh sorry, forgot you only needed sql server
here's a link that should help
http://www.nigelrivett.net/SQLTsql/RemoveNonNumericCharacters.html
here it is with modification
CREATE FUNCTION... |
Forum: MS SQL Mar 7th, 2009 |
| Replies: 10 Views: 1,681 here is my idea then
select translate('123AB45',
'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789',
'ABCDEFGHIJKLMNOPQRSTUVWXYZ') from dual;
i don't necessarily know the context... |
Forum: MS SQL Mar 5th, 2009 |
| Replies: 10 Views: 1,681 would adding a trigger that will format the field to only be characters upon inserts and updates be sufficient? |
Forum: MS SQL Dec 1st, 2008 |
| Replies: 1 Views: 440 it depends what you are doing at time of insert to the master table, if you are using a stored procedure you can use this
insert into mastertable .....
select @@identity
same as your... |
Forum: MS SQL Dec 1st, 2008 |
| Replies: 5 Views: 814 what about a distinct
select distinct cust_no
its hard to see where the data is coming from here, if you are wanting the balance only from customer.balance |
Forum: MS SQL Dec 1st, 2008 |
| Replies: 5 Views: 814 you need to add a group by
GROUP BY cust_no,...... |
Forum: MS SQL Nov 28th, 2008 |
| Replies: 2 Views: 599 |
Forum: MS SQL Nov 24th, 2008 |
| Replies: 2 Views: 451 why do you need the extra table?
why don't you just query from occurences, the same one that you populated reminder with? |
Forum: MS SQL Nov 23rd, 2008 |
| Replies: 3 Views: 888 i don't see how you are expecting idx = NULL for 2-6, when you have both entries for idy in both tables
are you sure this is what you are wanting? |
Forum: MS SQL Nov 18th, 2008 |
| Replies: 4 Views: 632 is the first one in a stored procedure? where you pass @table_name in? |
Forum: MS SQL Nov 10th, 2008 |
| Replies: 6 Views: 619 i would suggest, not saying this is for sure the answer, using transactions with READ COMMITTED or REPEATABLE READ
this way while changing or selecting data, you ensure that it can't be modified... |
Forum: MS SQL Nov 10th, 2008 |
| Replies: 6 Views: 619 concurrency issues won't only be the result of updates, but from what you described what you were worried about, you only described about the amount of load on the system
how many users do you... |
Forum: MS SQL Nov 10th, 2008 |
| Replies: 6 Views: 619 i think you are seeming to be worried about the load, vs the concurrency
i would suggest using stored procedures with transactions
there is no problem with inserts, as long as they won't bust... |
Forum: MS SQL Nov 5th, 2008 |
| Replies: 6 Views: 1,614 here's a post that should help you out
http://blogs.msdn.com/sql_protocols/archive/2007/05/13/sql-network-interfaces-error-26-error-locating-server-instance-specified.aspx |
Forum: MS SQL Nov 4th, 2008 |
| Replies: 6 Views: 1,614 make sure the sql server service is running |
Forum: MS SQL Nov 4th, 2008 |
| Replies: 2 Views: 907 how is this random?
[quote]
- articles with higher values of 'type' appear first
- then all the articles with 'type=0' should appear at the end
- then all the articles with a low section ID... |
Forum: MS SQL Nov 3rd, 2008 |
| Replies: 2 Views: 2,890 row count is easy, just use
select count(*) from table
what is the character set of the db? |
Forum: MS SQL Nov 2nd, 2008 |
| Replies: 6 Views: 1,410 and tcpip is available?
if so, make sure your connection string is correct |
Forum: MS SQL Nov 1st, 2008 |
| Replies: 6 Views: 1,410 the sql server machine needs to be configured with that because it is the "remote" machine |
Forum: MS SQL Nov 1st, 2008 |
| Replies: 6 Views: 1,410 You need to configure it to allow remote connections
http://www.linglom.com/2007/08/31/enable-remote-connection-to-sql-server-2005-express/ |
Forum: MS SQL Oct 30th, 2008 |
| Replies: 19 Views: 7,050 NewUserId will be PurchaseOrderId
make sure you have this in the stored procedure as well, like we said before
@PurchaseOrderId int OUTPUT
also make sure if you modified the code it is cmd... |
Forum: MS SQL Oct 30th, 2008 |
| Replies: 19 Views: 7,050 sorry, this way does use the way we had first with
OUTPUT and select @PurchaseOrderID = @@IDENTITY
so change it back to that to follow that example, no more changes now :-) |
Forum: MS SQL Oct 30th, 2008 |
| Replies: 19 Views: 7,050 yes that is what i mean
it was just code, but anyways
here's a better link
http://www.dotnetjunkies.com/WebLog/skiff/archive/2005/02/12/54047.aspx |
Forum: MS SQL Oct 30th, 2008 |
| Replies: 19 Views: 7,050 Here's a link
http://blogs.msdn.com/vsdata/archive/2006/08/21/711310.aspx
you can change your stored procedure, by removing the "OUT" parameter, and instead of
select @PurchaseOrderId =... |
Forum: MS SQL Oct 30th, 2008 |
| Replies: 19 Views: 7,050 the problem is that when you execute the first query, it is returning your purchaseorderid, which links the purchaseorderdetails to it
you need to pass this in as a parameter from code side |