Showing posts with label cant. Show all posts
Showing posts with label cant. Show all posts

Thursday, February 16, 2012

Bringing a DB online

Hi all,
I have tried to search for answers to this, but couldn't find anything specific. I have taken a database Offline, I can't get it to come back online. I tried the ALTER DATABASE dbname SET ONLINE, but get the error message. User must be in the Master da
tabase. I am using osql with the -E command. Do I need to use something else?
Justin,
try using
osql -E -d master
ALTER DATABASE dbname SET ONLINE
go
Alternatively you can reset the default database for your windows login, and
then miss out the -d master argument.
HTH,
Paul Ibison
|||Hi;
Execute the below command from command prompt
OSQL -E -S server (enter)
1>use master
2>go
1>Alter database dbname set online
2>go
Thanks
Hari
MCDBA
"Justin Cook" <anonymous@.discussions.microsoft.com> wrote in message
news:6BEB437E-CDB1-4F8D-927A-EB1E2D140AC6@.microsoft.com...
> Hi all,
> I have tried to search for answers to this, but couldn't find anything
specific. I have taken a database Offline, I can't get it to come back
online. I tried the ALTER DATABASE dbname SET ONLINE, but get the error
message. User must be in the Master database. I am using osql with the -E
command. Do I need to use something else?
>
|||THANK YOU THANK YOU

Bring Online (Missing Transaction Log)

I cant bring my database online since the LDF is missing. However, the MDF
is fine. If I try to bring it online I get an error 5181 due to the missing
file.
Is there anyway to get the database going again without the transaction log?
Cheers,
elzikoHi,
Start the database in Emergency mode. So that Database will be started with
out transaction log. After that you can use DTS to transfer the data
and objects to a new database.
How to start the database in Emergency Mode:
Sp_configure "allow updates", 1
go
Reconfigure with override
GO
Update sysdatabases set status = 32768
where name = "BadDbName"
go
Sp_configure "allow updates", 0
go
Reconfigure with override
GO
Note:
Setting the database status to emergency mode tells SQL Server to skip
automatic recovery and
lets you access the data.
Thanks
Hari
MCDBA
"elziko" <elziko@.NOTSPAMMINGyahoo.co.uk> wrote in message
news:u6nrn1kEEHA.1368@.TK2MSFTNGP11.phx.gbl...
> I cant bring my database online since the LDF is missing. However, the MDF
> is fine. If I try to bring it online I get an error 5181 due to the
missing
> file.
> Is there anyway to get the database going again without the transaction
log?
> --
> Cheers,
> elziko
>

Bring a data that not already selected...

Hi I have a problem that seems to be stupid… but still I cant solve it so please if you can help ASAP I'll appreciated.

Its 2 tables "Courses" and "Facilitators"

The Course table contain: Course_Id and Course_Name

The Facilitators table contain: Facili_Id and Facili_Name

The two tables have (many to many) relation between them.

So I split them into a 3rd table called "Trans" which contain the PK from each Table

That will be : "Trans_Course_Id" and "Trans_Facili_Id"

I put some data on each table… at least 3 records and related some of them in the "Trans" table

Now im looking for an SQL command that brings me All the "Facili_ID" and "Facili_Name" for a specific course. And only those who is not already selected by the same course?

Like if I have the data in the "Courses" table
id: 1 and Name: VB

Id:2 and Name: C#

And in "Facilitators" table:

Id:1 and Name: Adam

Id:2 And Name: George

Id:3 and Name: Sam

Now in the relation table "Trans"

Course_Id:1 and Facili_Id:1

Course_Id:2 and Facili_Id:1

Course_Id:2 and Facili_Id:3

Now I want the SQL Commands that brings me the he "Facili_ID" and "Facili_Name"

For Course_id "For example" and should not be selected by the same course…

That would be:

Id:2 And Name: George

Id:3 and Name: Sam

And the same for eash time I pass the course_id for the command

Thank you.

I'm lost. I see your example data, but I don't see how you get George and Sam using any thing that remotely resembles what you've explained. Explain again, and I'm sure I can get you the T-SQL.

