Cache Entire Table Then Make Filtered Queries Against It

Feb 11, 2008

Hello,

 I have a table that I want to cache. So, if this is my query "SELECT * FROM myTable" that I create the cache from, how can I filter the data?

I really need to cache the whole table, since there are a myriad of different statements being executed against the table, so just caching a specific query won't do.

I've found the best approach to make a question is writing it in code, so how can I do the following:

SELECT ColNames FROM MyTableWhichShouldNowBeCached WHERE whereColumns=someParams.

ColNames and someParams make up for a variation of about to 120 different queries. I use SQL 2005 express edition with advanced services.

Cheers!

/Eskil

 

 

View 2 Replies


ADVERTISEMENT

Make SQL Queries Case Sensitive

Sep 13, 2007

Hi,

I have an SQL Server 2000 database. There is a table for User Logins. I want the query to be executed as case sensitive. I mean if the database has a username like "USER1" and the user enters his username as "user1" then the login should fail.

So, Is there some way I can make SQL case sensitive? Please help

Regards

Vineed

View 3 Replies View Related

Why Clean Data Pages Written To L2 Cache To Make Space For Other Not Modified Pages

Oct 2, 2014

in microsoft doc there is written on the topic of BP Extensions with SSD's in SQL Server 2014: only clean pages are written to disk... does this mean data pages that have not been modified yet? or also those data pages that have already been modified, and where log has finished writing and the transaction has been marked as commited??

why are there clean data pages being written to L2 cache to make space for other not modified pages? I mean, shoudnt they be modified first, before letting other unmodified data pages into the Cache? I mean they have still to be modified..that makes no sense to me to page them out and page them in again just for other data pages...

View 2 Replies View Related

SQL Server 2012 :: Getting Size Of Filtered Table?

Jun 18, 2015

I would like to get the size of the tables in my database BUT as follows:

SIZE OF (SELECT * FROM myTable WHERE Section = 1)

...what is the fastest way to do it?

View 2 Replies View Related

Add An Entire Table To Another (no Replace)

May 16, 2006

Hi! I've some data in a table, and I want to add these records to another table, but I tried yet with select ... Into ... and I lose all the data from this one. I need to ADD the data from table to table. Any suggestion?
Thx

View 3 Replies View Related

How Do You Lock An Entire Table?

Jul 23, 2005

Hi,I need to lock a table so that Inserts are prevented as well as deleted andupdates. At present I'm thinking this might do it:SELECT * FROM myTable WITH(UPLOCK)but then again I'm not sure whether this will cover the insert case.Thanks,Robin

View 5 Replies View Related

Entire Table In A Page

Mar 13, 2008

How can I do in order that a table show all its rows in a page?And if the table can only show a number of rows cause arrive to the end of the page show the table in the next page?

Thanks!

View 5 Replies View Related

Will A Single Row Be Locked Or The Entire Table?

Feb 19, 2006

I am giving the following statement outside the begin tran block in a stored procedure:
select * from table1 with (holdlock) where column1 = @colValue
I have the following two questions regarding above situation:

Being outside the begin tran block, will the select statement cause a lock to be held or it has to be within the begin tran block for the lock to be held?
Will the select statement hold a lock only on the row or rows matching the where clause, or it may lock a page or even the entire table in this situation?
Thanks

View 3 Replies View Related

Keeping Entire Table In Memory

Aug 17, 1999

How can I instruct SQL Server to keep entire table in memory? ie the memory pages should not be swapped to HD.

View 2 Replies View Related

Script To Copy Entire Table

Jul 20, 2005

I'm a newbie to script writing. I'm trying to write a script to copy alldata from a table to the same table in a 2nd database. Both databases areon the same server and are identical in design. I can do this with DTS butwanted a script I could email to a user to run in Query Analyzer.Example:Copy entire table called 'Customers' in the 'Data01' database totable 'Customers' in the 'Data02' databaseI want to overwrite all data in the destination table.Thanks

View 1 Replies View Related

Want To Copy One Entire Row To Same Table Using Primary Key

Mar 5, 2008



I have table in my SQL database, I want to copy(or insert) one record(one entire row using primary key, which is auto)

I am thinking something like this
Insert Into Table1 (a, b, c,d,e) values(select a,b,c,d,e from Table1 where Primarykey=1 or any number)

telll me how do I do that

maxs

View 4 Replies View Related

Fail To Read Entire Table In .NET

Sep 20, 2007

The problem that I am having is that I am not getting the results from an entire table, just a small subset. The sql command is "Select * from login", which has always implied to me, get everything, to end of table, or, until I tell you to stop. I am getting exactly, 10 items as input, and then it stops. I am including the code below in the hopes that someone can spot what it is that I am doing wrong.

The purpose of the routine is to convert a user login database into a new, expanded format.

TIA, Tom


Imports Common.Utility.Utils

Partial Class UserDatabaseConversion

Inherits System.Web.UI.Page

Dim sqlConn As SqlConnection = getSQLConnection(ConfigurationManager.AppSettings("utilityDbName"))

Dim sqlConnN As SqlConnection = getSQLConnection(ConfigurationManager.AppSettings("utilityDbName"))

Dim sqlStringOld As String = "Select * from login"

Dim sqlStringNew As String = "usp_UT_AddNewUser"

Dim buildCnt As Integer = 0

Dim oldUserCnt As Integer = 0

Dim newUserCnt As Integer = 0

Dim oLocation As String = Nothing

Dim errors As Integer = 0

Dim mesg As String = Nothing

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

getOldUsers()

End Sub

Sub getOldUsers()

Dim odate As Date = Date.Today

Dim sqlCmdOld As SqlCommand = New SqlCommand()

sqlCmdOld.CommandText = sqlStringOld

sqlCmdOld.CommandType = CommandType.Text

sqlCmdOld.Connection = sqlConn

Dim dbReader As SqlDataReader = Nothing

Try

sqlConn.Open()

dbReader = sqlCmdOld.ExecuteReader()

If dbReader.HasRows Then

Do While dbReader.Read()

oldUserCnt += 1

Select Case IsDBNull(dbReader.Item("reg_date"))

Case True

buildNewUser(dbReader.Item("name"), dbReader.Item("password"), dbReader.Item("email"), dbReader.Item("type"), dbReader.Item("org"), dbReader.Item("occupation"), dbReader.Item("location"), odate)

Case False

buildNewUser(dbReader.Item("name"), dbReader.Item("password"), dbReader.Item("email"), dbReader.Item("type"), dbReader.Item("org"), dbReader.Item("occupation"), dbReader.Item("location"), dbReader.Item("reg_date"))

End Select

Loop

End If

Catch ex As Exception

Finally

sqlConn.Dispose()

End Try

If errors = 0 Then

lblMesg.Text = "Conversion completed succesfully.<br />Users In: " & oldUserCnt & " , Users Out:" & newUserCnt

Else

lblMesg.Text = "Conversion comleted with errors.<br />Users In: " & oldUserCnt & " , Users Out:" & newUserCnt & "<br />"

lblMesg.Text += mesg

End If

End Sub

Sub buildNewUser(ByVal oname As String, ByVal opassword As String, _

ByVal oemail As String, ByVal otype As String, _

ByVal oorg As String, ByVal oocc As String, _

ByVal oloc As String, ByVal oregdate As Date)

Dim sqlCmdNew As SqlCommand = New SqlCommand()

sqlCmdNew.CommandText = sqlStringNew

sqlCmdNew.CommandType = CommandType.StoredProcedure

sqlCmdNew.Connection = sqlConnN

Dim userName As String = Nothing

Dim firstName As String = Nothing

Dim middleName As String = Nothing

Dim lastName As String = Nothing

Dim title As String = Nothing

Dim emailAddress As String = Nothing

Dim passWord As String = Nothing

Dim userType As String = Nothing

Dim org As String = Nothing

Dim occ As String = Nothing

Dim loc As String = Nothing

Dim rdate As Date = Nothing

oLocation = oloc

' user name will be the first part of the email address

emailAddress = oemail

Dim uname() As String = oemail.Split("@")

' extend the length of the user name to at least 5 characters

Select Case uname(0).Length

Case Is > 4

userName = uname(0)

Case Is = 4

userName = uname(0) & "1"

Case Is = 3

userName = uname(0) & "12"

Case Is = 2

userName = uname(0) & "123"

Case Is = 1

userName = uname(0) & "1234"

End Select

' check for suffixes

Dim suffix() As String = oname.Split(",")

Select Case suffix.Length > 1

Case True

title = suffix(1)

End Select

' split names out

Dim names() As String = suffix(0).Split(" ")

' possibly 3 components to the name

Select Case names.Length

Case Is = 1

firstName = names(0)

Case Is = 2

firstName = names(0)

lastName = names(1)

Case Is = 3

firstName = names(0)

middleName = names(1)

lastName = names(2)

End Select

' setup password. must be at least 6 characters.

' if less, extend to 6.

Select Case opassword

Case Is > 5

passWord = opassword

Case Is = 5

passWord = opassword & "1"

Case Is = 4

passWord = opassword & "12"

Case Is = 3

passWord = opassword & "123"

Case Is = 2

passWord = opassword & "1234"

Case Is = 1

passWord = opassword & "12345"

End Select

' user type, organization and occupation

userType = otype

org = oorg

occ = oocc

' registration date

Select Case IsDBNull(oregdate) Or IsNothing(oregdate)

Case True

rdate = Today.Date

Case False

rdate = oregdate

End Select



' try to extract the location

' get the country

Dim country As String = getCountry(oloc)

' get the state

Dim state As String = getState(oloc)

' only thing left is the city

Dim city() As String = oloc.Split(",")

' add parameter values

sqlCmdNew.Parameters.AddWithValue("@NamePrefix", System.DBNull.Value)

sqlCmdNew.Parameters.AddWithValue("@FirstName", replaceSingleQuote(firstName))

Select Case IsNothing(middleName)

Case True

sqlCmdNew.Parameters.AddWithValue("@MiddleName", System.DBNull.Value)

Case False

sqlCmdNew.Parameters.AddWithValue("@MiddleName", replaceSingleQuote(middleName))

End Select

Select Case IsNothing(lastName)

Case True

sqlCmdNew.Parameters.AddWithValue("@LastName", System.DBNull.Value)

Case False

sqlCmdNew.Parameters.AddWithValue("@LastName", replaceSingleQuote(lastName))

End Select

sqlCmdNew.Parameters.AddWithValue("@UserName", replaceSingleQuote(userName))

Select Case IsNothing(title)

Case True

sqlCmdNew.Parameters.AddWithValue("@NameTitle", System.DBNull.Value)

Case False

sqlCmdNew.Parameters.AddWithValue("@NameTitle", title)

End Select

sqlCmdNew.Parameters.AddWithValue("@Password", replaceSingleQuote(passWord))

sqlCmdNew.Parameters.AddWithValue("@EmailAddress", emailAddress)

sqlCmdNew.Parameters.AddWithValue("@PasswordHint", userName)

Select Case isEmpty(org)

Case True

sqlCmdNew.Parameters.AddWithValue("@Organization", System.DBNull.Value)

Case False

sqlCmdNew.Parameters.AddWithValue("@Organization", replaceSingleQuote(org))

End Select

Select Case isEmpty(occ)

Case True

sqlCmdNew.Parameters.AddWithValue("@Occupation", System.DBNull.Value)

Case False

sqlCmdNew.Parameters.AddWithValue("@Occupation", replaceSingleQuote(occ))

End Select

sqlCmdNew.Parameters.AddWithValue("@Address1", System.DBNull.Value)

sqlCmdNew.Parameters.AddWithValue("@Address2", System.DBNull.Value)

Select Case isEmpty(city(0))

Case True

sqlCmdNew.Parameters.AddWithValue("@City", System.DBNull.Value)

Case False

sqlCmdNew.Parameters.AddWithValue("@City", replaceSingleQuote(city(0)))

End Select

sqlCmdNew.Parameters.AddWithValue("@ZipCode", System.DBNull.Value)

sqlCmdNew.Parameters.AddWithValue("@PostalCode", System.DBNull.Value)

Select Case IsNothing(state)

Case True

sqlCmdNew.Parameters.AddWithValue("@State", System.DBNull.Value)

Case False

sqlCmdNew.Parameters.AddWithValue("@State", state)

End Select

sqlCmdNew.Parameters.AddWithValue("@Other", System.DBNull.Value)

Select Case IsNothing(country)

Case True

sqlCmdNew.Parameters.AddWithValue("@Country", System.DBNull.Value)

Case False

sqlCmdNew.Parameters.AddWithValue("@Country", country)

End Select

sqlCmdNew.Parameters.AddWithValue("@GeneralEmail", False)

sqlCmdNew.Parameters.AddWithValue("@FundRaiseEmail", False)

sqlCmdNew.Parameters.AddWithValue("@GeneralUSPSMail", False)

sqlCmdNew.Parameters.AddWithValue("@FundRaiseUSPSMail", False)

sqlCmdNew.Parameters.AddWithValue("@DateAdded", rdate)

sqlCmdNew.Parameters.AddWithValue("@DateUpdated", rdate)

sqlCmdNew.Parameters.AddWithValue("@Active", True)

sqlCmdNew.Parameters.AddWithValue("@UserType", userType)

Dim iRows As Integer = 0

' try to insert the row into the table

Try

sqlConnN.Open()

iRows = sqlCmdNew.ExecuteNonQuery()

If iRows <> 1 Then

errors += 1

mesg += "<br />User: " & firstName & " " & lastName & " was not added.<br />"

End If

newUserCnt += 1

Catch ex As Exception

Dim exMsg As String = ex.Message.ToString()

writeApplicationLog(exMsg, ConfigurationManager.AppSettings("UtilityDBName"))

errors += 1

mesg += "<br />User: " & firstName & " " & lastName & " was not added due to " & exMsg & "<br />"

Finally

sqlConnN.Close()

sqlCmdNew.Dispose()

End Try

End Sub

Function getState(ByVal loc As String) As String

Dim state As String = Nothing

If loc.Contains("NY") Then

state = "NY"

ElseIf loc.Contains("WA") Then

state = "WA"

ElseIf loc.Contains("PA") Then

state = "PA"

ElseIf loc.Contains("AZ") Then

state = "AZ"

ElseIf loc.Contains("MI") Then

state = "MI"

ElseIf loc.Contains("WI") Then

state = "WI"

ElseIf loc.Contains("CT") Then

state = "CT"

ElseIf loc.Contains("NC") Then

state = "NC"

ElseIf loc.Contains("CA") Then

state = "CA"

ElseIf loc.Contains("NY") Then

state = "NJ"

End If

Return state

End Function

Function getCountry(ByVal cntry As String) As String

Dim country As String = "US"

If cntry.Contains("Canada") Then

country = "CA"

End If

Return country

End Function

End Class

View 1 Replies View Related

Unable To Connect To SQL Database 'MySite-Cache' For Cache Dependency Polling.

Dec 27, 2007

 Im getting this error when trying to set up a cache dependency...are there any special permissions etc?From CS:SqlCacheDependency dep = new SqlCacheDependency("MySite-Cache", "Products");Cache.Insert("Products", de.GetAllProductsList(), dep); From connectionStrings.config:<add name="SiteDB"         connectionString="Data Source=localhost,[port]SQLEXPRESS;Integrated Security=true;User Instance=true; AttachDBFileName=|DataDirectory|ASPNETDB.MDF" providerName="System.Data.SqlClient" />Also tried this using my machinename<add name="SiteDB"         connectionString="Data
