Showing posts with label execute. Show all posts
Showing posts with label execute. Show all posts

Wednesday, March 21, 2012

pausing stored procedures

Is there any way to execute a stored procedure, get it's thread id and pause it in someway...particularly in another stored procedure?

If not, I guess I could manually create a mechanism. This would most likely be used for stored procedures that run for long amounts of time in a while loop where i could just check a flag in a record representing the instance of the stored procedure at the top of the loop and do a WAITFOR DELAY within a nexted loop and have the condition set to end when the flag is marked as 'run' as opposed to 'halt.'You can look at the SP. Find a query that it hasn't executed yet and lock a table that is involved in that query.

You could also dedicate a resource table to the SP, code a select or update of that table before every statement then locking that table will pause the SP.|||Does the SQL Profiler read information from a table in the master database or something? I am wondering how it knows what stored procedures are running and if I can use that information in this experiment.

Monday, March 12, 2012

Password validation failed

Hello Group,
we got the following message when running execute sp_adduser
Server: Msg 15118, Level 16, State 1, Line 1
Password validation failed. The password does not meet Windows policy
requirements because it is not complex enough.
Server: Msg 15007, Level 16, State 1, Procedure sp_adduser, Line 15
is there a way to turn this off on sql server(2005sp2) level.
Thanks in advancedTal shalom
Firstv of all in SQL Server 2005 using CREATE USER ... is recommended way
instead of sp_adduser.
Now regarding to the error you are getting, it is because you created LOGIN
with 'weak' password.
Please run in query builder (take a look at CHECK_POLICY=OFF parameter in
the BOL)
create login tal with password ='t',
go
create user Joe for login tal
drop user joe
drop login tal
"Tal Bar-Or" <tal_baror@.hotmail.com> wrote in message
news:%23sZnW6gkHHA.3452@.TK2MSFTNGP04.phx.gbl...
> Hello Group,
> we got the following message when running execute sp_adduser
> Server: Msg 15118, Level 16, State 1, Line 1
> Password validation failed. The password does not meet Windows policy
> requirements because it is not complex enough.
> Server: Msg 15007, Level 16, State 1, Procedure sp_adduser, Line 15
> is there a way to turn this off on sql server(2005sp2) level.
> Thanks in advanced
>
>
>
>|||Shalom Uri,
Thanks for the answer. I understand that CHECK_POLICY=OFF can be done per
individual login . However can it be done on the SERVER level for ALL
logins. This would help us not nodify the
code when migrationg from SQL 2000 to SQL 2005
Thanks in advanced
Tal,
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:eApc3BhkHHA.2272@.TK2MSFTNGP02.phx.gbl...
> Tal shalom
> Firstv of all in SQL Server 2005 using CREATE USER ... is recommended
> way instead of sp_adduser.
> Now regarding to the error you are getting, it is because you created
> LOGIN with 'weak' password.
> Please run in query builder (take a look at CHECK_POLICY=OFF parameter in
> the BOL)
> create login tal with password ='t',
> go
> create user Joe for login tal
> drop user joe
> drop login tal
>
>
> "Tal Bar-Or" <tal_baror@.hotmail.com> wrote in message
> news:%23sZnW6gkHHA.3452@.TK2MSFTNGP04.phx.gbl...
>|||Hi Tal
By default CHECK_POLICY=ON.CHECK_POLICY are only enforced on Windows Server
2003 so I have no idea how to change it .
"Tal Bar-Or" <tal_baror@.hotmail.com> wrote in message
news:%23n$ddThkHHA.4904@.TK2MSFTNGP05.phx.gbl...
> Shalom Uri,
> Thanks for the answer. I understand that CHECK_POLICY=OFF can be done per
> individual login . However can it be done on the SERVER level for ALL
> logins. This would help us not nodify the
> code when migrationg from SQL 2000 to SQL 2005
> Thanks in advanced
> Tal,
> "Uri Dimant" <urid@.iscar.co.il> wrote in message
> news:eApc3BhkHHA.2272@.TK2MSFTNGP02.phx.gbl...
>

Monday, February 20, 2012

Passing SQL Parameter

I set up successfully the ability to execute a stored procedure on a second SQL Server from a first SQL Server. I understand that I can pass parameters from procedure to procedure... however, I do not know how to pass a sql statement result set as a parameter to another procedure for that second procedure to use. Can anyone give me an example of doing this?

So maybe an example to show proc1 performing the query 'select name, city from tblcustomer', storing the results of that procedure in a parameter say @.resultset and proc2 creating a table of the results stored in @.resultset.

Thats a pretty basic example and will help me get started on this massive parameter passing that I have to do.Originally posted by justastef
I set up successfully the ability to execute a stored procedure on a second SQL Server from a first SQL Server. I understand that I can pass parameters from procedure to procedure... however, I do not know how to pass a sql statement result set as a parameter to another procedure for that second procedure to use. Can anyone give me an example of doing this?

So maybe an example to show proc1 performing the query 'select name, city from tblcustomer', storing the results of that procedure in a parameter say @.resultset and proc2 creating a table of the results stored in @.resultset.

Thats a pretty basic example and will help me get started on this massive parameter passing that I have to do.

One way could be using system stored procedure Sp_Executesql and executing your query and have a resultset returned to you in a Table data type and then you can use that to pass it as a parameter to the second stored procedure.

HTH,