Lets Start A Thread Just On The IDE

Oct 18, 2006

When a query is executed, the tab is split horizontally with the bottom half containing two tabs. The first with the result set(s) and the second with the messages.

How do I hide the bottom half after I have read it and now want the entire column to view my TSQL? Is there some menu item or shortcut key that I can use to accomplish this?

In 2000, there is a configuration option to make these tabs appear at the top of the window. I haven't found this setting in Express.

Another nice feature that I appreciate is to be able to divide the window into independant horizontal or vertical windows (or tabs) each with different files. I have found that I can get there with a mouse click but I could use some guidence in restoring the original layout, expecially without closing the windows.

Thanks,
IanO

View 1 Replies


ADVERTISEMENT

Please Start A New Thread For Each Report

Aug 1, 2005

Its way too confusing trying to keep track of multiple reports and people in a single thread.

Thanks!

Paul Randal
Dev Lead, Microsoft SQL Server Storage Engine
(Legalese: This posting is provided "AS IS" with no warranties, and confers no rights.)

View 1 Replies View Related

Is It Possible To Create Thread && Start From CLR Stored Proc

Apr 5, 2006

My simple CLR Stored procedure is as below:

[Microsoft.SqlServer.Server.SqlProcedure]
public static int MyParallelStoredProc(string name1, string name2)
{
Thread t = null;
Worker wth = null;
int parallel = 2;
Object[] obj = new object [parallel];
SqlPipe p;
p = SqlContext.Pipe;

for (int i = 0; i < parallel; i++)
{
if (i == 0)
wth = new Worker(name1);
else
wth = new Worker(name2);
t = new Thread(new System.Threading.ThreadStart(wth.WorkerProc));
t.Name = "Thread -" + i.ToString() + ":";
t.Start();
p.Send(t.Name + ":Started");
obj[ i] = t;
}
for (int i = 0; i < parallel; i++)
{
t = (System.Threading.Thread)obj[ i];
t.Join();
p.Send(t.Name + ":Finished");
}
return 0;
}

The worker class implementing Thread Proc:

public class Worker
{
private string Name;

public Worker(string name)
{
SqlPipe p;
p = SqlContext.Pipe;
Name = name;
p.Send("In Constructor:" + Name);
}

public void WorkerProc()
{
SqlPipe p;
p = SqlContext.Pipe;
for (int i = 0; i < 10; i++)
p.Send(i.ToString()+":"+Name);
}
}


The assembly is registered with UNSAFE permission set.

CREATE ASSEMBLY
ThreadTest
FROM
'C:\ThreadTestinDebugThreadTest.dll'
WITH
permission_set = unsafe;
GO

CREATE PROC ParallelStoredProc
@Name1 NVARCHAR(1024),
@Name2 NVARCHAR(1024)
AS
EXTERNAL NAME ThreadTest.[MyTest.ThreadTest].MyParallelStoredProc


When I invoke the the stored procedure from T-SQL script as below,

EXEC ParallelStoredProc @Name1, @Name2

the thread class constructor gets called; but the 'WorkerProc' does not execute ?



Whether an UNSAFE assembly is allowed to spawn threads

inside SQL Server ?

View 8 Replies View Related

Is There A .net Assembly (api) That Lets Me Run Transact Sql From C#?

Apr 25, 2008

I see examples of running osql programmatically, but was wondering if there is a better way?

View 4 Replies View Related

Microsoft No Longer Lets Us Download SqlExpress. Why?

Jun 23, 2007

Microsoft no longer lets us download SqlServer Express 2005. Does anybody know why? I thought it was free.



http://www.microsoft.com/downloads/details.aspx?FamilyID=220549b5-0b07-4448-8848-dcc397514b41&DisplayLang=en



In fact, none of the many options here work at all:



http://www.microsoft.com/downloads/browse.aspx?displaylang=en&productID=9F07F9CC-C308-4EBF-A4E9-2B8530AB1EA8



How come? Is there someplace else I can get it? I just don't understand why they do this stuff with no explanation. I'm trying to learn C# and I need a database.



Any help would be appreciated.



Dave

Arlington, Virginia

View 15 Replies View Related