Source=<machinename>,[port]SQLEXPRESS;Integrated Security=true;User
Instance=true; AttachDBFileName=|DataDirectory|ASPNETDB.MDF"
providerName="System.Data.SqlClient" /> From web.config:       <caching>          <sqlCacheDependency enabled="true" pollTime="10000">              <databases>                  <add name="MySite-Cache" connectionStringName="SiteDB" pollTime="2000"/>              </databases>          </sqlCacheDependency>                </caching> EDIT: So making progress I can't seem to get the table registered for cache dependency:The sample i have says"aspnet_regsql.exe -E -S .SqlExpress -d aspnetdb -t Customers -et"and the command line response is "Enabling the table for SQL cache dependency..An error has happened.  Details of the exception:The table 'Customers' cannot be found in the database."Where does this "Customers" table come from? There is obviously not an application specific "Customers" table in aspnetdb I'm confused probably more by the example than anything.... 

View 3 Replies View Related

SQL2K - Clean Buffer Cache And Procedure Cache.

May 31, 2007

Is there a way to drop clean buffers at the database level instead of the server/instance level like the undocumented €œDBCC FLUSHPROCINDB (@dbid)€??
Is there a workaround for €œdbo€? to be able to flush procedure and data cache without being elevated to €œsysadmin€? server role?

PS: I am aware of the sp_recompile option that can be used to invalidate cached execution plans.
Thx.

View 1 Replies View Related

How Do I Delete Selected Rows Without Deleting The Entire Table?

May 26, 2000

Hi Guys!

This SQL statement, though carefully written to delete only selected rows, deletes the entire A_Shift_Times table:

DELETE FROM A_Shift_Times
WHERE EXISTS (
SELECT 1
FROM
Users
WHERE
(A_Shift_Times.time_in >= CONVERT(DATETIME, '2000-05-29 00:00:00', 102)) AND
((Users.User_Password LIKE N'mrr%') OR (Users.User_Password LIKE N'work%')))

What gives? What am I doing wrong here?

View 1 Replies View Related

How To Addd/remove Entire Table In Replication Shema ?

Aug 19, 2002

Hi everybody,

We are using SQl-2000 Sp2 clustured on two compaq servers
We have to modify our database shema every month.
We are using sp_repladdcolum and sp_repldropcolum to
modify table without snapshot.

Owever I would like to add/delete entire table in shema
database without using snapshot ?

Is it possible ?
How to do ?

Thanks.
Fabio

View 1 Replies View Related

SQL 2012 :: Insert Entire Line Into One Column Of The Table

Oct 21, 2014

I convert EBCDIC file to text file at C:orderorder.txt. There are about 1400000 rows. The length of line is 1500.

How to insert entire line into one column of the table? (only one column, named as [LineDetail])

View 1 Replies View Related

Search Entire Database For Keywords Inside Of Columns For Each Table

Sep 18, 2013

I'm trying to create a query that searches an entire database for keywords inside of the columns for each table within the database. For instance my tables have 2 columns one named ID and the other Permission, I'd like it be able to return all the lines that are associated with that keyword. So if I search "Schedule" it returns all the lines containing that word in it within that database.

View 6 Replies View Related

Transact SQL :: Find Single Largest Table In Entire Instance

Nov 16, 2015

I usually go for the largest datafile and then query in-there...But now I need to automate it for several instances... I need to be able with one script quickly retrieve the top 5 largest tables for the entire instance,not by database...

View 3 Replies View Related

Sys.dm_os_memory_cache_counters Vs. SQL Server:Plan Cache Cache

Feb 15, 2008

Hi guys,

I am looking at the plan caches/cached pages from the perspective of
sys.dm_os_memory_cache_counters and sql serverlan Cache - Cache Pages

For the first one I am using

select (sum(single_pages_kb) + sum(multi_pages_kb) )
from sys.dm_os_memory_cache_counters
where type = 'CACHESTORE_SQLCP' or type = 'CACHESTORE_OBJCP'
a slight change from a query in
http://blogs.msdn.com/sqlprogrammability/

