Showing posts with label text. Show all posts
Showing posts with label text. Show all posts

Monday, March 26, 2012

query

Hi
I have a following problem;
Lets say i have table with names and value in this table "hkan"
Now user enters text "hakan" for search and query must return alsow
"hkan".
Is in SQL any "special" function for this ?
one option is create own function, but there is toooo many different options
a-, o- aso aso.
Regards;
Meelis
Meelis,
This is where collations can help you. (Or hurt you.) If you were running a
Case Insensitive, Accent Insensitive collation it would do exactly what you
want. But do you always want this? Or only some of the time?
If you want to change the column definition:
ALTER TABLE MyTable
ALTER COLUMN MyAccentedColumn NVARCHAR(128)
COLLATE SQL_Latin1_General_Cp1_CI_AI
If you want to handle it in a query:
SELECT MyAccentedColumn
FROM MyTable
WHERE MyAccentedColumn COLLATE SQL_Latin1_General_Cp1_CI_AI =
@.MyParm COLLATE SQL_Latin1_General_Cp1_CI_AI
Of course, you should read about how collations work before jumping into
this, so that you choose the behaviour that you desire.
RLF
"Meelis Lilbok" <meelis.lilbok@.deltmar.ee> wrote in message
news:%23M0lfLtaHHA.4948@.TK2MSFTNGP05.phx.gbl...
> Hi
> I have a following problem;
> Lets say i have table with names and value in this table "hkan"
> Now user enters text "hakan" for search and query must return alsow
> "hkan".
> Is in SQL any "special" function for this ?
> one option is create own function, but there is toooo many different
> options a-, o- aso aso.
>
> Regards;
> Meelis
>

Query

Hi
Is there any T-SQL script/query to find out is full text search service
precent or not?
For example if i have SQL 2005 Express then no and yes if i have SQL 2005
Express Advanced?
Best regards
Mex
SELECT fulltextserviceproperty('IsFulltextInstalled')
returns 1 if it is installed 0 if it is not.
http://www.zetainteractive.com - Shift Happens!
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Meels Lilbok" <meelis.lilbok@.deltmar.ee> wrote in message
news:2514C014-0348-4B92-AA77-07A8B20F0BFD@.microsoft.com...
> Hi
> Is there any T-SQL script/query to find out is full text search service
> precent or not?
> For example if i have SQL 2005 Express then no and yes if i have SQL 2005
> Express Advanced?
>
> Best regards
> Mex
>

Query

i have written a SP to select multiple columns from a table.now how do i
display the same in the corresponding text boxes that i have in my form...If your text boxes are called text1 and text2, then you would say:
text1.Text = RecordSetVar("Column1")
text2.Text = RecordSetVar("Column2")
--
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"Smitha" <Smitha@.discussions.microsoft.com> wrote in message
news:82507647-4C68-45DB-9E84-457938670013@.microsoft.com...
>i have written a SP to select multiple columns from a table.now how do i
> display the same in the corresponding text boxes that i have in my form...

Friday, March 23, 2012

query

Hi
I have a following problem;
Lets say i have table with names and value in this table "håkan"
Now user enters text "hakan" for search and query must return alsow
"håkan".
Is in SQL any "special" function for this :)?
one option is create own function, but there is toooo many different options
a-ä, o-ö aso aso.
Regards;
MeelisMeelis,
This is where collations can help you. (Or hurt you.) If you were running a
Case Insensitive, Accent Insensitive collation it would do exactly what you
want. But do you always want this? Or only some of the time?
If you want to change the column definition:
ALTER TABLE MyTable
ALTER COLUMN MyAccentedColumn NVARCHAR(128)
COLLATE SQL_Latin1_General_Cp1_CI_AI
If you want to handle it in a query:
SELECT MyAccentedColumn
FROM MyTable
WHERE MyAccentedColumn COLLATE SQL_Latin1_General_Cp1_CI_AI = @.MyParm COLLATE SQL_Latin1_General_Cp1_CI_AI
Of course, you should read about how collations work before jumping into
this, so that you choose the behaviour that you desire.
RLF
"Meelis Lilbok" <meelis.lilbok@.deltmar.ee> wrote in message
news:%23M0lfLtaHHA.4948@.TK2MSFTNGP05.phx.gbl...
> Hi
> I have a following problem;
> Lets say i have table with names and value in this table "håkan"
> Now user enters text "hakan" for search and query must return alsow
> "håkan".
> Is in SQL any "special" function for this :)?
> one option is create own function, but there is toooo many different
> options a-ä, o-ö aso aso.
>
> Regards;
> Meelis
>

query

Hi
I have a following problem;
Lets say i have table with names and value in this table "hkan"
Now user enters text "hakan" for search and query must return alsow
"hkan".
Is in SQL any "special" function for this ?
one option is create own function, but there is toooo many different options
a-, o- aso aso.
Regards;
MeelisMeelis,
This is where collations can help you. (Or hurt you.) If you were running a
Case Insensitive, Accent Insensitive collation it would do exactly what you
want. But do you always want this? Or only some of the time?
If you want to change the column definition:
ALTER TABLE MyTable
ALTER COLUMN MyAccentedColumn NVARCHAR(128)
COLLATE SQL_Latin1_General_Cp1_CI_AI
If you want to handle it in a query:
SELECT MyAccentedColumn
FROM MyTable
WHERE MyAccentedColumn COLLATE SQL_Latin1_General_Cp1_CI_AI =
@.MyParm COLLATE SQL_Latin1_General_Cp1_CI_AI
Of course, you should read about how collations work before jumping into
this, so that you choose the behaviour that you desire.
RLF
"Meelis Lilbok" <meelis.lilbok@.deltmar.ee> wrote in message
news:%23M0lfLtaHHA.4948@.TK2MSFTNGP05.phx.gbl...
> Hi
> I have a following problem;
> Lets say i have table with names and value in this table "hkan"
> Now user enters text "hakan" for search and query must return alsow
> "hkan".
> Is in SQL any "special" function for this ?
> one option is create own function, but there is toooo many different
> options a-, o- aso aso.
>
> Regards;
> Meelis
>

Wednesday, March 21, 2012

Queries with "like" and full text indexes