Why RS Lets User To Create BookmarkID And Actions By Using A Different Query That The Reportitem Is Using.

Jun 20, 2007

It seems in the spec that Data Regions can only reference a single dataset, then why bookmarkID and bookmark action can reference a different dataset than the one that the Data Region is using?

Like in this case:

1) create a table with dataset1

2) create another table with dataset2

3) create a bookmarkID using =Last(somefield, "dataset1") in any table cell in the first table

4) create a bookmark action using =Last(somefield, "dataset1") in any table cell in the SECOND table.

This is valid report, and it can preview....



I know this example not practical at all, it is just used to illustrate my question.

Is this a scoping rule exception for any special reasons? or it's just a bug?



If it is a scoping rule exception, please explain, and a practical example would be great.

View 4 Replies View Related

Thread Counter

Oct 23, 2003

Hi Everyone,

The sqlserv.exe takes too much CPU utilization on my SQL 2000 on W2K production machine. I am tring to use System Monitor to monitor the Thread/%process time with all Sqlservr instances, and then match the sqlservr instance number to the KPID in sysprocesses table to find out which user is causing the problem. but I can only see the instance number from Sqlservr0 to sqlservr99. From the table sysprocesses table, the KPID is all 3 or 4 digits number. Any one has any idea about this?

Thanks in Advance.

Jason

View 2 Replies View Related

Need A Query... (see Thread)

May 9, 2006

I have this data structure -

Code:


ProductCode - CenterId - Region
13265 - 10 - Asia
13265 - 12 - Asia
13265 - 9 - America
11110 - 10 - Asia
11110 - 9 - America
12365 - 12 - Asia
12365 - 8 - Europe
45620 - 10 - Asia
45620 - 12 - Asia



What I need this query to do is to pull one instance of a product code where the "Asia" appears more than once within the table? Thanks for the help!

View 2 Replies View Related

Killing A Thread

Dec 2, 2004

Hey all,

Just wondering if there is any way to kill a thread within an sqlerver process. The thread we are trying to kill is a rollback statement that has been running for a very long time.

Any ideas ?


Thanks in advance,
Kilka

View 7 Replies View Related

Where Thread Get The Information?

Sep 26, 2007

Hi.


I want to get the current value of culture that my multilanguage application used.

So, i type this line of code :


string getLanguage = "";


getLanguage = Thread.CurrentThread.CurrentUICulture.ToString().Trim();

The thing that I dont understand is, where the thread get the information from? My windows application currently set to "zh-CHS" culture but my pc that running the application is "en-US".

It seems like the thread get the information from my pc. What i want is, getLanguage get the information from the application.


Is that can be achieved? Please explain to me...

View 1 Replies View Related

Thread Was Being Aborted

Dec 19, 2005

I receive the following errors while browsing the http://server/reports page.Please help me to resolve the issue.

Error1.

Thread was being aborted. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Threading.ThreadAbortException: Thread was being aborted. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [ThreadAbortException: Thread was being aborted.] System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +483 System.Web.HttpApplication.ResumeSteps(Exception error) +539 System.Web.HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) +144 System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +300

Error2.

The report server cannot decrypt the symmetric key used to access sensitive or encrypted data in a report server database. You must either restore a backup key or delete all encrypted content. Check the documentation for more information. (rsReportServerDisabled) (rsRPCError) Get Online Help Bad Data. (Exception from HRESULT: 0x80090005)

View 15 Replies View Related

CPU Thread Monitoring

Feb 6, 2008

Hi experts

I have a doubt!

I have identified that one of the instance is taking much more CPU than the other by using the counter process\% processor time in perfmon. So we have decided to monitor only that instance using ID Thread counter to see which process is causing this high usage within this instance.

Now problem... Thread ID is re-used by Windows. We cannot identify which counter is the one causing problem at that point of time just using the ID from a report given to me NEXT DAY because I can never dream of monitoring the server in the real time to see what is the process Thread ID NOW.

Now question.. Is there is any counter that says which process caused the spike in %CPU used at one point of time from the thread id comparing against another counter in perfmon?

