Showing posts with label run. Show all posts
Showing posts with label run. Show all posts

Wednesday, March 28, 2012

Newbie question about sprocs

When I run my stored proceedure in query analyzer and copy the text to the pane in the report designer, all is well, but if I run the same stored proceedure as a stored procedure in the report designer it doesn't return all the fields that it does as text. What's the difference? What do I do to fix this?Two things come to mind. Ownership and location of the stored procedure.
OWNERSHIP:
Objects like tables, views, and stored procedures can be owned by different
logins.
Lets say you have two users in your database
user1
user2
They can both create a table called FOO
Each table can have different columns.
Each user can also create a stored procedure named procFOO
These stored procedures can return different columns.
LOCATION OF THE STORED PROCEDURE:
It is possible to create stored procedures in multiple databases. For
example, procFOO within northwind could select from the Products table and
procFOO within pubs could select from the authors table. Are you calling
the stored procedure from the database that you created it in (and are
running it from Query Analyzer)?
--
Keith
"Arly" <Arly@.discussions.microsoft.com> wrote in message
news:8F8426EB-7C6C-49C5-9C8F-825EB089A880@.microsoft.com...
> When I run my stored proceedure in query analyzer and copy the text to the
pane in the report designer, all is well, but if I run the same stored
proceedure as a stored procedure in the report designer it doesn't return
all the fields that it does as text. What's the difference? What do I do to
fix this?|||So I hit the nail on the head; was it an ownership or a location issue?
--
Keith
"Arly" <Arly@.discussions.microsoft.com> wrote in message
news:8EC3378E-037A-4C6A-93BE-7367603FDBE3@.microsoft.com...
> Thanks you were a great help. All is well!
> "Keith Kratochvil" wrote:
> > Two things come to mind. Ownership and location of the stored
procedure.
> >
> > OWNERSHIP:
> > Objects like tables, views, and stored procedures can be owned by
different
> > logins.
> > Lets say you have two users in your database
> > user1
> > user2
> > They can both create a table called FOO
> > Each table can have different columns.
> > Each user can also create a stored procedure named procFOO
> > These stored procedures can return different columns.
> >
> > LOCATION OF THE STORED PROCEDURE:
> > It is possible to create stored procedures in multiple databases. For
> > example, procFOO within northwind could select from the Products table
and
> > procFOO within pubs could select from the authors table. Are you
calling
> > the stored procedure from the database that you created it in (and are
> > running it from Query Analyzer)?
> >
> > --
> > Keith
> >
> >
> > "Arly" <Arly@.discussions.microsoft.com> wrote in message
> > news:8F8426EB-7C6C-49C5-9C8F-825EB089A880@.microsoft.com...
> > > When I run my stored proceedure in query analyzer and copy the text to
the
> > pane in the report designer, all is well, but if I run the same stored
> > proceedure as a stored procedure in the report designer it doesn't
return
> > all the fields that it does as text. What's the difference? What do I do
to
> > fix this?
> >
> >

Newbie question about installation

Hi,

I have just downloaded SQL Server 2005 Express Edition and am trying to run the setup. I have Windows XP Home Edition SP2 and I have received an error message saying that my operating system does not meet Service Pack level requirements. The documentation on the website shows that my service pack level is correct. Additionally the message suggests that I install the service pack from http://go.microsoft.com/fwlink/?LinkId=50380 but when I select that I get transferred to another web page which is unrelated.

Any ideas?

Did you install the .NET Framework on the machine (.NET 2.0 with additional fixes) ?

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de|||

I have seen a couple of people asking this question about the service pack, and it was already loaded on... One of the solutions that has been found is to re run the service pack install on the machine, I would try that.

|||Thanks for the suggestion. I have rerun the download and this time I have had no problem.sql

Newbie Question - Please be gentle!

Can I run a script as an automated process?
i.e. I have a simple script that deletes the content of a table so I can
import fresh data, I know how to set up the DTS to import the data
automatically, but I have to run the script every day manually before the DTS
runs & I want the delete script to run at a predefined time rather than
having to remember to do it. Does that make sense?
Tia
Jonathan
Sure. It's hard to give precise directions without know what you're scripts
look like, but... if you already have a DTS job you can easily create a
step in that package (that's what the DTS container is called) that will cun
a TSQL script. Then you can easily schedule that from SQLAgent. You can
right click on the job name from DTS and select 'schedule job' which will
walk you throught the process of setting up the DTS package to run from SQL
agent.
Hope that helps,
Brian Moran
Principal Mentor
Solid Quality Learning
SQL Server MVP
http://www.solidqualitylearning.com
"Jonathan" <Jonathan@.discussions.microsoft.com> wrote in message
news:F7E842B8-BFD6-4922-8ED2-4AD0BCE55CA6@.microsoft.com...
> Can I run a script as an automated process?
> i.e. I have a simple script that deletes the content of a table so I can
> import fresh data, I know how to set up the DTS to import the data
> automatically, but I have to run the script every day manually before the
DTS
> runs & I want the delete script to run at a predefined time rather than
> having to remember to do it. Does that make sense?
> Tia
> Jonathan

Newbie Question - Please be gentle!

Can I run a script as an automated process?
i.e. I have a simple script that deletes the content of a table so I can
import fresh data, I know how to set up the DTS to import the data
automatically, but I have to run the script every day manually before the DT
S
runs & I want the delete script to run at a predefined time rather than
having to remember to do it. Does that make sense?
Tia
JonathanSure. It's hard to give precise directions without know what you're scripts
look like, but... if you already have a DTS job you can easily create a
step in that package (that's what the DTS container is called) that will cun
a TSQL script. Then you can easily schedule that from SQLAgent. You can
right click on the job name from DTS and select 'schedule job' which will
walk you throught the process of setting up the DTS package to run from SQL
agent.
Hope that helps,
Brian Moran
Principal Mentor
Solid Quality Learning
SQL Server MVP
http://www.solidqualitylearning.com
"Jonathan" <Jonathan@.discussions.microsoft.com> wrote in message
news:F7E842B8-BFD6-4922-8ED2-4AD0BCE55CA6@.microsoft.com...
> Can I run a script as an automated process?
> i.e. I have a simple script that deletes the content of a table so I can
> import fresh data, I know how to set up the DTS to import the data
> automatically, but I have to run the script every day manually before the
DTS
> runs & I want the delete script to run at a predefined time rather than
> having to remember to do it. Does that make sense?
> Tia
> Jonathan

Newbie Question - Please be gentle!

Can I run a script as an automated process?
i.e. I have a simple script that deletes the content of a table so I can
import fresh data, I know how to set up the DTS to import the data
automatically, but I have to run the script every day manually before the DTS
runs & I want the delete script to run at a predefined time rather than
having to remember to do it. Does that make sense?
Tia
JonathanSure. It's hard to give precise directions without know what you're scripts
look like, but... if you already have a DTS job you can easily create a
step in that package (that's what the DTS container is called) that will cun
a TSQL script. Then you can easily schedule that from SQLAgent. You can
right click on the job name from DTS and select 'schedule job' which will
walk you throught the process of setting up the DTS package to run from SQL
agent.
Hope that helps,
--
Brian Moran
Principal Mentor
Solid Quality Learning
SQL Server MVP
http://www.solidqualitylearning.com
"Jonathan" <Jonathan@.discussions.microsoft.com> wrote in message
news:F7E842B8-BFD6-4922-8ED2-4AD0BCE55CA6@.microsoft.com...
> Can I run a script as an automated process?
> i.e. I have a simple script that deletes the content of a table so I can
> import fresh data, I know how to set up the DTS to import the data
> automatically, but I have to run the script every day manually before the
DTS
> runs & I want the delete script to run at a predefined time rather than
> having to remember to do it. Does that make sense?
> Tia
> Jonathan

newbie question - multiple databases

Can a single SQL 2000 server run multiple databses
concurrently? Or is it just a one to one ratio? Thanks
Yes a single server can run multiple user database and system databases on a
single sql server
----
Need SQL Server Examples check out my website at
http://www.geocities.com/sqlserverexamples
"Andy" <andrew@.eclise-micro.com> wrote in message
news:865801c43222$7ca65950$a301280a@.phx.gbl...
> Can a single SQL 2000 server run multiple databses
> concurrently? Or is it just a one to one ratio? Thanks
|||Thank you Greg
>--Original Message--
>Yes a single server can run multiple user database and
system databases on a
>single sql server
>--
>----
--
>----
--
>--
>Need SQL Server Examples check out my website at
>http://www.geocities.com/sqlserverexamples
>"Andy" <andrew@.eclise-micro.com> wrote in message
>news:865801c43222$7ca65950$a301280a@.phx.gbl...
>
>.
>

newbie question - multiple databases

Can a single SQL 2000 server run multiple databses
concurrently? Or is it just a one to one ratio? ThanksYes a single server can run multiple user database and system databases on a
single sql server
--
----
----
--
Need SQL Server Examples check out my website at
http://www.geocities.com/sqlserverexamples
"Andy" <andrew@.eclise-micro.com> wrote in message
news:865801c43222$7ca65950$a301280a@.phx.gbl...
> Can a single SQL 2000 server run multiple databses
> concurrently? Or is it just a one to one ratio? Thanks|||Thank you Greg
>--Original Message--
>Yes a single server can run multiple user database and
system databases on a
>single sql server
>--
>----
--
>----
--
>--
>Need SQL Server Examples check out my website at
>http://www.geocities.com/sqlserverexamples
>"Andy" <andrew@.eclise-micro.com> wrote in message
>news:865801c43222$7ca65950$a301280a@.phx.gbl...
>> Can a single SQL 2000 server run multiple databses
>> concurrently? Or is it just a one to one ratio? Thanks
>
>.
>

newbie question - multiple databases

Can a single SQL 2000 server run multiple databses
concurrently? Or is it just a one to one ratio? ThanksYes a single server can run multiple user database and system databases on a
single sql server
----
----
--
Need SQL Server Examples check out my website at
http://www.geocities.com/sqlserverexamples
"Andy" <andrew@.eclise-micro.com> wrote in message
news:865801c43222$7ca65950$a301280a@.phx.gbl...
> Can a single SQL 2000 server run multiple databses
> concurrently? Or is it just a one to one ratio? Thanks|||Thank you Greg
>--Original Message--
>Yes a single server can run multiple user database and
system databases on a
>single sql server
>--
>----
--
>----
--
>--
>Need SQL Server Examples check out my website at
>http://www.geocities.com/sqlserverexamples
>"Andy" <andrew@.eclise-micro.com> wrote in message
>news:865801c43222$7ca65950$a301280a@.phx.gbl...
>
>.
>

Monday, March 26, 2012

Newbie Question

Hi,
I have a procedure that returns 5 different values. I want to run the procedure in another procedure and use those values in that procdure.

How? How? How?

CREATE Procedure get_Averages_EY @.Quality dec OUTPUT, @.Commitment dec OUTPUT,@.Change dec OUTPUT, @.Strategy dec OUTPUT, @.Leadership dec OUTPUT, @.Environment dec OUTPUT, @.id int

I want to use all of the output values in another procedure.

Thanks!!!Try this one.

create procedure proc1(@.id int,@.id2 int output,@.id3 int output)
as
set @.id2=@.id*2
set @.id3=@.id*10
go
create procedure proc2
as
declare @.id2 int,@.id3 int,@.id int
set @.id=3
exec proc1 @.id,@.id2 output,@.id3 output
select @.id,@.id2,@.id3
go
exec proc2

Monday, March 19, 2012

Newbie needs a hand with SQL2005 Reports

I'm trying to run some reports on SQL 2005, but can't even pass the first step of launching the report builder. I have SQL2005 on my local machine, but the report server is installed on a remote server. I launched SQL Business Intelligence Development Studio, which brings Visual studio, but i keep getting a prompt to enter a connection string. How do i get the connection string, or how do i set up my datasource?

Help!

To answer your question, try the following, but i think you need to configure 'iis', as well as 'reporting services configuration' before hand:

open sql server business intelligence studio
file
new
project
report server project
ok
view
solution explorer
right click reports
add
new item
data source
add
edit
<enter your database details here>

...and so on

look up the microsoft tutorial for creating a basic report in 'sql server business intelligence studio' help

Newbie needing help ASAP with width issue in sql report.

I am building a Sql Report in VS.net 2006 I have run into an issue I have 258 colums it am using the wizard table generator in design mode. the problem is the screen will on allow 160 inches wide I need to mak this larger to 300 inches the purpose of the report is to sort data and them save to csv format is there a better way or can some on tell me how to increase the size of the width the properties tab will not allow me to explain pass 160 inches. Some one please help me thanksWhy not tackle the job another way ? Have a look at http://www.codeproject.com/useritems/filehelpers.asp "An easy to use .NET library to read/write strong typed data from fileswith fixed length or delimited records (CSV). Also has support toimport/export data from different data storages (Excel, Acces,SqlServer, MySql)"|||The issue I am having is a task was given to me to pull data from an invoice module out of SQL and creat a 288 field output of data in a csv format. The problem is we on have about 100 fields data the rest have to be blank and all this has to be in an order so . I was going to build a report in th sql reports in my business intell create the headers for all 288 files and create the expression in the correct placement create several sort paramerters then I was going to just save as csv format this would create the csv file with the correct order and blank fields separated by the commas. the problem is I dont know how to creat empty fields on an output to csv.|||

Suppose your table FRED has three fields A, C and D and you want to output 5, use:

SELECT A, ' ' AS B, C, ' ' AS D, E FROM FRED

That will create 2 empty fields - you can readily extend the technique to create 188 blank fields.

|||

Thank youy this makes sense. The only question is I may need it to look like this

"john", "Smith","","","","","","","404","555-5555","123 Main Street","","completed",

If I under stand the your code I can select A,B,' ' AS C,' ' AS D,' ' AS E, ' ' AS F, ' ' AS G, ' ' AS H,I,J,K,' ' AS L,M FROM TABLE

|||

>>The only question is I may need it to look like this: "john", "Smith","","","","","","","404","555-5555","123 Main Street","","completed",
The quoting takes places aroung each value, whether it is occupied or empty.

>>If I under stand the your code I can select A,B,' ' AS C,' ' AS D,' ' AS E, ' ' AS F, ' ' AS G, ' ' AS H,I,J,K,' ' AS L,M FROM TABLE

Yes! I put a space between the quote marks for clarity; you will not need to do this.

Monday, March 12, 2012

newbie lookup table

How would I run a query, on the server side, on a table that would pull from
a second table (like a lookup table) and write the result to each row in a
record set of the first table?
ThanksHi,
UPDATE TableOne T1
SET T1.ColumnToUpdate = T2.ColumnToRetrieveValueFrom
FROM Table1 as T1
INNER JOIN Table2 as T2
ON (T1.RelatedKey = T2.RelatedKey)
Allright ?
HTH, Jens Smeyer.
http://www.sqlserver2005.de
--
"HollyylloH" <HollyylloH@.discussions.microsoft.com> schrieb im Newsbeitrag
news:64F2B05C-A982-4709-9DB2-2F5B9431EF88@.microsoft.com...
> How would I run a query, on the server side, on a table that would pull
> from
> a second table (like a lookup table) and write the result to each row in a
> record set of the first table?
> Thanks|||UPDATE TableOne
SET T1.ColumnToUpdate
= (SELECT T2.ColumnToRetrieveValueFrom
FROM Table2 AS T2
WHERE TableOne.RelatedKey = T2.RelatedKey) ;

Newbie like question

Hi

How do I run Multiple Likes in one query? Do I need to run each Like
seperately?

Thanks for any help.Sorry. I don't think that was clear. What I meant was I need something that
is similar to:

Select * from Security..SecUser
where UserId in (123, 456, 789)

The following query does not work:

Select * from Security..SecUser
where UserId like ('%123%', '%456%', '%789%')

Is there a query that can do this?

Thanks again|||You can use logical operators to join two tables; put the patterns you
want to match in one table, and join it to the source table. Here's an
example:

--Table with data that I want to look for a pattern in
DECLARE @.Root TABLE (KeyVal int,
Root varchar(10))

INSERT INTO @.Root
SELECT 1, 'ABCDEF'
UNION ALL
SELECT 2, 'DEFGHI'
UNION ALL
SELECT 3, '123ABC'
UNION ALL
SELECT 4, '123DEF'

--Table of patterns
DECLARE @.LikeTest TABLE (LikeTest varchar(10))
INSERT INTO @.LikeTest
SELECT 'ABC'
UNION ALL
SELECT 'DEF'
UNION ALL
SELECT 'XYZ'

--Results; note that I used DISTINCT to return a single value for each
match.
SELECT DISTINCT r.KeyVal, r.Root
FROM @.Root r JOIN @.LikeTest l ON r.Root LIKE '%' + l.LikeTest + '%'

HTH,
Stu|||Alternatively:

Select * from Security..SecUser
where
UserId like '%123%'
or UserId like '%456%'
or UserId like '%789%'

Obviously, if you have a ton of them, it'll be a pain to type them all
out.|||Thanks for the help, guys. That was much appreciated!!

--
Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forum...eneral/200507/1

Saturday, February 25, 2012

Newbie - Is this a job for a sproc?

I'm optimizing an Access mdb to run in front of a SS 2005 database. My approach is to move as much of the processing as possible out of Access and in to SQL Server.

I have a report uses an Access query as it's source. One field in that report is generated via a series of 4 or 5 sub-queries that are finally joined in to the report's source query.

I have enough knowhow to turn each individual Access query into a veiw inside SQL server, but I'm wondering if this wouldn't be better accomplished using a stored procedure?

Essentially, I'd need the sproc to open up a set of 50-60 records, loop through them until it finds the first record with certain criteria, then return a certain value as it's result. Finally, I need that vallue to be joined to a view that I will point to as the source for my report in Access.

Is it possible to do this with a sproc? Is this the right way to use a sproc?Essentially, I'd need the sproc to open up a set of 50-60 records, loop through them until it finds the first record with certain criteria,

Where is your data?|||Where is your data?
Thanks for the quick response..

Not sure what you're asking.. The set of data to be looped through is in a view. The set of data for the results to be attached to will also be a view.

Both views are based on tables residing in my database.

Do you need me to post a sample of my data?|||here's more detail on my data

The data to loop through is in a view called ActionItems.

Relevant fields are:
project_id, actionitem_id, actionitem_order, status_id, milestone_id

Projects have about 50-60 action items, each with their unique id. They're in order by actionitem_order. Action items are grouped into milestones - figure 6 items per milestone.

To get the return value, I want to loop through each action item until the first one with a status_id of 3 is reached. When that one is reached, the loop can be stopped and the prior milestone_id is passed on as the result of the function.

I want to attach the result of that function to another view joined on Project_id.|||Create this as a stored procedure that not only encorporates your views as nested subqueries, but which also find the first one with a value of 3 and returns it as a resultset.
Basically, if you are looping through records, you are doing something wrong. Its time to join the big boys and learn set-based processing.|||Create this as a stored procedure that not only encorporates your views as nested subqueries, but which also find the first one with a value of 3 and returns it as a resultset.
Basically, if you are looping through records, you are doing something wrong. Its time to join the big boys and learn set-based processing.
Ok, cool. I'll dump the "loop-through" concept.. I have it as a series of SELECT queries in Access anyway, so moving that into a sproc is more of a direct migration anyway..

Ok - you mention nested subqueries.. Do you have an example of a sproc that does this? One approach I've found in trying to figure this out myself is that of using temporary tables after each SELECT statement.. For some reason, this sounds like it would require more overhead than just chaining the SELECT statements together. Problem is, I don't know how to nest the statements together.. I'll do more research, but if you've got an example, I'd appreciate it..

Thanks!|||select * from (select * from (select * from SomeTable) Nest2) Nest1|||select * from (select * from (select * from SomeTable) Nest2) Nest1
That's what I was thinking, but I couldn't find any examples to confirm..

I'll work with it and post the followup questions that are sure to come..

Thanks!|||Ok, really quick on the followup, eh?

This is probably more of a SQL question, and maybe it should probably be obvious to me, but anyway..

In Access, my top-level query would look something like...

SELECT field1, field2, field3 FROM table INNER JOIN table ON query1.field1 = table.field1 GROUP BY query1.field2

So in the sproc I go:

SELECT field1, field2, field3 FROM table INNER JOIN table ON (Long SELECT Statement that makes up query1).field1 = table.field1 GROUP BY (Long SELECT Statement that makes up query1).field2

Obviously the issue is the fact that I have two very long SELECT statements to deal with (on after the JOIN, one after the GROUP BY). Not a big deal with a simple 2 level combination of queries, but my actual progression is 5 levels progression with 7 different queries, some of which have criteria and multiple joins.

That would make this a pretty large sproc with lots of syntax to verify and (in my case) probably get wrong.

If that's what it takes, no problem.. I just want to confirm that before I go on..|||No. You are heading down the wrong path here. You join subqueries in your statement as virtual tables with their own aliases. You should not be using them as criteria.
Plus, I highly doubt that your task requires five levels of subqueries.
Read the sections on subqueries in Books Online. Then review your task again. Don't try to build the entire sql statement at once, but instead write code that performs the lowest level subqueries efficiently and then build up from there.

newbie - empty result set for all queries?

I am a newbie and have installed SQL Server myself on my home machine,
where I'm having problems. When I run the Query Analyzer, I get an
empty result set for all queries, with the message, "The command(s)
completed successfully." So, for instance, if I were to go to
Northwind and type "SELECT * from Employees", which we KNOW isn't
empty, all I see is "The command(s) completed successfully." How do I
get query results?

I thought maybe the problem was permissions. I'm logged into my local
server, which is the computer on which I'm running. The owner is just
"ZIPPY/Owner", ZIPPY being my machine name; since I'm the only one who
uses the computer, I don't even log in, I just take the default "Owner"
account. I start up the SQL analyzer with Windows credentials.

Anyone have a clue what I'm doing wrong?shelah (shelah2@.verizon.net) writes:
> I am a newbie and have installed SQL Server myself on my home machine,
> where I'm having problems. When I run the Query Analyzer, I get an
> empty result set for all queries, with the message, "The command(s)
> completed successfully." So, for instance, if I were to go to
> Northwind and type "SELECT * from Employees", which we KNOW isn't
> empty, all I see is "The command(s) completed successfully." How do I
> get query results?

You are not even getting an empty result set. Apparently you are in some
sort of noexec mode where the query is sent to SQL Server for validation
only.

There are a couple of ways to get this behaviour. First make sure that
you press the green arrow to run the query. The blue tick is for validation
only.

If the problem is not that simple, check Tools->Options->Connection
properties. If any of SET NOEXEC ON or SET PARSEONLY ON are checked,
uncheck them.

If this does not help, send these commands to SQL Server:

SET PARSEONLY OFF
SET NOEXEC OFF
SET FMTONLY OFF

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Thank you, that was an enormous help. You were right; I was clicking
the check and not the green arrow. A great relief to know that I have a
usable database and don't have to do some wierd chown gyrations.

*** Sent via Developersdex http://www.developersdex.com ***|||thanks it was a great help even to me
Erland Sommarskog wrote:
> shelah (shelah2@.verizon.net) writes:
> > I am a newbie and have installed SQL Server myself on my home machine,
> > where I'm having problems. When I run the Query Analyzer, I get an
> > empty result set for all queries, with the message, "The command(s)
> > completed successfully." So, for instance, if I were to go to
> > Northwind and type "SELECT * from Employees", which we KNOW isn't
> > empty, all I see is "The command(s) completed successfully." How do I
> > get query results?
> You are not even getting an empty result set. Apparently you are in some
> sort of noexec mode where the query is sent to SQL Server for validation
> only.
> There are a couple of ways to get this behaviour. First make sure that
> you press the green arrow to run the query. The blue tick is for validation
> only.
> If the problem is not that simple, check Tools->Options->Connection
> properties. If any of SET NOEXEC ON or SET PARSEONLY ON are checked,
> uncheck them.
> If this does not help, send these commands to SQL Server:
> SET PARSEONLY OFF
> SET NOEXEC OFF
> SET FMTONLY OFF
> --
> Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
> Books Online for SQL Server SP3 at
> http://www.microsoft.com/sql/techin.../2000/books.asp|||To avoid this in the future just hit F5

http://sqlservercode.blogspot.com/

Newbie - Can I have a Timer for a SP?

I'd like to have a stored procedure run every n seconds. Not sure how to
accomplish. Any ideas are appreciated.
Regards,
MikeYou can create a job to execute the stored procedure. To create job open
Enterprise Manager. Expand your Servername. Then click on "Management" then
click "JOB". Right click and click "New Job" and then you can set the SQL
statement to execute that stored procedure and you can set the schedule (the
minimum is every 1 minute).
"Mike Hildner" <mhildner@.afweb.com> wrote in message
news:uMJK3xalDHA.1808@.TK2MSFTNGP09.phx.gbl...
> I'd like to have a stored procedure run every n seconds. Not sure how to
> accomplish. Any ideas are appreciated.
> Regards,
> Mike
>

Monday, February 20, 2012

Newbee Question

I have a table with the following fields for example:
VerifyCode1
VerifyCode2
VerifyCode3
VerifyCode4
VerifyCode5
When I run a query which links the two tables together, and say for example
a row has entries in the VerifyCode1 and VerifyCode2 fields, this row is
dropped from the query dataset.
How can I get all the rows to show if they have one entry or all five.
Thanks for the helpPossibly you require an outer join, but that's just a guess. If you need
more help please read the following article which explains how best to
specify your problem for others to understand:
http://www.aspfaq.com/etiquette.asp?id=5006
David Portas
SQL Server MVP
--

Newbe question about replication

Hi ppl

I just started with all this 'replication' subject and run into some 'stange ?' problem. I suscesfully set-up publisher and distributor on one computer. create subscriber on another. And seems that this is working with no errors as I see in Replication monitor, details. All agent turned to verbose output and showing no errors at all. but the strange problem that the database does not (!) appear at subscriber (?) I mean - no tables, no stored procedures, no nothing - how it can be possible ? What I'm doing wrong ? Or what I should do ?

P.S. Forgot to add: Both servers running latest SQL server 2005 with latest Service Pack. Subscribtion of type 'push'

Hi Jasper

I think, you're talking about merge replication.
One question:
Have you generated a snapshot before synchronizing?

kind regards
Aline

Newb: Managing multiple queries

I am currently using enterprise manager to run multiple queries on a
single table in a DB. I refresh these queries every few minutes. Due
to the huge number of them I was looking for a better way (or should I
just say "a way") to manage/save these queries so I can recall them
easier/faster for monitoring purposes. Suggestions?

TIA.Hi,

Maybe creating a stored procedure (or more, if the queries are logically
grouped) will help you. Then you would need just to execute the stored
procedures in Query Analyzer (which is the tool intended to run queries
anyway). Alternatively you can save the queries to a script file, and then
open and run in Query Analyzer.

HTH,

Plamen Ratchev
http://www.SQLStudio.com|||On Thu, 6 Dec 2007 10:38:06 -0800 (PST), Akhenaten
<jonkokko@.gmail.comwrote:

If I understand you correctly you need an application (Access ADP, or
..NET) to call your queries based on a timer or a button click. SQL
Server tools alone are probably not going to do the trick.

-Tom.

Quote:

Originally Posted by

>I am currently using enterprise manager to run multiple queries on a
>single table in a DB. I refresh these queries every few minutes. Due
>to the huge number of them I was looking for a better way (or should I
>just say "a way") to manage/save these queries so I can recall them
>easier/faster for monitoring purposes. Suggestions?
>
>TIA.

|||On Dec 6, 10:45 pm, "Plamen Ratchev" <Pla...@.SQLStudio.comwrote:

Quote:

Originally Posted by

Hi,
>
Maybe creating a stored procedure (or more, if the queries are logically
grouped) will help you. Then you would need just to execute the stored
procedures in Query Analyzer (which is the tool intended to run queries
anyway). Alternatively you can save the queries to a script file, and then
open and run in Query Analyzer.
>
HTH,
>
Plamen Ratchevhttp://www.SQLStudio.com


Are there examples of "script files"? I have a few files that are used
for creating databases and tables, but somehow I think there is more
potential in using scripts.

Thanks|||Under "script files" I meant to save your frequently used SQL code to a
file, preferably with extension ".sql". Since you indicate you already save
your code to files, then you have your script files.

In SQL Server 2005, the SQL Server Management Studio adds a new capability
to organize scripts in projects (very similar to Visual Studio projects). It
is accessible via the File menu in SSMS (File -New - Project -SQL
Server Scripts template).

Script files are good because they can be easily added to a source control
system.

HTH,

Plamen Ratchev
http://www.SQLStudio.com