Hi
I use ASPNET application using Sql Ser 2000 database. There are a lot of
queries using "like" statement.
I suffer bad performance of that application and I noticed in SQL Profiler
that those "like" queries takes a lot of time.
I heard about full text queries and I wonder if it could boost the queries
performance.
Please advise me if I'm right.
Best Regards
Darek T.Dariusz
Yes , if you use LIKE '%test%' so SQL Server probably will choose
TABLE/INDEX SCAN to perfom the query , however using LIKE 'test'% will
INDXEX/CLUSTERED INDEX SEEK. Well , obviously it depends on many things and
we don't know how do you run the queries?
I can't say that you are going to gain some benefits (in terms of
perfomance) of using FTI due to not using this feature for long time , so
maybe someone else can provide more info.
"Dariusz Tomon" <d.tomon@.mazars.pl> wrote in message
news:%23uECaDZfGHA.3652@.TK2MSFTNGP02.phx.gbl...
> Hi
> I use ASPNET application using Sql Ser 2000 database. There are a lot of
> queries using "like" statement.
> I suffer bad performance of that application and I noticed in SQL Profiler
> that those "like" queries takes a lot of time.
> I heard about full text queries and I wonder if it could boost the queries
> performance.
> Please advise me if I'm right.
>
> Best Regards
> Darek T.
>|||In most cases it will. If you have a restriction the restriction will be
applied after the results set comes back from the query of the full text
catalog. If you are returning a large number of rows this will be
expensive.
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Dariusz Tomon" <d.tomon@.mazars.pl> wrote in message
news:%23uECaDZfGHA.3652@.TK2MSFTNGP02.phx.gbl...
> Hi
> I use ASPNET application using Sql Ser 2000 database. There are a lot of
> queries using "like" statement.
> I suffer bad performance of that application and I noticed in SQL Profiler
> that those "like" queries takes a lot of time.
> I heard about full text queries and I wonder if it could boost the queries
> performance.
> Please advise me if I'm right.
>
> Best Regards
> Darek T.
>

Queries with "like" and full text indexes

Hi
I use ASPNET application using Sql Ser 2000 database. There are a lot of
queries using "like" statement.
I suffer bad performance of that application and I noticed in SQL Profiler
that those "like" queries takes a lot of time.
I heard about full text queries and I wonder if it could boost the queries
performance.
Please advise me if I'm right.
Best Regards
Darek T.Please don't multipost , I have just answered the question in .programming
"Dariusz Tomon" <d.tomon@.mazars.pl> wrote in message
news:uEudZDZfGHA.3652@.TK2MSFTNGP02.phx.gbl...
> Hi
> I use ASPNET application using Sql Ser 2000 database. There are a lot of
> queries using "like" statement.
> I suffer bad performance of that application and I noticed in SQL Profiler
> that those "like" queries takes a lot of time.
> I heard about full text queries and I wonder if it could boost the queries
> performance.
> Please advise me if I'm right.
>
> Best Regards
> Darek T.
>|||ok, sorry
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:euvWZNZfGHA.1856@.TK2MSFTNGP03.phx.gbl...
> Please don't multipost , I have just answered the question in .programming
> "Dariusz Tomon" <d.tomon@.mazars.pl> wrote in message
> news:uEudZDZfGHA.3652@.TK2MSFTNGP02.phx.gbl...
>

Queries with "like" and full text indexes

Hi
I use ASPNET application using Sql Ser 2000 database. There are a lot of
queries using "like" statement.
I suffer bad performance of that application and I noticed in SQL Profiler
that those "like" queries takes a lot of time.
I heard about full text queries and I wonder if it could boost the queries
performance.
Please advise me if I'm right.
Best Regards
Darek T.Please don't multipost , I have just answered the question in .programming
"Dariusz Tomon" <d.tomon@.mazars.pl> wrote in message
news:uEudZDZfGHA.3652@.TK2MSFTNGP02.phx.gbl...
> Hi
> I use ASPNET application using Sql Ser 2000 database. There are a lot of
> queries using "like" statement.
> I suffer bad performance of that application and I noticed in SQL Profiler
> that those "like" queries takes a lot of time.
> I heard about full text queries and I wonder if it could boost the queries
> performance.
> Please advise me if I'm right.
>
> Best Regards
> Darek T.
>|||ok, sorry
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:euvWZNZfGHA.1856@.TK2MSFTNGP03.phx.gbl...
> Please don't multipost , I have just answered the question in .programming
> "Dariusz Tomon" <d.tomon@.mazars.pl> wrote in message
> news:uEudZDZfGHA.3652@.TK2MSFTNGP02.phx.gbl...
>> Hi
>> I use ASPNET application using Sql Ser 2000 database. There are a lot of
>> queries using "like" statement.
>> I suffer bad performance of that application and I noticed in SQL
>> Profiler that those "like" queries takes a lot of time.
>> I heard about full text queries and I wonder if it could boost the
>> queries performance.
>> Please advise me if I'm right.
>>
>> Best Regards
>> Darek T.
>

Queries on linked server are very slow.

This is a multi-part message in MIME format.
--=_NextPart_000_0063_01C35A9F.BBD8E6C0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi All,
We have been using linked servers for the past 3 years, and we never had = any issues with the linked servers.
Now suddenly all the queries against the linkes servers are very very = slow, Some queries takes 4 hours to run before they were only taking 5 = secondsa to run.
I have no idea what is causing this delay.
Can any of you please help,
Thanks
Raju
--=_NextPart_000_0063_01C35A9F.BBD8E6C0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&
Hi All,

We have been using linked servers for the past 3 = years, and we never had any issues with the linked servers.

Now suddenly all the queries against the linkes = servers are very very slow, Some queries takes 4 hours to run before they were = only taking 5 secondsa to run.

I have no idea what is causing this = delay.

Can any of you please help,

Thanks
Raju
--=_NextPart_000_0063_01C35A9F.BBD8E6C0--This is a multi-part message in MIME format.
--=_NextPart_000_09CC_01C35B33.D6EE3160
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Raju,
of course you need to look at the obvious changes -- what changes have =been made in your systems and network that may cause this.
On the sql server side, you can run profiler to catch the long running =queries and analyze the results.
More information is needed for the folks here to join your trouble =shooting.
Quentin
"Raju" <npraju1@.hotmail.com> wrote in message =news:uWFSoptWDHA.2040@.TK2MSFTNGP11.phx.gbl...
Hi All,
We have been using linked servers for the past 3 years, and we never =had any issues with the linked servers.
Now suddenly all the queries against the linkes servers are very very =slow, Some queries takes 4 hours to run before they were only taking 5 =secondsa to run.
I have no idea what is causing this delay.
Can any of you please help,
Thanks
Raju
--=_NextPart_000_09CC_01C35B33.D6EE3160
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&