I have never worked with this in detail before. If any one can give me the counters and the method to identify which process is related to which thread at that point of time from a report received NEXT DAY MORNING, thanks a lot.

another thanks in advance

Priw

View 1 Replies View Related

IS Same? (RS Start In Window Severvices V RS Start In Configration)

Mar 30, 2007



1) RS Start in Window Severvices
2) RS Start in Configration

1) and 2) Is Same?

I think that It looks like same Operation.

View 1 Replies View Related

Database Thread Closed?

Jan 30, 2007

Hello,
I have built a system, that uses a .dll file for all SQL operations. So a program looks something like this:
using myDLL;
....
SQLDBCON mSQL = new SQLDBCON();
and here comes the rest of the program.
My question is, the dll file has all stored procedures and when you declare mSQL as shown above, then it opens a thread to the database for that user.
Is that thread properly closed when the site has finished loading?
in my .aspx page i dont have a function like mSQL.CloseDB();
and if i try to add something like this to the dll file
~SQLDBCON {
m_local_con.Close();m_local_con.dispose();
}
i get a error message says something that this is not allowed.
Just want to know if my thread in the dll file is properly closed?

View 9 Replies View Related

Need Opinion About This Design Thread

Apr 13, 2007

Hi all,
I am having problem with SQL connection at Godaddy where my pool connection gets MAX OUT. When it happens, I cannot access the database.This is the thread about the problem: http://forums.asp.net/thread/1665023.aspx
I just created this with "THREAD". I hope someone who has experiences with thread can give me some advice about my design. This is my first time.
 