For the second just perfmon.

The first one gives me a count of about 670,000 pages only for the object and query cache and the second one gives me a total of about 100,000 pages for five type of caches including object and query.

If I am using the query from http://blogs.msdn.com/sqlprogrammability/ to determin the plan cache size

select (sum(single_pages_kb) + sum(multi_pages_kb) ) * 8 / (1024.0 * 1024.0) as plan_cache_in_GB
from sys.dm_os_memory_cache_counters
where type = 'CACHESTORE_SQLCP' or type = 'CACHESTORE_OBJCP'

it gives me about 5 GB when in fact my SQL Server it can access only max 2GB with Total and Target Server Memory at about 1.5 GB.

Does anyone have any idea what is going on?

View 2 Replies View Related

Table In Cache

Jul 9, 2002

Hello,

Can u put table in cache in MS SQL Server?

Thanks
Rea

View 1 Replies View Related

Large Table Hogging Cache

Dec 5, 2006

Using SQL Server 2000, SP1 with 4Gb max memory allocated to the instance. The problem is that one large table is hogging cache and it's dragging down overall query performance. I realise it's in cache because it's getting queried regulary. However, I need to know what options exist to get around this problem - to free up some cache for other tables and indexes? Of course, there is the option of archiving off some the data in the table to reduce its size and we will look at doing this although it will not be as easy as it sounds.

I can imagine that there must be many databases that have at least one large table that is getting hit regularly and is left in cache more-or-less permanently. Therefore, I can't believe I have an usual problem.

Thanks in advance,
Zarty

View 2 Replies View Related

Integration Services :: Lookup Transformation - Used Destination Table For Reference Using Full Cache Mode

Jul 1, 2015

My source has 2.2 million of records. I'm performing the incremental load.In the lookup transformation i used the destination table for the reference using Full cache mode.For the first time package executed successfully but when i executed the package second time, Suddenly Package hangs while running.Than i truncate the data from the destination table and restart the SQL Server Services.After doing all this i executed package again and it worked but when i executed package second time, again package hangs up .I have 8GB RAM and i5 2.5 GHz Processor laptop.

View 7 Replies View Related

Make A Horizontal Table Into A Vertical Table

Nov 19, 2004

Hi All,
Any assistance would be greatly appreciated.

I have a current table which I create on a regular basis from a text file with a layout similar to this:
TypePolicy #AmountRider 1 AmtRider 2 Amt
B1112H24.341212.34

This text file is brought into a staging table with each field (even the amount field) as a varchar (12). I then assign types in a later step in my DTS package.

What I need to do is stack the riders under each policy so for each policy where there is a rider, there is a new row for every rider.
So in the example I've given, there would be 2 additional rows for the original first row since there are two riders.
TypePolicy #Amount
B1112H24.34
R11112H12
R21112H12.34

I plan on doing this by first creating a table with just the Type, Policy #, and Amt fields, and then using a series of insert queries where I take the rider (if there is one) and append it onto the table.

However, I'm getting the following error message when I try:
Server: Msg 213, Level 16, State 4, Line 1
Insert Error: Column name or number of supplied values does not match table definition.

Basically, it wouldn't let me put an 'R1' in the Type column.
How can I get this to work!?!?

Thanks in advance for your help

View 6 Replies View Related

Naming A New Table From A Make Table Query

Mar 25, 2004

I want to use a Make Table Query to generate a new read-only Table. This I can do but my problem is that I want to be able to name the new Table containing only the records from a calendar year; e.y. Rents2001 and the next year another new table would be created and called Rents2002 and next year Rents2003 ...............

I require the Table to be generated yearly. I know I could do this in other ways but I really require the Table as once I have it I will be doing other things with it to give the final report.

Any suggestions how I can generate the Table with the YEAR being in the Table Name as part of running the Make Table Query? Thanks

View 4 Replies View Related

Make A Backup Of A Table

Apr 27, 2007

What is the best way (short of backing up the entire DB) to make a copy of a Table so that It can be easily restored. We have a table that we want to make some serious changes to, but I want to make sure I can restore if if I need to (if the changes don't work)

View 10 Replies View Related

Make Table Unreadable

Sep 19, 2007

Hi all, I have a problem. I need a query that blocks table and makes it unreadable. I decided to use WAITFOR to long blocking.


BEGIN TRAN myStopReadTrans

USE MyDatabase
SELECT * From dbo.AB with(readpast,updlock)

WAITFOR DELAY '1:00:00'

COMMIT



USE MyDatabase
Select name from dbo.Clients

View 10 Replies View Related

How To Make Table Name Dynamic

Dec 31, 2007



Hi,

In my application i need to access mutiple table. I'm writing a stored procedure
in which i need to access tables such as TB01,TB02 .. Basically TBFY
where FY is parameter.

I tried for OPENQUERY, but that needs me to add a linked server, which i don't
think is a good idea.

Can anyone suggest on how can i do so?


I'm using SqlServer2000.

Thanks.

View 6 Replies View Related

How To Make Table Name Dynamic

Nov 19, 2007

Hi,

I have a requirement where i need to build the table name dynamically in the following queries.


declare @REF_DATA_TYPE nvarchar(20)

set @REF_DATA_TYPE='COUNTRY'



these are 4 cases where i need to use the table name dynamically

1. IF exists(select 1 from 'MD_REF_'+@REF_DATA_TYPE where code=@code_T)

2. Update 'MD_TB_REF_'+@REF_DATA_TYPE

3. from @ACTUAL_DATA p join 'MD_REF_'+@REF_DATA_TYPE T on T.code=P.code

4. INSERT INTO 'MD_REF_'+@REF_DATA_TYPE(Code,[Name],Description)


But i am getting error when i do this.

Please let me know what to do to solve this

Thanks in advance

View 5 Replies View Related

Procedure Or Query To Make A Comma-separated String From One Table And Update Another Table's Field With This String.

Feb 13, 2006

We have the following two tables :

Link  ( GroupID int , MemberID int )
Member ( MemberID int , MemberName varchar(50), GroupID varchar(255) )

The Link table contains the records showing which Member is in which Group. One particular Member can be in
multiple Groups and also a particular Group may have multiple Members.

The Member table contains the Member's ID, Member's Name, and a Group ID field (that will contains comma-separated
Groups ID, showing in which Groups the particular Member is in).

We have the Link table ready, and the Member table' with first two fields is also ready. What we have to do now is to
fill the GroupID field of the Member table, from the Link Table.

For instance,

Read all the GroupID field from the Link table against a MemberID, make a comma-separated string of the GroupID,
then update the GroupID field of the corresponding Member in the Member table.

Please help me with a sql query or procedures that will do this job. I am using SQL SERVER 2000.

View 1 Replies View Related

Execute A Vb.net File When I Make Some Changes In A Table

Mar 7, 2007

I want to execute a vb.net 
file

When I make some changes in a table.

 

How can I handle this situation?

 I am using sql server
2005 express edition sujith 

 

View 1 Replies View Related

How To Make Or Add A Table With A Field With Default Value

Nov 7, 2007

 I am doing a shopping basket type demo.I have difficulties going from table with fields like (Name,ProductCode) to table(Name, ProductCode, NumberOfItems). One way could be adding just Name and ProductCode fields and let NumberOfItems come automatically. It could have some common value like 1.  How should I do this with VB. 

View 1 Replies View Related

How Can I Make A Script Out Of A Table Data ?

Aug 30, 2003

Hello,

I want to take a table (SQL server) and show all it's data in a form of INSERT... (text file)
so that I can show it on a web-page and just paste the INSERT text into a MyTableData.sql
and then I can just run this script on the Query analyzer and fill my table with data

I need it so I can backup my DATA both in English and other languages...
(a replacement for the DTS packages that gives me hard time with the LOCALE / UNICODE translation)


did anyone already made such program ?
where can I find something like this ?

View 3 Replies View Related







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