Raju,
of course you need to look at the =obvious changes -- what changes have been made in your systems and network that may =cause this.
On the sql server side, you can run =profiler to catch the long running queries and analyze the results. =
More information is needed for the =folks here to join your trouble shooting.
Quentin
"Raju" wrote =in message news:uWFSoptWDHA.2040=@.TK2MSFTNGP11.phx.gbl...
Hi All,

We have been using linked servers for the past =3 years, and we never had any issues with the linked servers.

Now suddenly all the queries against the =linkes servers are very very slow, Some queries takes 4 hours to run before they were =only taking 5 secondsa to run.

I have no idea what is causing this =delay.

Can any of you please help,

Thanks
Raju

--=_NextPart_000_09CC_01C35B33.D6EE3160--|||This is a multi-part message in MIME format.
--=_NextPart_000_0135_01C35CC8.907BE880
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I did use sp_who2 active, I don't see any blocks.

I tried linking the same server to different server and ran the query, =it worked fine.

Net work everything looks fine, I am suspecting it has to do with =protocols but I am not sure.

Even if it is a protocol issue have no idea how to troubleshoot and fix =the protocol related problems.


Thanks
Raju
"Quentin Ran" <ab@.who.com> wrote in message =news:ODdoo11WDHA.2424@.TK2MSFTNGP12.phx.gbl...
Raju,
of course you need to look at the obvious changes -- what changes have =been made in your systems and network that may cause this.
On the sql server side, you can run profiler to catch the long running =queries and analyze the results.
More information is needed for the folks here to join your trouble =shooting.
Quentin
"Raju" <npraju1@.hotmail.com> wrote in message =news:uWFSoptWDHA.2040@.TK2MSFTNGP11.phx.gbl...
Hi All,
We have been using linked servers for the past 3 years, and we never =had any issues with the linked servers.
Now suddenly all the queries against the linkes servers are very =very slow, Some queries takes 4 hours to run before they were only =taking 5 secondsa to run.
I have no idea what is causing this delay.
Can any of you please help,
Thanks
Raju
--=_NextPart_000_0135_01C35CC8.907BE880
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&

I did use sp_who2 active, =I don't see any blocks.
I tried linking the same =server to different server and ran the query, it worked =fine.
Net work everything looks =fine, I am suspecting it has to do with protocols but I am not =sure.
Even if it is a protocol =issue have no idea how to troubleshoot and fix the protocol related problems.
Thanks
Raju
"Quentin Ran" wrote in message news:ODdoo11WDHA.2424=@.TK2MSFTNGP12.phx.gbl...
Raju,

of course you need to look at the =obvious changes -- what changes have been made in your systems and network that may =cause this.

On the sql server side, you can run =profiler to catch the long running queries and analyze the results. =
More information is needed for the =folks here to join your trouble shooting.

Quentin

"Raju" =wrote in message news:uWFSoptWDHA.2040=@.TK2MSFTNGP11.phx.gbl...
Hi All,

We have been using linked servers for the =past 3 years, and we never had any issues with the linked =servers.

Now suddenly all the queries against the =linkes servers are very very slow, Some queries takes 4 hours to run before =they were only taking 5 secondsa to run.

I have no idea what is causing this delay.

Can any of you please help,

Thanks
Raju

--=_NextPart_000_0135_01C35CC8.907BE880--sql

Tuesday, March 20, 2012

Queries and wildcards

I am trying to write a query with a wildcard as part of it. the table that I
am looking at is mostly text (they are smdr logs from my phone system) I
currently use access to write the queries connected to SQL server. in the
example below I need to put 1150 and 1152 for each of the t10xx numbers. I
would like to use a wildcard for the called_party but it does not work I have
tried *,#, and a few others but no success. any ideas would be helpful.
SELECT date, start_time, calling_party, called_party, rx_calls
FROM dbo.[All Phone Logs]
WHERE (calling_party = N't1050') AND (called_party = N'1150') OR
(calling_party = N't1051') AND (called_party = N'1150') OR
(calling_party = N't1052') AND (called_party = N'1150') OR
(calling_party = N't1053') AND (called_party = N'1150') OR
(calling_party = N't1054') AND (called_party = N'1150') OR
(calling_party = N't1055') AND (called_party = N'1150') OR
(calling_party = N't1056') AND (called_party = N'1150') OR
(calling_party = N't1057') AND (called_party = N'1150') OR
(calling_party = N't1058') AND (called_party = N'1150') OR
(calling_party = N't1059') AND (called_party = N'1150') OR
(calling_party = N't1060') AND (called_party = N'1150') OR
(calling_party = N't1051') AND (called_party = N'1152') OR
(calling_party = N't1052') AND (called_party = N'1152') OR
(calling_party = N't1053') AND (called_party = N'1152') OR
(calling_party = N't1054') AND (called_party = N'1152') OR
(calling_party = N't1055') AND (called_party = N'1152') OR
(calling_party = N't1056') AND (called_party = N'1152') OR
(calling_party = N't1057') AND (called_party = N'1152') OR
(calling_party = N't1058') AND (called_party = N'1152') OR
(calling_party = N't1059') AND (called_party = N'1152') OR
(calling_party = N't1060') AND (called_party = N'1152')The wild card characters supported in T-SQL are '%' and _ (underscore)
--
Roji. P. Thomas
Net Asset Management
http://toponewithties.blogspot.com
"Bill Farinella" <BillFarinella@.discussions.microsoft.com> wrote in message
news:A375B699-7ECF-4F4E-8DD2-F395D8B7C897@.microsoft.com...
>I am trying to write a query with a wildcard as part of it. the table that
>I
> am looking at is mostly text (they are smdr logs from my phone system) I
> currently use access to write the queries connected to SQL server. in the
> example below I need to put 1150 and 1152 for each of the t10xx numbers. I
> would like to use a wildcard for the called_party but it does not work I
> have
> tried *,#, and a few others but no success. any ideas would be helpful.
>
> SELECT date, start_time, calling_party, called_party, rx_calls
> FROM dbo.[All Phone Logs]
> WHERE (calling_party = N't1050') AND (called_party = N'1150') OR
> (calling_party = N't1051') AND (called_party => N'1150') OR
> (calling_party = N't1052') AND (called_party => N'1150') OR
> (calling_party = N't1053') AND (called_party => N'1150') OR
> (calling_party = N't1054') AND (called_party => N'1150') OR
> (calling_party = N't1055') AND (called_party => N'1150') OR
> (calling_party = N't1056') AND (called_party => N'1150') OR
> (calling_party = N't1057') AND (called_party => N'1150') OR
> (calling_party = N't1058') AND (called_party => N'1150') OR
> (calling_party = N't1059') AND (called_party => N'1150') OR
> (calling_party = N't1060') AND (called_party => N'1150') OR
> (calling_party = N't1051') AND (called_party => N'1152') OR
> (calling_party = N't1052') AND (called_party => N'1152') OR
> (calling_party = N't1053') AND (called_party => N'1152') OR
> (calling_party = N't1054') AND (called_party => N'1152') OR
> (calling_party = N't1055') AND (called_party => N'1152') OR
> (calling_party = N't1056') AND (called_party => N'1152') OR
> (calling_party = N't1057') AND (called_party => N'1152') OR
> (calling_party = N't1058') AND (called_party => N'1152') OR
> (calling_party = N't1059') AND (called_party => N'1152') OR
> (calling_party = N't1060') AND (called_party => N'1152')
>|||On Wed, 23 Nov 2005 07:30:11 -0800, Bill Farinella wrote:
>I am trying to write a query with a wildcard as part of it. the table that I
>am looking at is mostly text (they are smdr logs from my phone system) I
>currently use access to write the queries connected to SQL server. in the
>example below I need to put 1150 and 1152 for each of the t10xx numbers. I
>would like to use a wildcard for the called_party but it does not work I have
>tried *,#, and a few others but no success. any ideas would be helpful.
(snip)
Hi Bill,
In this case, you might want to use IN instead of wildcards:
SELECT date, start_time, calling_party, called_party, rx_calls
FROM dbo.[All Phone Logs]
WHERE calling_party IN (N't1050', N't1051', ..., N't1060')
AND called_part IN (N'1150', N'1152')
Note: the ellipsis in the query above should be substituted by the full
list of valued you want to search for in calling_party.
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)|||Wow, Thanks That worked great!! :) I wish I posted this sooner now. It could
have saved me days worth of work.
Thanks again,
Bill
"Hugo Kornelis" wrote:
> On Wed, 23 Nov 2005 07:30:11 -0800, Bill Farinella wrote:
> >I am trying to write a query with a wildcard as part of it. the table that I
> >am looking at is mostly text (they are smdr logs from my phone system) I
> >currently use access to write the queries connected to SQL server. in the
> >example below I need to put 1150 and 1152 for each of the t10xx numbers. I
> >would like to use a wildcard for the called_party but it does not work I have
> >tried *,#, and a few others but no success. any ideas would be helpful.
> (snip)
> Hi Bill,
> In this case, you might want to use IN instead of wildcards:
> SELECT date, start_time, calling_party, called_party, rx_calls
> FROM dbo.[All Phone Logs]
> WHERE calling_party IN (N't1050', N't1051', ..., N't1060')
> AND called_part IN (N'1150', N'1152')
> Note: the ellipsis in the query above should be substituted by the full
> list of valued you want to search for in calling_party.
> Best, Hugo
> --
> (Remove _NO_ and _SPAM_ to get my e-mail address)
>

Queries and wildcards

I am trying to write a query with a wildcard as part of it. the table that I
am looking at is mostly text (they are smdr logs from my phone system) I
currently use access to write the queries connected to SQL server. in the
example below I need to put 1150 and 1152 for each of the t10xx numbers. I
would like to use a wildcard for the called_party but it does not work I hav
e
tried *,#, and a few others but no success. any ideas would be helpful.
SELECT date, start_time, calling_party, called_party, rx_calls
FROM dbo.[All Phone Logs]
WHERE (calling_party = N't1050') AND (called_party = N'1150') OR
(calling_party = N't1051') AND (called_party =
N'1150') OR
(calling_party = N't1052') AND (called_party =
N'1150') OR
(calling_party = N't1053') AND (called_party =
N'1150') OR
(calling_party = N't1054') AND (called_party =
N'1150') OR
(calling_party = N't1055') AND (called_party =
N'1150') OR
(calling_party = N't1056') AND (called_party =
N'1150') OR
(calling_party = N't1057') AND (called_party =
N'1150') OR
(calling_party = N't1058') AND (called_party =
N'1150') OR
(calling_party = N't1059') AND (called_party =
N'1150') OR
(calling_party = N't1060') AND (called_party =
N'1150') OR
(calling_party = N't1051') AND (called_party =
N'1152') OR
(calling_party = N't1052') AND (called_party =
N'1152') OR
(calling_party = N't1053') AND (called_party =
N'1152') OR
(calling_party = N't1054') AND (called_party =
N'1152') OR
(calling_party = N't1055') AND (called_party =
N'1152') OR
(calling_party = N't1056') AND (called_party =
N'1152') OR
(calling_party = N't1057') AND (called_party =
N'1152') OR
(calling_party = N't1058') AND (called_party =
N'1152') OR
(calling_party = N't1059') AND (called_party =
N'1152') OR
(calling_party = N't1060') AND (called_party = N'1152')The wild card characters supported in T-SQL are '%' and _ (underscore)
Roji. P. Thomas
Net Asset Management
http://toponewithties.blogspot.com
"Bill Farinella" <BillFarinella@.discussions.microsoft.com> wrote in message
news:A375B699-7ECF-4F4E-8DD2-F395D8B7C897@.microsoft.com...
>I am trying to write a query with a wildcard as part of it. the table that
>I
> am looking at is mostly text (they are smdr logs from my phone system) I
> currently use access to write the queries connected to SQL server. in the
> example below I need to put 1150 and 1152 for each of the t10xx numbers. I
> would like to use a wildcard for the called_party but it does not work I
> have
> tried *,#, and a few others but no success. any ideas would be helpful.
>
> SELECT date, start_time, calling_party, called_party, rx_calls
> FROM dbo.[All Phone Logs]
> WHERE (calling_party = N't1050') AND (called_party = N'1150') OR
> (calling_party = N't1051') AND (called_party =
> N'1150') OR
> (calling_party = N't1052') AND (called_party =
> N'1150') OR
> (calling_party = N't1053') AND (called_party =
> N'1150') OR
> (calling_party = N't1054') AND (called_party =
> N'1150') OR
> (calling_party = N't1055') AND (called_party =
> N'1150') OR
> (calling_party = N't1056') AND (called_party =
> N'1150') OR
> (calling_party = N't1057') AND (called_party =
> N'1150') OR
> (calling_party = N't1058') AND (called_party =
> N'1150') OR
> (calling_party = N't1059') AND (called_party =
> N'1150') OR
> (calling_party = N't1060') AND (called_party =
> N'1150') OR
> (calling_party = N't1051') AND (called_party =
> N'1152') OR
> (calling_party = N't1052') AND (called_party =
> N'1152') OR
> (calling_party = N't1053') AND (called_party =
> N'1152') OR
> (calling_party = N't1054') AND (called_party =
> N'1152') OR
> (calling_party = N't1055') AND (called_party =
> N'1152') OR
> (calling_party = N't1056') AND (called_party =
> N'1152') OR
> (calling_party = N't1057') AND (called_party =
> N'1152') OR
> (calling_party = N't1058') AND (called_party =
> N'1152') OR
> (calling_party = N't1059') AND (called_party =
> N'1152') OR
> (calling_party = N't1060') AND (called_party =
> N'1152')
>|||On Wed, 23 Nov 2005 07:30:11 -0800, Bill Farinella wrote:

>I am trying to write a query with a wildcard as part of it. the table that
I
>am looking at is mostly text (they are smdr logs from my phone system) I
>currently use access to write the queries connected to SQL server. in the
>example below I need to put 1150 and 1152 for each of the t10xx numbers. I
>would like to use a wildcard for the called_party but it does not work I ha
ve
>tried *,#, and a few others but no success. any ideas would be helpful.
(snip)
Hi Bill,
In this case, you might want to use IN instead of wildcards:
SELECT date, start_time, calling_party, called_party, rx_calls
FROM dbo.[All Phone Logs]
WHERE calling_party IN (N't1050', N't1051', ..., N't1060')
AND called_part IN (N'1150', N'1152')
Note: the ellipsis in the query above should be substituted by the full
list of valued you want to search for in calling_party.
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)|||Wow, Thanks That worked great!! I wish I posted this sooner now. It could
have saved me days worth of work.
Thanks again,
Bill
"Hugo Kornelis" wrote:

> On Wed, 23 Nov 2005 07:30:11 -0800, Bill Farinella wrote:
>
> (snip)
> Hi Bill,
> In this case, you might want to use IN instead of wildcards:
> SELECT date, start_time, calling_party, called_party, rx_calls
> FROM dbo.[All Phone Logs]
> WHERE calling_party IN (N't1050', N't1051', ..., N't1060')
> AND called_part IN (N'1150', N'1152')
> Note: the ellipsis in the query above should be substituted by the full
> list of valued you want to search for in calling_party.
> Best, Hugo
> --
> (Remove _NO_ and _SPAM_ to get my e-mail address)
>

Queries and wildcards

I am trying to write a query with a wildcard as part of it. the table that I
am looking at is mostly text (they are smdr logs from my phone system) I
currently use access to write the queries connected to SQL server. in the
example below I need to put 1150 and 1152 for each of the t10xx numbers. I
would like to use a wildcard for the called_party but it does not work I have
tried *,#, and a few others but no success. any ideas would be helpful.
SELECT date, start_time, calling_party, called_party, rx_calls
FROM dbo.[All Phone Logs]
WHERE (calling_party = N't1050') AND (called_party = N'1150') OR
(calling_party = N't1051') AND (called_party =
N'1150') OR
(calling_party = N't1052') AND (called_party =
N'1150') OR
(calling_party = N't1053') AND (called_party =
N'1150') OR
(calling_party = N't1054') AND (called_party =
N'1150') OR
(calling_party = N't1055') AND (called_party =
N'1150') OR
(calling_party = N't1056') AND (called_party =
N'1150') OR
(calling_party = N't1057') AND (called_party =
N'1150') OR
(calling_party = N't1058') AND (called_party =
N'1150') OR
(calling_party = N't1059') AND (called_party =
N'1150') OR
(calling_party = N't1060') AND (called_party =
N'1150') OR
(calling_party = N't1051') AND (called_party =
N'1152') OR
(calling_party = N't1052') AND (called_party =
N'1152') OR
(calling_party = N't1053') AND (called_party =
N'1152') OR
(calling_party = N't1054') AND (called_party =
N'1152') OR
(calling_party = N't1055') AND (called_party =
N'1152') OR
(calling_party = N't1056') AND (called_party =
N'1152') OR
(calling_party = N't1057') AND (called_party =
N'1152') OR
(calling_party = N't1058') AND (called_party =
N'1152') OR
(calling_party = N't1059') AND (called_party =
N'1152') OR
(calling_party = N't1060') AND (called_party = N'1152')
The wild card characters supported in T-SQL are '%' and _ (underscore)
Roji. P. Thomas
Net Asset Management
http://toponewithties.blogspot.com
"Bill Farinella" <BillFarinella@.discussions.microsoft.com> wrote in message
news:A375B699-7ECF-4F4E-8DD2-F395D8B7C897@.microsoft.com...
>I am trying to write a query with a wildcard as part of it. the table that
>I
> am looking at is mostly text (they are smdr logs from my phone system) I
> currently use access to write the queries connected to SQL server. in the
> example below I need to put 1150 and 1152 for each of the t10xx numbers. I
> would like to use a wildcard for the called_party but it does not work I
> have
> tried *,#, and a few others but no success. any ideas would be helpful.
>
> SELECT date, start_time, calling_party, called_party, rx_calls
> FROM dbo.[All Phone Logs]
> WHERE (calling_party = N't1050') AND (called_party = N'1150') OR
> (calling_party = N't1051') AND (called_party =
> N'1150') OR
> (calling_party = N't1052') AND (called_party =
> N'1150') OR
> (calling_party = N't1053') AND (called_party =
> N'1150') OR
> (calling_party = N't1054') AND (called_party =
> N'1150') OR
> (calling_party = N't1055') AND (called_party =
> N'1150') OR
> (calling_party = N't1056') AND (called_party =
> N'1150') OR
> (calling_party = N't1057') AND (called_party =
> N'1150') OR
> (calling_party = N't1058') AND (called_party =
> N'1150') OR
> (calling_party = N't1059') AND (called_party =
> N'1150') OR
> (calling_party = N't1060') AND (called_party =
> N'1150') OR
> (calling_party = N't1051') AND (called_party =
> N'1152') OR
> (calling_party = N't1052') AND (called_party =
> N'1152') OR
> (calling_party = N't1053') AND (called_party =
> N'1152') OR
> (calling_party = N't1054') AND (called_party =
> N'1152') OR
> (calling_party = N't1055') AND (called_party =
> N'1152') OR
> (calling_party = N't1056') AND (called_party =
> N'1152') OR
> (calling_party = N't1057') AND (called_party =
> N'1152') OR
> (calling_party = N't1058') AND (called_party =
> N'1152') OR
> (calling_party = N't1059') AND (called_party =
> N'1152') OR
> (calling_party = N't1060') AND (called_party =
> N'1152')
>
|||On Wed, 23 Nov 2005 07:30:11 -0800, Bill Farinella wrote:

>I am trying to write a query with a wildcard as part of it. the table that I
>am looking at is mostly text (they are smdr logs from my phone system) I
>currently use access to write the queries connected to SQL server. in the
>example below I need to put 1150 and 1152 for each of the t10xx numbers. I
>would like to use a wildcard for the called_party but it does not work I have
>tried *,#, and a few others but no success. any ideas would be helpful.
(snip)
Hi Bill,
In this case, you might want to use IN instead of wildcards:
SELECT date, start_time, calling_party, called_party, rx_calls
FROM dbo.[All Phone Logs]
WHERE calling_party IN (N't1050', N't1051', ..., N't1060')
AND called_part IN (N'1150', N'1152')
Note: the ellipsis in the query above should be substituted by the full
list of valued you want to search for in calling_party.
Best, Hugo
(Remove _NO_ and _SPAM_ to get my e-mail address)
|||Wow, Thanks That worked great!! I wish I posted this sooner now. It could
have saved me days worth of work.
Thanks again,
Bill
"Hugo Kornelis" wrote:

> On Wed, 23 Nov 2005 07:30:11 -0800, Bill Farinella wrote:
> (snip)
> Hi Bill,
> In this case, you might want to use IN instead of wildcards:
> SELECT date, start_time, calling_party, called_party, rx_calls
> FROM dbo.[All Phone Logs]
> WHERE calling_party IN (N't1050', N't1051', ..., N't1060')
> AND called_part IN (N'1150', N'1152')
> Note: the ellipsis in the query above should be substituted by the full
> list of valued you want to search for in calling_party.
> Best, Hugo
> --
> (Remove _NO_ and _SPAM_ to get my e-mail address)
>

Friday, March 9, 2012

QA stuck on 'Results in Text'

How do I get it back to the default 'Results in Grid'? No matter if I
change it and close, change is and save and close, it always comes up as
"Results in Text" and has to be changed everytime I open QA.
Scott
Configure it in Tools -> Options ->Results, if you are not already doing
that. It sure remembers this setting.
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"Wm. Scott Miller" <Scott.Miller@.spamkillerwvinsurance.gov> wrote in message
news:OLODrcgjFHA.3348@.tk2msftngp13.phx.gbl...
How do I get it back to the default 'Results in Grid'? No matter if I
change it and close, change is and save and close, it always comes up as
"Results in Text" and has to be changed everytime I open QA.
Scott
|||Yeah, the key word is "should" but it doesn't as I said in my original post.
I have not had problems in the past. But now I am completely stuck on
Results as Text no matter how I change it.
Scott
"Narayana Vyas Kondreddi" <answer_me@.hotmail.com> wrote in message
news:%239S5cugjFHA.3064@.TK2MSFTNGP15.phx.gbl...
> Configure it in Tools -> Options ->Results, if you are not already doing
> that. It sure remembers this setting.
> --
> HTH,
> Vyas, MVP (SQL Server)
> SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
>
> "Wm. Scott Miller" <Scott.Miller@.spamkillerwvinsurance.gov> wrote in
> message
> news:OLODrcgjFHA.3348@.tk2msftngp13.phx.gbl...
> How do I get it back to the default 'Results in Grid'? No matter if I
> change it and close, change is and save and close, it always comes up as
> "Results in Text" and has to be changed everytime I open QA.
> Scott
>
>
|||Wm. Scott Miller wrote:
> Yeah, the key word is "should" but it doesn't as I said in my
> original post. I have not had problems in the past. But now I am
> completely stuck on Results as Text no matter how I change it.
> Scott
>
Try setting the following key to 0:
HKEY_CURRENT_USER\Software\Microsoft\Microsoft SQL Server\80\Tools\SQL
Query Analyzer\Options\ResultsTab\DefResultsTarget
David Gugick
Quest Software
www.imceda.com
www.quest.com
|||David:
That key is already set to 0 (zero). So I tried to set it to 1 and open the
app. That fixed it. Thanks for the key.
Scott
"David Gugick" <david.gugick-nospam@.quest.com> wrote in message
news:uLdfgamkFHA.4000@.TK2MSFTNGP12.phx.gbl...
> Wm. Scott Miller wrote:
> Try setting the following key to 0:
> HKEY_CURRENT_USER\Software\Microsoft\Microsoft SQL Server\80\Tools\SQL
> Query Analyzer\Options\ResultsTab\DefResultsTarget
> --
> David Gugick
> Quest Software
> www.imceda.com
> www.quest.com

QA options

Hello,

In QA there are options for displaying results in TEXT, Grid or to a file. It is possible to lock these options so that only one is available. How is it possible to change it back to the default so that any of the 3 can be selected?

Hi there OldtimerMCSE,

There is an option.

From within SSMS go to Tools, Option, Query Results, SQL Server.

There you can select the destination.

Terrence Nevins

SQL Server Program Manager

|||

i dont think it is possible to lock/unlock the options

you may need to write your own query analyzer

QA options

Hello,

In QA there are options for displaying results in TEXT, Grid or to a file. It is possible to lock these options so that only one is available. How is it possible to change it back to the default so that any of the 3 can be selected?

Hi there OldtimerMCSE,

There is an option.

From within SSMS go to Tools, Option, Query Results, SQL Server.

There you can select the destination.

Terrence Nevins

SQL Server Program Manager

|||

i dont think it is possible to lock/unlock the options

you may need to write your own query analyzer

Wednesday, March 7, 2012

q; please check this trigger

Apparently I could not insert a text field to another table from INSERTED in
a trigger.
It seems the following is working, do you see any problem joining INSERTED
to the mySrcTable which is the table that has this trigger
INSERT INTO myRemoteDatabase.dbo.myDestTable (myTrID,myFirstName,myBigText)
SELECT i.myTrID, i.myFirstName, p.myBigText
FROM INSERTED i INNER JOIN mySrcTable p ON i.myTrID = p.myTrID
WHERE (i.myTrType = 'In')
Thanks,
Hi Jim
From Books Online "Create Trigger" topic
In a DELETE, INSERT, or UPDATE trigger, SQL Server does not allow text,
ntext, or image column references in the inserted and deleted tables if the
compatibility level is equal to 70. The text, ntext, and image values in the
inserted and deleted tables cannot be accessed. To retrieve the new value in
either an INSERT or UPDATE trigger, join the inserted table with the original
update table. When the compatibility level is 65 or lower, null values are
returned for inserted or deleted text, ntext, or image columns that allow
null values; zero-length strings are returned if the columns are not
nullable.
If the compatibility level is 80 or higher, SQL Server allows the update of
text, ntext, or image columns through the INSTEAD OF trigger on tables or
views.
If you use an instead of trigger your logic will have to be different as
mentioned in one of your earlier posts. If you are not going to hold more
than 8000 characters in this column change it to varchar.
John
"JIM.H." wrote:

> Apparently I could not insert a text field to another table from INSERTED in
> a trigger.
> It seems the following is working, do you see any problem joining INSERTED
> to the mySrcTable which is the table that has this trigger
> INSERT INTO myRemoteDatabase.dbo.myDestTable (myTrID,myFirstName,myBigText)
> SELECT i.myTrID, i.myFirstName, p.myBigText
> FROM INSERTED i INNER JOIN mySrcTable p ON i.myTrID = p.myTrID
> WHERE (i.myTrType = 'In')
> Thanks,
>
|||Thanks John.
"John Bell" wrote:
[vbcol=seagreen]
> Hi Jim
> From Books Online "Create Trigger" topic
> In a DELETE, INSERT, or UPDATE trigger, SQL Server does not allow text,
> ntext, or image column references in the inserted and deleted tables if the
> compatibility level is equal to 70. The text, ntext, and image values in the
> inserted and deleted tables cannot be accessed. To retrieve the new value in
> either an INSERT or UPDATE trigger, join the inserted table with the original
> update table. When the compatibility level is 65 or lower, null values are
> returned for inserted or deleted text, ntext, or image columns that allow
> null values; zero-length strings are returned if the columns are not
> nullable.
> If the compatibility level is 80 or higher, SQL Server allows the update of
> text, ntext, or image columns through the INSTEAD OF trigger on tables or
> views.
> If you use an instead of trigger your logic will have to be different as
> mentioned in one of your earlier posts. If you are not going to hold more
> than 8000 characters in this column change it to varchar.
> John
> "JIM.H." wrote:

q; please check this trigger

Apparently I could not insert a text field to another table from INSERTED in
a trigger.
It seems the following is working, do you see any problem joining INSERTED
to the mySrcTable which is the table that has this trigger
INSERT INTO myRemoteDatabase.dbo.myDestTable (myTrID,myFirstName,myBigText)
SELECT i.myTrID, i.myFirstName, p.myBigText
FROM INSERTED i INNER JOIN mySrcTable p ON i.myTrID = p.myTrID
WHERE (i.myTrType = 'In')
Thanks,Hi Jim
From Books Online "Create Trigger" topic
In a DELETE, INSERT, or UPDATE trigger, SQL Server does not allow text,
ntext, or image column references in the inserted and deleted tables if the
compatibility level is equal to 70. The text, ntext, and image values in the
inserted and deleted tables cannot be accessed. To retrieve the new value in
either an INSERT or UPDATE trigger, join the inserted table with the original
update table. When the compatibility level is 65 or lower, null values are
returned for inserted or deleted text, ntext, or image columns that allow
null values; zero-length strings are returned if the columns are not
nullable.
If the compatibility level is 80 or higher, SQL Server allows the update of
text, ntext, or image columns through the INSTEAD OF trigger on tables or
views.
If you use an instead of trigger your logic will have to be different as
mentioned in one of your earlier posts. If you are not going to hold more
than 8000 characters in this column change it to varchar.
John
"JIM.H." wrote:
> Apparently I could not insert a text field to another table from INSERTED in
> a trigger.
> It seems the following is working, do you see any problem joining INSERTED
> to the mySrcTable which is the table that has this trigger
> INSERT INTO myRemoteDatabase.dbo.myDestTable (myTrID,myFirstName,myBigText)
> SELECT i.myTrID, i.myFirstName, p.myBigText
> FROM INSERTED i INNER JOIN mySrcTable p ON i.myTrID = p.myTrID
> WHERE (i.myTrType = 'In')
> Thanks,
>|||Thanks John.
"John Bell" wrote:
> Hi Jim
> From Books Online "Create Trigger" topic
> In a DELETE, INSERT, or UPDATE trigger, SQL Server does not allow text,
> ntext, or image column references in the inserted and deleted tables if the
> compatibility level is equal to 70. The text, ntext, and image values in the
> inserted and deleted tables cannot be accessed. To retrieve the new value in
> either an INSERT or UPDATE trigger, join the inserted table with the original
> update table. When the compatibility level is 65 or lower, null values are
> returned for inserted or deleted text, ntext, or image columns that allow
> null values; zero-length strings are returned if the columns are not
> nullable.
> If the compatibility level is 80 or higher, SQL Server allows the update of
> text, ntext, or image columns through the INSTEAD OF trigger on tables or
> views.
> If you use an instead of trigger your logic will have to be different as
> mentioned in one of your earlier posts. If you are not going to hold more
> than 8000 characters in this column change it to varchar.
> John
> "JIM.H." wrote:
> > Apparently I could not insert a text field to another table from INSERTED in
> > a trigger.
> > It seems the following is working, do you see any problem joining INSERTED
> > to the mySrcTable which is the table that has this trigger
> >
> > INSERT INTO myRemoteDatabase.dbo.myDestTable (myTrID,myFirstName,myBigText)
> > SELECT i.myTrID, i.myFirstName, p.myBigText
> > FROM INSERTED i INNER JOIN mySrcTable p ON i.myTrID = p.myTrID
> > WHERE (i.myTrType = 'In')
> >
> > Thanks,
> >

q; please check this trigger

Apparently I could not insert a text field to another table from INSERTED in
a trigger.
It seems the following is working, do you see any problem joining INSERTED
to the mySrcTable which is the table that has this trigger
INSERT INTO myRemoteDatabase.dbo.myDestTable (myTrID,myFirstName,myBigText)
SELECT i.myTrID, i.myFirstName, p.myBigText
FROM INSERTED i INNER JOIN mySrcTable p ON i.myTrID = p.myTrID
WHERE (i.myTrType = 'In')
Thanks,Hi Jim
From Books Online "Create Trigger" topic
In a DELETE, INSERT, or UPDATE trigger, SQL Server does not allow text,
ntext, or image column references in the inserted and deleted tables if the
compatibility level is equal to 70. The text, ntext, and image values in the
inserted and deleted tables cannot be accessed. To retrieve the new value in
either an INSERT or UPDATE trigger, join the inserted table with the origina
l
update table. When the compatibility level is 65 or lower, null values are
returned for inserted or deleted text, ntext, or image columns that allow
null values; zero-length strings are returned if the columns are not
nullable.
If the compatibility level is 80 or higher, SQL Server allows the update of
text, ntext, or image columns through the INSTEAD OF trigger on tables or
views.
If you use an instead of trigger your logic will have to be different as
mentioned in one of your earlier posts. If you are not going to hold more
than 8000 characters in this column change it to varchar.
John
"JIM.H." wrote:

> Apparently I could not insert a text field to another table from INSERTED
in
> a trigger.
> It seems the following is working, do you see any problem joining INSERTED
> to the mySrcTable which is the table that has this trigger
> INSERT INTO myRemoteDatabase.dbo.myDestTable (myTrID,myFirstName,myBigT
ext)
> SELECT i.myTrID, i.myFirstName, p.myBigText
> FROM INSERTED i INNER JOIN mySrcTable p ON i.myTrID = p.myTrID
> WHERE (i.myTrType = 'In')
> Thanks,
>|||Thanks John.
"John Bell" wrote:
[vbcol=seagreen]
> Hi Jim
> From Books Online "Create Trigger" topic
> In a DELETE, INSERT, or UPDATE trigger, SQL Server does not allow text,
> ntext, or image column references in the inserted and deleted tables if th
e
> compatibility level is equal to 70. The text, ntext, and image values in t
he
> inserted and deleted tables cannot be accessed. To retrieve the new value
in
> either an INSERT or UPDATE trigger, join the inserted table with the origi
nal
> update table. When the compatibility level is 65 or lower, null values are
> returned for inserted or deleted text, ntext, or image columns that allow
> null values; zero-length strings are returned if the columns are not
> nullable.
> If the compatibility level is 80 or higher, SQL Server allows the update o
f
> text, ntext, or image columns through the INSTEAD OF trigger on tables or
> views.
> If you use an instead of trigger your logic will have to be different as
> mentioned in one of your earlier posts. If you are not going to hold more
> than 8000 characters in this column change it to varchar.
> John
> "JIM.H." wrote:
>

q; output to a text file

Is it possible to send the output of a query to a text file in a stored
procedure? When I run stored procedure in Query Analyzer I am able to do that
and I am wondering if this is possible in a automated way?Not directly. But indirectly, you can use xp_cmdshell and BCP or OSQL. Note that the file is created
by the database server. If you are on 2005, you can also call an Assembly, if that suits you better.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"JIM.H." <JIMH@.discussions.microsoft.com> wrote in message
news:33A04A73-5811-4479-A181-67A3F999C770@.microsoft.com...
> Is it possible to send the output of a query to a text file in a stored
> procedure? When I run stored procedure in Query Analyzer I am able to do that
> and I am wondering if this is possible in a automated way?|||In order to output to a file, you would have to use ( xp_cmdshell and OSQL )
OR bcp.
Check [ BCP Utility ] or [OSQL ] in Book Online
--
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
"JIM.H." <JIMH@.discussions.microsoft.com> wrote in message
news:33A04A73-5811-4479-A181-67A3F999C770@.microsoft.com...
> Is it possible to send the output of a query to a text file in a stored
> procedure? When I run stored procedure in Query Analyzer I am able to do
> that
> and I am wondering if this is possible in a automated way?

q; output to a text file

Is it possible to send the output of a query to a text file in a stored
procedure? When I run stored procedure in Query Analyzer I am able to do tha
t
and I am wondering if this is possible in a automated way?Not directly. But indirectly, you can use xp_cmdshell and BCP or OSQL. Note
that the file is created
by the database server. If you are on 2005, you can also call an Assembly, i
f that suits you better.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"JIM.H." <JIMH@.discussions.microsoft.com> wrote in message
news:33A04A73-5811-4479-A181-67A3F999C770@.microsoft.com...
> Is it possible to send the output of a query to a text file in a stored
> procedure? When I run stored procedure in Query Analyzer I am able to do t
hat
> and I am wondering if this is possible in a automated way?|||In order to output to a file, you would have to use ( xp_cmdshell and OSQL )
OR bcp.
Check [ BCP Utility ] or [OSQL ] in Book Online
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
"JIM.H." <JIMH@.discussions.microsoft.com> wrote in message
news:33A04A73-5811-4479-A181-67A3F999C770@.microsoft.com...
> Is it possible to send the output of a query to a text file in a stored
> procedure? When I run stored procedure in Query Analyzer I am able to do
> that
> and I am wondering if this is possible in a automated way?