static object Locked = new object();
public object ExecuteCommand(string queryStr, string type){     //*************************************************************************************//     // ExecuteCommand: Returns an object //    //*************************************************************************************//     Thread t = null;     lock(Locked)     {          SQLString = queryStr;                    switch(type)          {               case "ExecuteNonQuery":                   t = new Thread(ExecuteNonQuery);                   break;               case "ExecuteScalar":                    t = new Thread(ExecuteScalar);                    break;               case "GetDataReader":                    t = new Thread(GetDataReader);                    break;          }             t.Start();          t.Join();     }     return null;}
First of, does this work at all? It runs, but is it a good design in term of Thread? Since I use LOCK, do I still need the t.Join() function? The switch with the three cases, is that OKAY? Basically, I'm clueless. If you read my other post, you will get an idea what I'm trying to do. Any feedback would be very very appreciated.
Thank you.

View 2 Replies View Related

@@IDENTITY And Thread Safety

Jun 29, 2005

I am currently using @@Identity to retreive the Identity value for the PK field in a table that I am inserting data into. Essentially, my code looks like this:SqlCommand cmd=new SqlCommand("Insert into table(... ;Select @@Identity from table",conn);string identity=cmd.ExecuteScalar();Testing this myself, it works fine, but I am worried as to how thread safe this is in a real-world environment? (i.e. with multiple users clicking at it). Is there a guaranteed way to make this thread safe- wrap it in a transaction maybe?

View 4 Replies View Related

Thread Starvation Detected

Apr 19, 2001

Any practical suggestions as to how to elminate this error as result of script executions?

Thanks,

Steve Brown

View 1 Replies View Related

SQL Thread/post Sorting.

Oct 13, 2004

I'm making a "simple" ASP forum to integrate into a webpage solution. I just recently ran into a problem with sorting threads.
I have a page that displays all threads in a given forum (Threads.ThreadForumID=iForumID) this page will have all pinned threads on top of the list the threads should then be sorted according to when a message last was posted inside the thread (Posts.PostDate)

Sort order:
Threads.ThreadPinned
Posts.PostDate or Posts.LastPostDate if it has been set.

The tables are as follows:
Threads table:
ThreadIDNumber
ThreadNameText
ThreadViewCountNumber
ThreadOwnerIDNumber(Ref to thread owner id, user)
ThreadLockedBoolean
ThreadPinnedBoolean
ThreadForumIDNumber(Ref to ForumID, forum)

Posts table:
PostIDNumber
PostTextText
PostOwnerIDNumber(Ref to post owner, user)
PostLastEditByNumber(Ref to last user that edited, user)
PostThreadIDNumber(Ref to thread)
PostIPText
PostNicknameText
PostDateDate
PostLastEditDateDate

Current "sort":
This is the current SQL statement it is not in any way correct. It's just temporary. I have tried different joins but I can't seem to get it right!

SELECT ThreadID
FROM Threads
WHERE ThreadForumID=" & iForumID & "
ORDER BY ThreadPinned DESC, ThreadID DESC

Could someone please give me a hand here?

View 13 Replies View Related

Lock On Inactive Thread Won't Go Away

Feb 29, 2008

Hello,

I am having a problem with the SQL Server 2005 database of our ERP system. We have a scheduled batch that gets stuck because of a lock on a table. The lock remains overnight and halts all other processes (it seems most of them are waiting for this lock to get solved)
I know which table the lock is on and if I kill the lock manually, the batch continues and finishes without a problem

my question is: can I change this behaviour somewhere?

The piece of code that causes this lock is protected, but in a debug log I was able to see that it happens during following actions:

first a select is performed to fetch a certain record in the file that gets locked
next an update is performed with following syntax:

update ... set.... where current of 'pointername'

this update is waiting for a lock to be released before the batch continues.

My guess is that somehow the pointer that is set with the select statements, locks the row and that's why the update cannot be performed.
The strange part is that this lock does NOT occur everytime that this table needs to be updated. And that's why I am stuck and asking help of the real database people :)

If someone can give me a hint on a setup,property, or just a pointer to where I can find more info on the 'why'-part of the lock, I would be very grateful

database is SQL Server 2005 SP1 on win2k3

View 3 Replies View Related

Can Activation SP Wake Up A Thread?

Aug 15, 2007

Newbie question, but is there a way for me to set up a thread in my c# code so as it sleeps until it gets woken up by an event fired by an activation SP?

As in queue sits idle, thread sleeps.
Queue receives a message, activation SP gets fired, activation SP raises an event which gets caught by event handler in code, which wakes up thread to do processing?

View 1 Replies View Related

The UDP/UDF/UDT Did Not Revert Thread Token.

Jan 24, 2008

I have been struggling with this error for a while now. Not much when I put it in the search engines. I get the error as follows when I execute this CLR stored procedure:


Msg 10312, Level 16, State 49, Procedure SpPICK00, Line 0

.NET Framework execution was aborted. The UDP/UDF/UDT did not revert thread token.

The code for the stored procedure is as follows. If anybody could offer any advice on what this error means I would appreciate it. I know through debugging that it's erroring out on the ImpContext = ClientID.Impersonate() line.


Dim DbCon As New SqlConnection("context connection=true")

Dim DbSql As New SqlCommand("SELECT TOP 1 * FROM TblTransactions", DbCon)

Dim TransactionID As Int64

DbSql.Connection.Open()

Dim DbRs As SqlDataReader

DbRs = DbSql.ExecuteReader

While DbRs.Read

TransactionID = DbRs("TransactionID")

End While

DbRs.Close()

Dim MenuID As Int16

Dim MONumber As String

Dim LineNumber As String

Dim PTUse As String

Dim SEQN As String

Dim WorkCentre As String

Dim Stock As String

Dim Bin As String

Dim Qty As Double



DbSql = New SqlCommand("SELECT * FROM VwPickList WHERE TransactionID = @TransactionID", DbCon)

DbSql.Parameters.Add("@TransactionID", SqlDbType.BigInt).Value = TransactionID

DbRs = DbSql.ExecuteReader

If DbRs.Read Then

MenuID = DbRs("MenuID")

MONumber = DbRs("MONumber")

LineNumber = DbRs("LineNumber")

PTUse = DbRs("PT_USE")

SEQN = DbRs("SEQN")

WorkCentre = DbRs("WorkCentre")

Stock = DbRs("Stock")

Bin = DbRs("Bin")

Qty = DbRs("Hours")

End If

DbRs.Close()

DbSql.Connection.Close()

DbCon.Dispose()

DbSql.Dispose()

Dim FSClient As New FSTIClient

Dim ClientID As WindowsIdentity

Dim ImpContext As WindowsImpersonationContext

ClientID = SqlContext.WindowsIdentity

ImpContext = ClientID.Impersonate

Shell("NET USE K: \FPTESTFShift", AppWinStyle.Hide)

FSClient.InitializeByConfigFile("K:Mfgsysfs.cfg", False, False)

If FSClient.IsLogonRequired Then

FSClient.Logon("VBS", "visib", "")

End If

If MenuID = 2 Then

Dim Pck As New PICK08

Pck.OrderType.Value = "M"

Pck.IssueType.Value = "I"

Pck.OrderNumber.Value = MONumber

Pck.LineNumber.Value = LineNumber

Pck.PointOfUseID.Value = PTUse

Pck.OperationSequenceNumber.Value = SEQN

Pck.ItemNumber.Value = WorkCentre

Pck.Stockroom.Value = Stock

Pck.Bin.Value = Bin

Pck.IssuedQuantity.Value = Qty

FSClient.ProcessId(Pck)

ElseIf MenuID = 1 Then

Dim Pck As New PICK04

Pck.OrderType.Value = "M"

Pck.IssueType.Value = "I"

Pck.OrderNumber.Value = MONumber

Pck.LineNumber.Value = LineNumber

Pck.PointOfUseID.Value = PTUse

Pck.OperationSequenceNumber.Value = SEQN

Pck.ItemNumber.Value = WorkCentre

Pck.IssuedQuantity.Value = Qty

FSClient.ProcessId(Pck)

End If

FSClient.Terminate()

ImpContext.Undo()


View 12 Replies View Related

Accessing SQL Server Data Using Thread

Sep 17, 2007

Hi,
How do we set credentials or contex to a thread.
I create a new thread and within that thread if I am use a connetion string with Integrated Security=True" to talk to the SQL Server, however it seems that the new thread's context/identity is blank and hence failing the SQL Server connection.
Please help.
Thanks
 
 

View 2 Replies View Related

SQL Server Could Not Spawn Process_loginread Thread.

Feb 18, 2005

Hi boys and girls,

all of the sudden two days ago there are error messages started to appear in SQL Log, the server slows down substantially during these errors occurance:

SQL Server could not spawn process_loginread thread.

and

ERROR: Launch of System Task 'OnDemand' failed!

Any ideas of the best way to troubleshoot/reproduce it?

I run SQL2000 Ent on NT Server 2000 Advance. SP3a installed.
3.5Gb memmory allocated to the server with AWE anabled.

Any help appreciated.
Cheers.
Dim

View 2 Replies View Related

Deadlocked On Thread | Communication Buffer

Oct 19, 2005

Sql version
Microsoft SQL Server 2000 - 8.00.818 (Intel X86)
May 31 2003 16:08:15
Copyright (c) 1988-2003 Microsoft Corporation
Standard Edition on Windows NT 5.0 (Build 2195: Service Pack 4)

I have dts running 24 X 7 every 5 minutes
I noticed DTS failed few times a day with error

Step Error Source: Microsoft OLE DB Provider for SQL Server
Step Error Description:Transaction (Process ID 74) was deadlocked on thread | communication buffer resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
Step Error code: 80004005
Step Error Help File:
Step Error Help Context ID:0

The is no entry about in Server server log files.
will trace identify deadlock and why deadlock info not entred into log file ?

View 3 Replies View Related

Off Thread: SQL Server Users Groups

Feb 12, 2004

Hope I'm not going to annoy anyone here too much but I'm looking for a place to post a job opening and was hoping that someone out there might know of a good site or two.

The job will be in the north Denver area.

Thanks! (And apologies if this is completely inappropriate behavior.)

View 4 Replies View Related

Increase Number Of Process(thread)

Jul 23, 2005

Hello all,A software that connects SQL Server via ODBC uses 12 process at the sametime when I look at the process info(panel). Is it possible to increasenumber of process (or thread) for a specific database? Is there anyparameter?Thanks in advance,Do.--Message posted via http://www.sqlmonster.com

View 2 Replies View Related

Package Error: Cannot Create Thread

Nov 17, 2006

I have a child package that has been run successfully multiple times in the last month +. Each time with roughly the same amount of data, give or take a few thousand rows.

Suddenly, this child package is now giving me the following errors from the log file:

Error: 2006-11-17 12:04:19.98
Code: 0xC0047031
Source: DFLT Primary DTS.Pipeline

Description: The Data Flow task failed to create a required thread and cannot begin running. The usually occurs when there is an out-of-memory state.

End Error

Error: 2006-11-17 12:04:20.03
Code: 0xC004700E
Source: DFLT Primary DTS.Pipeline

Description: The Data Flow task engine failed at startup because it cannot create one or more required threads.

End Error

I tried taking the child out of parent and running it by itself. I still get the same error. There are three other child packages that run on the exact same data and they have no problems. The control flow for the package first runs an SQL command. Then it has a data flow. The data flow grabs records from the source, adds two derived columns, looks up data and then stores to the destination. Relatively easy compared to other packages that are running just fine.

I've had our network people check the both the server running SSIS and the database server (two different machines) and there are no memory spike while the package is running.

Any ideas?

View 1 Replies View Related

Is @@rowcount And Scope_identity() Thread Safe?

Aug 23, 2007

Hopefully this is the right forum! Im guessing they both are since they return the values pertaining to the current scope. I don't want to use transactions when I dont have to. What do you guys think?

View 4 Replies View Related

Thread Safe Question On Insert

Sep 5, 2007

Assume in a table, I have a table structure which contains parentID and childID.

In my procedure to insert a child for example, I begin a transaction, do a select statement see how many children for the given parentID, if is more than 10 then don't insert , otherwise insert the new child in. Then commit the transaction.

I wonder how thread safe such code would be... Quite worry about data corruption.

If 2 threads both updating this table, and the select statement both return 9 children, so both of them think they can do the insert, so the parent will end up with 11 children. Is such scenario possible to occur? If so, how to solve it and make sure the code is thread safe?

Hope someone can give me some suggestions..

Thank you

View 10 Replies View Related

Changing A Reply To Another Question In The Same Thread

Sep 8, 2006

Is there a way to do this? When I have a further question in the same thread, my only option is to reply to the one who answered the last question. How do I put forward that question to everyone? Do I have to start a new thread with the same subject?

thx

Kat

View 4 Replies View Related

Thread Pooling In Java Servlet Environment

Aug 17, 1998

Anyone have any experience with running MS SQL Server web applications using Java servlets with connection pooling? Any settings/tricks/traps that we should be aware of?

Our basic problem is that under CERTAIN senarios (which we haven`t been able to strictly identify yet), it appears that each browser client has to wait for the last client to finish - only shared locks are being applied to the database.

View 1 Replies View Related

Comment Thread For This Forum's Hint Sticky

Sep 27, 2005

My God! What happens if I miss a step, or put it in a different order??? I know I can specify ORDER BY StepID, but what about a missing step? I do have "missing ranges" script, but posting questions filtered through the script process may become a full-time job in itself...What to do, what to do...

View 14 Replies View Related

Yet Another SQLBindParameter Thread -- Char* As A Parameter? (already Did A Search)

May 3, 2007

Hi guys, first post here. It's been a few years since I've worked with ODBC, so I'm a bit rusty. I'm having trouble figuring out how to use a char* string as a parameter for a SELECT statement. I'm trying to compare the contents of a varchar column (with size=20) against the string.

Here's the code that I'm using:


char* arg;
SQLINTEGER stringSize = 32;

retcode = SQLBindParameter(hstmt,
1,
SQL_PARAM_INPUT,
SQL_C_CHAR,
SQL_VARCHAR,
20,
0,
arg,
stringSize,
&stringSize);

retcode = SQLPrepare(hstmt,
(SQLCHAR*) "SELECT * "
"FROM myTable "
"WHERE (stringColumn = '?')",
SQL_NTS);

retcode = SQLExecute(hstmt);

retcode = SQLFetch(hstmt);

When SQLFetch() runs, it returns 100 (SQL_NO_DATA). If I type the query manually into my Enterprise Manager console, I get several results, so I know the query is correct. Any idea what I might be doing wrong with the ODBC calls?

Thanks!

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved