New To T-SQL, Some Pointers Please

Nov 25, 2004

hmm ok here is an outline:

I have a view which is a combination of TblHorses and TblOwners has fields:

Form from Horses
StableHands from owners

linked by Horses.OwnedBy = Owners.OwnerID

ok goes through all the horses and creates a number either 0,1,2

based on the formula

Round((int(RSFormUpd("StableHands"))/22) + (rnd * 2),0)

then if the random number = 0 the Form goes down 1 unless is already 1 then stays the same

if = 1 then stays same

if = 2 then form goes up 1 unless it is already 5 then it stays the same


then this is how i coded in asp as i can do asp/vb programming lol but T-SQL is a mystery:

Randomize()

Set RSFormUpd = Server.CreateObject("ADODB.Recordset")
RSFormUpd.open "Select * From ViewWeeklyFormUpdate", Conn, 3, 3
Do While Not RSFormUpd.EOF

UpdForm = Round((int(RSFormUpd("StableHands"))/22) + (rnd * 2),0)

If UpdForm = 0 Then
If int(RSFormUpd("Form")) - 1 = 0 Then
RSFormUpd("Form") = int(RSFormUpd("Form"))
Else
RSFormUpd("Form") = int(RSFormUpd("Form")) - 1
End If
End If

If UpdForm = 1 Then
RSFormUpd("Form") = int(RSFormUpd("Form"))
End If

If UpdForm = 2 Then
If int(RSFormUpd("Form")) + 1 = 6 Then
RSFormUpd("Form") = int(RSFormUpd("Form"))
Else
RSFormUpd("Form") = int(RSFormUpd("Form")) + 1
End If
End If

Response.write RSFormUpd("Form") & " "

RSFormUpd.update

RSFormUpd.movenext
Loop

RSFormUpd.close
Set RSFormUpd = Nothing

Thanks in advance

Dagaz

View 1 Replies


ADVERTISEMENT

HELP.... Images And Pointers

Jun 12, 2006

Hello everyone, I'm in need of help.

I'm using microsoft sql server 2005 along with the microsoft visual studio 2005. I have 2 questions:

1) In the database server, there is an "image" datatype. I need to know how to use that because I need to display images on my webform.

2) I read somewhere that pointers can be used to point the file path. So, is it possible for me to store images / audios in a file and use the database to point to the file path? If it is possible, how can it be done?

Thanks.

View 6 Replies View Related

I Need Help Regarding Sql Data Types And Pointers.

Jun 11, 2006

hello, i have a few questions here which i hope anyone can help me.

1. how do i go about using the image data type?

2. how to use pointers to point to a specific file? for example, if i want to point to a music/image file, how do i go about doing that?

i'd appreciate if anyone can help me.

thx! :) .

View 2 Replies View Related

Database Design Pointers (please!)

Jul 23, 2005

HiI'm currently having to design a database for a recruitment agencythat's just started up and have one area where I'm a little unsurewhere to go.Basically I've implemented the 'standard' Customer, Contacts tableslinked on CustomerID, and also have CallRecords (for phone calls etcmade to contacts) Linked on ContactID.My difficulty is that they want to be able to store names/details ofpeople looking for work (candidates) BUT these people may also be acontact (i.e. the agency could be dealing with a contact at a companywho is also looking for a new job themselves). They would also like to(naturally) have these candidates details held against 'currentemployer' customer details so there may be situations where a candidateis JUST a candidate (i.e. not currently working and therefore notassociated to a company), OR they may be a candidate AND a contact, andyou may have contacts who are JUST contacts (i.e. not actively lookingfor work at the moment).I'm basically just trying to figure out the options I have for storingthe contact details and candidate details.FYI I need to store the same details for Contacts and Candidates (i.e.name, job title, contact numbers etc) but Candidates require extrainformation to be stored about them (work experience, qualificationsetc).Any help/pointers would REALLY be appreciated!!Thanks in advanceMartin

View 1 Replies View Related

Looking For Webserver Clickstream Log Processing Pointers...

Jul 12, 2007

We currently have a standard star schema warehouse that contains clickstream data from our web server farm. We use a home grown ETL process that is a combination of java code and shell scripts to process these logs on a daily basis. The clickstream data represents both our dimensional data as well as measurements. We are currently processing 22GB of compressed data daily and are currently on a 50% growth rate year over year.

My question is does anyone have experience/pointers on using SSIS to process a stream of data that contains both the dimensions and fact data? Our current architecture pulls out dimensional attributes, processes them separately, and then substitutes the dimensional keys back into the fact stream. I have to believe there is a more efficient way to do this via SSIS.

Any advice would be appreciated.

Thanks

--sean

View 3 Replies View Related

Mapping Image Pointers To Page Numbers

Jul 20, 2005

Is there a way to convert an image pointer to a page ID that could beused in DBCC pagei.e.select TEXTPTR(document)FROM testdocs where id = 1resturns0xFEFF3601000000000800000003000000select convert(int,TEXTPTR(document)) FROM testdocs where id =1returns50331648dbcc page (9,3,8,1)dumps the first page of the imageI am trying to map 0xFEFF3601000000000800000003000000 - > pagenumber 8thanks

View 1 Replies View Related

Pointers To The Best Documentation On Star Joins And The Optimiser

May 16, 2007

Hi All,

we are just starting to do some testing on sql server EE with dimensional models.....we have had one or two problems we have been able to solve using the new peformance dashboards etc.



However, as is inevitable, we are seeing strange behaviour of a query....in a star join it seems to be doing an eager spool and trying to spool the entire fact table to tempdb....hhmmm....



Rather than ask one question at a time.....we have DBAs who went to classes etc at MSFT and the client is some level of MSFT partner.



Could anyone point me to the best documentation for understanding the optimiser and how to influence it to get it to do the right thing in optimising plans for star joins?



Thanks



Peter

View 6 Replies View Related

SQL Tools :: Debugging Stored Procedures Shows Wrong Line Pointers

Apr 26, 2015

I have an extremely annoying problem when debugging stored procedures in SQL Server 2014 with SSDT or SSMS. When calling a SP thru EXECUTE in Debug mode, 9 out of 10 SPs are traced with a wrong yellow arrow-pointer to the line currently reached.

The offset is between 6 to 15 lines downward. Tracing itself and update of the "Locals"-view works as expected. All SPs contain comments also before the Create Procedure statement. The SP shown when tracing show exactly the same content as the stored SQL in the SSDT project under work incl. Create procedure and all comments.

The picture here show the first line selected after the debugger has traced into the SP. The first line really executed with "Next" will be SET NOCOUNT ON.

If this does not turns out as my fault and some of you would support that, I would like to post this to SQL Connect.

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved