Monday, March 19, 2012
Access
1) I have an access file with many tables.I want to replicate this access file but without data.Means I want to make a copy of the access file with the same tables with same design but without any data.How to do that?
2)In one of my DTS data goes from SQL to Access.I want to truncate few access tables before this DTS package is run.It should be done through SQL.How can I do that?replicate without data? what do you mean? any table change should result in a change on a table in sqlserver?
Sunday, February 19, 2012
about search query
1. ignore whether the search keyword is Upper case or lower Case
2. deal with tense or verb form related problem
eg. comparing --> also search compare
Any Idea
1. ignore whether the search keyword is Upper case or lower Case
SQL Queries are case insensitive.
2. deal with tense or verb form related problem
eg. comparing --> also search compare
Any Idea
No idea. I am unable to understand your question.
|||
sorry for my unclear idea!
What I want to do:
If people input the word in (a), the ColA contain word (b) will also be selected.
For example, select count(*) from tableA where ColA like '%compare%' , or sth like that
(a) (b)
1.CASW Casw
2.compare comparing
1. Since the keyword is in '', the case is sensitive, so Casw should not be select
2. Similary, since search compare will include provide result which have comparing,
Thx
Table A
Col_1 Col_hobby
Tom football, piano, reading, playing computer game, compare
Sam Football, piano, reading, comparing
When people use the query
select * from tableA where Col_hobby like '%Football%'
Only Tom record is selected, since the string in '' is sensitive the case. Any way to make it insensitve?
select * from tableA where Col_hobby like '%compare%'
Any way to make the query get the sam record?
|||Use the SQL Lower function to make the field in lower case and the searched keyword in lower case, that way you can get the desired result.|||you should get both records without having to worry about case.|||
ndinakar wrote:
you should get both records without having to worry about case.
Are you sure about that? I have tried several times a query like this:
select * from tableA where Col_hobby like '%Football%'
and it doesnt return the rows where col_hobby has the value 'football', but it does return the values with 'Football'|||
DECLARE @.tTABLE (colAvarchar(10), colBvarchar(100))
INSERTINTO @.tVALUES ('Tom','FOOTBALL,PIANO')
INSERTINTO @.tVALUES ('Sam','football,piano,volleyball')
SELECT*FROM @.tWHERE colBLIKE'%football%'
-------------
(1 row(s) affected)
(1 row(s) affected)
colA colB
---- ------------------------------
Tom FOOTBALL,PIANO
Sam football,piano,volleyball
(2 row(s) affected)
|||Thanks for the followup ndinkar. I always that my query didnt worked.about related parameters
user selects paraA=B then paraB will appears.can this be achieved?Yes, sort of.
You can't have them hidden, but you can have them dependent on one
another so that B can't be selected until after A is, etc.
You would need seperate data sources set up for stored procedures
similar to the following, the paramiters would need to be set up to
query the data source for values:
(optional, you could manually add these values or allow the user to
type a value)
GetParaAList
(required)
GetParaBList @.ParaA
GetParaCList @.ParaB
GetParaDList @.ParaC
You could then have a final stored proceedure:
GetMyReportValues @.ParaA, @.ParaB, @.ParaC, @.ParaD
Note that in this case the report cannot be run unless A,B,C, and D
have values selected.
Monday, February 13, 2012
About indexes
I am trying to research about indexes and find out performance issues
related with indexes. My Questions are :
1) are indexes useful if we are using Bulk operations?
2) does indexes have any effect on simple INSERT or DELETE statements?
3) Do we need to drop indexes before Bulk operations
4) Is individual insert statement in a loop treated as a bulk insertion?
Regards,
Abdul-Rahman1) No, they have overhead. You could play with having the data sorted as per the clustered index and
specifying such an hint for the BULK load. Something you have to test for yourself.
2) Yes, they are maintained.
3) Not needed, but most often beneficial. Test and see.
4) No.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"Abdul-Rahman" <rahman.mahmood@.pk.softecheww.com> wrote in message
news:uH$mJvHCFHA.3908@.TK2MSFTNGP12.phx.gbl...
> Dear MSSQL DBAs,
> I am trying to research about indexes and find out performance issues
> related with indexes. My Questions are :
> 1) are indexes useful if we are using Bulk operations?
> 2) does indexes have any effect on simple INSERT or DELETE statements?
> 3) Do we need to drop indexes before Bulk operations
> 4) Is individual insert statement in a loop treated as a bulk insertion?
> Regards,
> Abdul-Rahman
>|||Please see my reply to your previous post on the subject.
--
Paul Randal
Dev Lead, Microsoft SQL Server Storage Engine
This posting is provided "AS IS" with no warranties, and confers no rights.
"Abdul-Rahman" <rahman.mahmood@.pk.softecheww.com> wrote in message
news:uH$mJvHCFHA.3908@.TK2MSFTNGP12.phx.gbl...
> Dear MSSQL DBAs,
> I am trying to research about indexes and find out performance issues
> related with indexes. My Questions are :
> 1) are indexes useful if we are using Bulk operations?
> 2) does indexes have any effect on simple INSERT or DELETE statements?
> 3) Do we need to drop indexes before Bulk operations
> 4) Is individual insert statement in a loop treated as a bulk insertion?
> Regards,
> Abdul-Rahman
>|||"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:eJozkCJCFHA.4004@.tk2msftngp13.phx.gbl...
> 1) No, they have overhead. You could play with having the data sorted as
per the clustered index and
> specifying such an hint for the BULK load. Something you have to test for
yourself.
> 2) Yes, they are maintained.
> 3) Not needed, but most often beneficial. Test and see.
For example, on a quarterly load we do, dropping the indices makes a HUGE
difference (on the order of 6 hours vs. 48 hours).
In other cases, it's not worth the trouble. So, as Tibor says, test.