|||

Ok… its just only wanted to get all the data that not already selected by a cretin course.

lets say that the course id 1 has select a facilitator id 1 now I want the sql command that brings me all the facilitator id's except the facilitator id 1 for the course id 1 .

ill explain to you what I do exactly

I have a form that brings all a certain course information and a data grid that show the facilitator id's and names for that course.

Now when the admin want to add another facilitator for this course he press a button that will create a child window contain a LOV "list of value" as a data grid contain all the facilitator id's and names that not already selected by that certain course in the parent window "data grid"….

??

|||

I think I see...

So if the statement:

SELECT facil_id from trans WHEREcourse_id=@.course_id

returns to you the facilitators, then

SELECT *

FROM Facilitators

WHERE facil_id NOT IN (SELECT facil_id FROM trans WHEREcourse_id=@.course_id)

will return you all the facilitators that aren't part of the course id you passed in... Does that answer your question?

|||

Will. You know I have to do it in one select statement

So what I did is :

SELECT facilitators.facilitator_id, facilitators.facilitator_name

FROM facilitators INNER JOIN

[transaction_ facilitators] ON facilitators.facilitator_id = [transaction_ facilitators].trans_Facilitator_id

WHERE (facilitators.facilitator_id NOT IN

(SELECT [transaction_ facilitators].trans_Facilitator_id

FROM transaction_ facilitators

WHERE [transaction_ facilitators].trans_Course_id = @.p1))

ORDER BY facilitators.facilitator_id

But that didn't work :( …

I know the answer is some where here but I can't catch it.

|||

OK this one work great:

SELECT facilitators.facilitator_id, facilitators.facilitator_name

FROM facilitators INNER JOIN

[transaction_ facilitators] ON facilitators.facilitator_id <> [transaction_ facilitators].trans_Facilitator_id

WHERE (NOT (facilitators.facilitator_id IN

(SELECT [transaction_ facilitators].trans_Facilitator_id

FROM [transaction_ facilitators]

WHERE [transaction_ facilitators].trans_Course_id = 2)))

GROUP BY facilitators.facilitator_id, facilitators.facilitator_name

ORDER BY facilitators.facilitator_id

But when I want to pass a parameters to "[transaction_ facilitators].trans_Course_id = @.p1"

This gives me an error:

Incorrect syntax near the keyword "From"

Any suggestion ??

|||

Maybe you misunderstood. The statement:

SELECT *

FROM Facilitators

WHERE facil_id NOT IN (SELECT facil_id FROM trans WHEREcourse_id=@.course_id)

should be all you need.

|||

SELECT facilitators.facilitator_id, facilitators.facilitator_name

FROM facilitators INNER JOIN

[transaction_ facilitators] ON facilitators.facilitator_id <> [transaction_ facilitators].trans_Facilitator_id

WHERE (NOT (facilitators.facilitator_id IN

(SELECT [transaction_ facilitators].trans_Facilitator_id

FROM [transaction_ facilitators]

WHERE [transaction_ facilitators].trans_Course_id = 2)))

GROUP BY facilitators.facilitator_id, facilitators.facilitator_name

ORDER BY facilitators.facilitator_id

Every thing goes right until I change this:

WHERE [transaction_ facilitators].trans_Course_id = 2

To

WHERE [transaction_ facilitators].trans_Course_id = @.course_id

It gives me this error:

Incorrect syntax near the keyword "From"

still gives me the same error

|||

Unbalanced parenthesis.

You are also using group by with no aggregates -- Which does the same thing as distinct.

SELECT DISTINCTfacilitators.facilitator_id, facilitators.facilitator_name

FROM facilitators INNER JOIN

[transaction_ facilitators] ON facilitators.facilitator_id <> [transaction_ facilitators].trans_Facilitator_id

WHERE (NOT (facilitators.facilitator_id IN

(SELECT [transaction_ facilitators].trans_Facilitator_id

FROM [transaction_ facilitators]

WHERE [transaction_ facilitators].trans_Course_id = @.course_id))

ORDER BY facilitators.facilitator_id

|||

:( That's unbelievable… its not working what is this… look I try this:

SELECT DISTINCT facilitators.facilitator_id, facilitators.facilitator_name

FROM facilitators INNER JOIN

[transaction_ facilitators] ON facilitators.facilitator_id <> [transaction_ facilitators].trans_Facilitator_id

WHERE (NOT (facilitators.facilitator_id IN

(SELECT [transaction_ facilitators].trans_Facilitator_id

FROM [transaction_ facilitators]

WHERE [transaction_ facilitators].trans_Course_id = @.course_id)))

ORDER BY facilitators.facilitator_id

Not Working the same error: "Incorrect syntax near the keyword "From"

"

And I try this:

SELECT DISTINCT facilitators.facilitator_id, facilitators.facilitator_name

FROM facilitators INNER JOIN

[transaction_ facilitators] ON facilitators.facilitator_id <> [transaction_ facilitators].trans_Facilitator_id

WHERE (NOT (facilitators.facilitator_id IN

(SELECT [transaction_ facilitators].trans_Facilitator_id

FROM [transaction_ facilitators]

WHERE [transaction_ facilitators].trans_Course_id = @.course_id)))

GROUP BY facilitators.facilitator_id, facilitators.facilitator_name

ORDER BY facilitators.facilitator_id

Not Working the same error: "Incorrect syntax near the keyword "From"

"

And I try this:

SELECT facilitators.facilitator_id, facilitators.facilitator_name

FROM facilitators INNER JOIN

[transaction_ facilitators] ON facilitators.facilitator_id <> [transaction_ facilitators].trans_Facilitator_id

WHERE (NOT (facilitators.facilitator_id IN

(SELECT [transaction_ facilitators].trans_Facilitator_id

FROM [transaction_ facilitators]

WHERE [transaction_ facilitators].trans_Course_id = ?)))

GROUP BY facilitators.facilitator_id, facilitators.facilitator_name

ORDER BY facilitators.facilitator_id

Not Working the same error: "Incorrect syntax near the keyword "From"

"

And I try this:

SELECT facilitators.facilitator_id, facilitators.facilitator_name

FROM facilitators INNER JOIN

[transaction_ facilitators] ON facilitators.facilitator_id <> [transaction_ facilitators].trans_Facilitator_id

WHERE (NOT (facilitators.facilitator_id IN

(SELECT [transaction_ facilitators].trans_Facilitator_id

FROM [transaction_ facilitators]

WHERE [transaction_ facilitators].trans_Course_id = ?)))

ORDER BY facilitators.facilitator_id

Not Working the same error: "Incorrect syntax near the keyword "From"

"

Nothing work what is this… is it a curse ?

I don't have more time :'(… HELP

|||Good, now that you've tried all those, and they didn't work, try what I posted two messages up. Each of your "tries" has unbalanced parenthesis, which is what is causing your error message.

Sunday, February 12, 2012

bottom to top formating

hi
i had luck formatering a text box top to botto in formatting:
t
e
s
t
i
n
g
but i would like bottom to top and i cant seem to find it
g
n
i
t
s
e
t
any ideas ?On Oct 5, 5:05 pm, "michael vardinghus" <xx> wrote:
> hi
> i had luck formatering a text box top to botto in formatting:
> t
> e
> s
> t
> i
> n
> g
> but i would like bottom to top and i cant seem to find it
> g
> n
> i
> t
> s
> e
> t
> any ideas ?
You might be able to use the StrReplace function (i.e., an expression
like):
=StrReplace(Fields!SomeField.Value)
If this doesn't work, you may need to create a single-column table
control and populate it from a dataset that is custom sorted before
getting to the report (in the stored procedure/query that sources the
report).
Hope this helps.
Regards,
Enrique Martinez
Sr. Software Consultant|||On Oct 7, 1:32 pm, EMartinez <emartinez...@.gmail.com> wrote:
> On Oct 5, 5:05 pm, "michael vardinghus" <xx> wrote:
>
> > hi
> > i had luck formatering a text box top to botto in formatting:
> > t
> > e
> > s
> > t
> > i
> > n
> > g
> > but i would like bottom to top and i cant seem to find it
> > g
> > n
> > i
> > t
> > s
> > e
> > t
> > any ideas ?
> You might be able to use the StrReplace function (i.e., an expression
> like):
> =StrReplace(Fields!SomeField.Value)
> If this doesn't work, you may need to create a single-column table
> control and populate it from a dataset that is custom sorted before
> getting to the report (in the stored procedure/query that sources the
> report).
> Hope this helps.
> Regards,
> Enrique Martinez
> Sr. Software Consultant
I think you might mean the StrRev() function. (String Reverse)
Because essentially, the formatting is correct, you just want the
letters to appear in reverse order.
- Jason|||On Oct 8, 12:32 pm, Jason <flaja...@.gmail.com> wrote:
> On Oct 7, 1:32 pm, EMartinez <emartinez...@.gmail.com> wrote:
>
> > On Oct 5, 5:05 pm, "michael vardinghus" <xx> wrote:
> > > hi
> > > i had luck formatering a text box top to botto in formatting:
> > > t
> > > e
> > > s
> > > t
> > > i
> > > n
> > > g
> > > but i would like bottom to top and i cant seem to find it
> > > g
> > > n
> > > i
> > > t
> > > s
> > > e
> > > t
> > > any ideas ?
> > You might be able to use the StrReplace function (i.e., an expression
> > like):
> > =StrReplace(Fields!SomeField.Value)
> > If this doesn't work, you may need to create a single-column table
> > control and populate it from a dataset that is custom sorted before
> > getting to the report (in the stored procedure/query that sources the
> > report).
> > Hope this helps.
> > Regards,
> > Enrique Martinez
> > Sr. Software Consultant
> I think you might mean the StrRev() function. (String Reverse)
> Because essentially, the formatting is correct, you just want the
> letters to appear in reverse order.
> - Jason
Whoops, sorry I got the function name wrong too. Must be contagious.
It is actually StrReverse
(strrev is correct for PHP, not VBScript. I deal with too many
languages)
Or if you want you can also reverse it in the SQL query if you don't
want to do an expression with the T-SQL REVERSE function.
- Jason|||On Oct 8, 11:36 am, Jason <flaja...@.gmail.com> wrote:
> On Oct 8, 12:32 pm, Jason <flaja...@.gmail.com> wrote:
>
> > On Oct 7, 1:32 pm, EMartinez <emartinez...@.gmail.com> wrote:
> > > On Oct 5, 5:05 pm, "michael vardinghus" <xx> wrote:
> > > > hi
> > > > i had luck formatering a text box top to botto in formatting:
> > > > t
> > > > e
> > > > s
> > > > t
> > > > i
> > > > n
> > > > g
> > > > but i would like bottom to top and i cant seem to find it
> > > > g
> > > > n
> > > > i
> > > > t
> > > > s
> > > > e
> > > > t
> > > > any ideas ?
> > > You might be able to use the StrReplace function (i.e., an expression
> > > like):
> > > =StrReplace(Fields!SomeField.Value)
> > > If this doesn't work, you may need to create a single-column table
> > > control and populate it from a dataset that is custom sorted before
> > > getting to the report (in the stored procedure/query that sources the
> > > report).
> > > Hope this helps.
> > > Regards,
> > > Enrique Martinez
> > > Sr. Software Consultant
> > I think you might mean the StrRev() function. (String Reverse)
> > Because essentially, the formatting is correct, you just want the
> > letters to appear in reverse order.
> > - Jason
> Whoops, sorry I got the function name wrong too. Must be contagious.
> It is actually StrReverse
> (strrev is correct for PHP, not VBScript. I deal with too many
> languages)
> Or if you want you can also reverse it in the SQL query if you don't
> want to do an expression with the T-SQL REVERSE function.
> - Jason
Oops, sorry about that, that's what I meant. Thanks for catching that
Jason.
Regards,
Enrique Martinez
Sr. Software Consultant