Click here to Skip to main content
16,011,870 members
Home / Discussions / Database
   

Database

 
QuestionHow to maintain isolation level in MSSQL SERVER 2000? Pin
param thaker29-Aug-06 19:12
param thaker29-Aug-06 19:12 
AnswerRe: How to maintain isolation level in MSSQL SERVER 2000? Pin
Mike Dimmick30-Aug-06 0:18
Mike Dimmick30-Aug-06 0:18 
GeneralRe: How to maintain isolation level in MSSQL SERVER 2000? Pin
param thaker30-Aug-06 3:07
param thaker30-Aug-06 3:07 
QuestionBULK INSERT with CONVERT or CAST? Pin
Yong Yau29-Aug-06 16:36
Yong Yau29-Aug-06 16:36 
AnswerRe: BULK INSERT with CONVERT or CAST? Pin
Sage30-Aug-06 14:33
Sage30-Aug-06 14:33 
GeneralRe: BULK INSERT with CONVERT or CAST? Pin
Yong Yau31-Aug-06 16:01
Yong Yau31-Aug-06 16:01 
GeneralRe: BULK INSERT with CONVERT or CAST? Pin
Sage1-Sep-06 0:17
Sage1-Sep-06 0:17 
Questionsql Table Lookup best methods? Pin
ronhawker29-Aug-06 12:31
ronhawker29-Aug-06 12:31 
I am looking for a good method to do table lookups in a 2003 SQL database. I am retrieving products from an item table and then want to do value lookups in related tables in the same database like category name, category type, brand name etc. These values are referenced in the item master file by guid links to related tables.I am using a datareader to loop through the Select records and then I am writing results to a tab delimited data file for a data conversion. I am limited to net 1.1 and so can't use the 2.0 executescalar for single lookups.

What would be the more efficienct method to use?

'Dim myItemData As New DataReader

Dim myItemReader As SqlClient.SqlDataReader

Dim myItemCommand As New SqlClient.SqlCommand



Dim myConnection = New SqlClient.SqlConnection("server=sql01.xxx")

myItemCommand.Connection = myConnection

myItemCommand.CommandText = "SELECT ""mf_items"".""item_guid"", ""mf_items"".""item_description"", ""mf_items"".""item_wholesale_price"", ""mf_items"".""item_description_title"",""mf_items"".""item_cd"",""mf_items"".""category_guid"" FROM ""CDB006"".""dbo"".""mf_items"" WHERE ""mf_items"".""item_closed"" = 0 And ""mf_items"".""item_visible"" = 1 AND ""mf_items"".""item_available"" = 1"

myItemCommand.Connection.Open()

myItemReader = myItemCommand.ExecuteReader()


Dim myfileout As StreamWriter

myfileout = File.CreateText(Server.MapPath("out.txt"))

myfileout.WriteLine("link" & vbTab & "title" & vbTab & "description" & vbTab & "price" & vbTab & "image_link" & vbTab & "category" & vbTab & "id")


While myItemReader.Read

If myItemReader.Item(4).ToString() > "" And Val(myItemReader.Item(2).ToString) > 0 Then

'what method to to look up for example the category name using the category_quid referenced in the item master

'Write out record for parts file




Ronhawker

AnswerRe: sql Table Lookup best methods? Pin
kumarprabhakar7430-Aug-06 2:40
kumarprabhakar7430-Aug-06 2:40 
QuestionError In Visul C++ .net About Oledb Pin
javad_200529-Aug-06 10:20
javad_200529-Aug-06 10:20 
AnswerRe: Error In Visul C++ .net About Oledb Pin
Mike Dimmick29-Aug-06 11:52
Mike Dimmick29-Aug-06 11:52 
QuestionSql database access Pin
sgeezee29-Aug-06 9:11
sgeezee29-Aug-06 9:11 
AnswerRe: Sql database access Pin
Stephen McGuire29-Aug-06 12:01
Stephen McGuire29-Aug-06 12:01 
GeneralRe: Sql database access Pin
sgeezee30-Aug-06 3:13
sgeezee30-Aug-06 3:13 
Questionsmalldatetime in datagrid Pin
TheJudeDude29-Aug-06 8:07
TheJudeDude29-Aug-06 8:07 
AnswerRe: smalldatetime in datagrid Pin
Stephen McGuire29-Aug-06 12:09
Stephen McGuire29-Aug-06 12:09 
GeneralRe: smalldatetime in datagrid Pin
TheJudeDude29-Aug-06 15:25
TheJudeDude29-Aug-06 15:25 
GeneralRe: smalldatetime in datagrid Pin
Stephen McGuire30-Aug-06 8:48
Stephen McGuire30-Aug-06 8:48 
GeneralRe: smalldatetime in datagrid Pin
TheJudeDude30-Aug-06 11:41
TheJudeDude30-Aug-06 11:41 
QuestionNeed Help with AUTO_INCREMENT Pin
Jethro6329-Aug-06 4:20
Jethro6329-Aug-06 4:20 
AnswerRe: Need Help with AUTO_INCREMENT Pin
Eric Dahlvang29-Aug-06 5:25
Eric Dahlvang29-Aug-06 5:25 
GeneralRe: Need Help with AUTO_INCREMENT Pin
Jethro6329-Aug-06 5:38
Jethro6329-Aug-06 5:38 
GeneralRe: Need Help with AUTO_INCREMENT Pin
Eric Dahlvang29-Aug-06 5:57
Eric Dahlvang29-Aug-06 5:57 
GeneralRe: Need Help with AUTO_INCREMENT Pin
Jethro6329-Aug-06 6:06
Jethro6329-Aug-06 6:06 
QuestionHow do i get SQL to output a smalldatetime in British date format? Pin
Red_Wizard_Shot_The_Food28-Aug-06 23:02
Red_Wizard_Shot_The_Food28-Aug-06 23:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.