Connections Are Not Selected As Documented
Dec 2, 2007
The following test seems to contradict documented behavior....
1) Running SQL Server 2005 Express with Shared Memory (SM) and TCP enabled connect via ADO.
2) Connect with "localhost", it connects using SM.
3) Disable SM and restart the Server Service.
4) Connect with "localhost", it connects using TCP.
5) Enable SM and restart the Server Service.
6) Connect with "localhost", it still connects using TCP!!
To restore a SM connection, the only way that I have figure out is...
7) Disable TCP and restart the Server Service.
8) Connect with "localhost", it connects using SM.
And then restoring TCP does not change the connection
9) Enable TCP and restart the Server Service.
10) Connect with "localhost", it still connects using SM.
If you run steps 1 - 6 but skip #4, step #6 will connect with SM. So one concludes that the TCP connection is somehow "sticky".
Any ideas on how to force a shared memory connection in step #6?
View 3 Replies
ADVERTISEMENT
May 6, 2015
Using SSRS 2008 r2...I have a report with a single-value parameter and three multi-value parameters, Class1, Name2 and Name3. I'm hoping for an explanation to one thing that I'm seeing and information on a second thing.
Class1 and Name2 both have the (Select All) parameter selected but Class1 is displaying the concatenated parameter variable list whereas Name2 is showing Null. Why is that? If anything, how can I get Class1 to be similar to Name2 and show Null?But my desired wish is to have Class1, Name2 and Name3 display the text"All Selected" when the parameter (Select All) is chosen.
View 3 Replies
View Related
Feb 21, 2014
I have created a Transactional Replication Publication on my SQL 2012 server.When I log into another server on the domain running 2008R2 and try to subscribe to the 2012 Publication, I get the following error when clicking on "Add SQL Server Subscriber": "The selected Subscriber does not satisfy the minimum version compatibility level of the selected publication"
The 2012 DB is set as 2008 Compatibility Mode?Am I not able to Publish from 2012 to 2008?.I was using SSMS 2008 to connect to my 2012 Instance, thats why it didn't work...
View 0 Replies
View Related
Jun 27, 2006
Hi There
I would like to write sql to check that space used by any given data file in SS2000.
sp_spaceused only returns the total space used by the DB or object in the DB, not for a specific data file.
DBCC SHOWFILESTATS does give me this information , but it is not documented in BOL, i would prefer not to use an undocumented command to ensure future use in later versions. Is DBCC SHOWFILESTATS an undocumented T-SQL command ? If so what documented t-sql command will provide me with this information ?
I could query system table's and work this out , but as mentioned this may not not work in future versions of SS.
Thanx
View 1 Replies
View Related
Feb 6, 2008
One of the primary parts of my job is working with the SQL database of our Enterprise ERP software. One of my primary responsibilities is writing reports based on it's data and since it is not well documented and this is one of my biggest challenges. To top it all off, it's hard to even use their reports to learn the links between tables as the reports run completely in Visual Foxpro.
Is there reasonably priced software that will analyze the database for me and make it easier for me to figure out the relationships between certain tables and such?
TIA,
Dave
View 1 Replies
View Related
Dec 31, 2007
Hello all, according to the documentation for the DeviceInfo parameter of the ReportingService.Render method the Xml string fragment of PageHeight and PageWidth for the Image Device Information Settings should and I quote.
The page height, in inches, to set for the report. You must include an integer or decimal value followed by "in" (for example, 11in). This value overrides the report's original settings.
Emphasis mine. Page width is similar. However when I change that value to what is desired for the IMAGE format it has no effect whatsoever no matter what value I place in there.
Indeed the size that is rendered is more related to the current display resolution setting rather than the PageHeight/PageWidth values passed in. In otherwords if my laptop has a higher resolution of 1920x1200 and the server that I deploy this WS to has a lower resolution of 1280x1024, the image rendered on the higher resolution display fits on to an 8.5x11.0 in page with room to spare but on the lower resolution display it is clipped because it does not fit the page.
Is there something that I am doing wrong or is this indeed a bug?
Thank you,
John
View 4 Replies
View Related
Aug 23, 2006
I have been working on an application which require as much percision as we can get. We have defined all numeric values as (38,16) however when ever we divide a number by the result of a built in function it truncate the percision to 5 decimal place this cause us to have a small but enoying loss in the numbers being caculated we need a minimuim of 8 decimal places or better is there a work around or solution for this problem in sql server 2005. The more percision the better.
example: select tna/(select sum(tna) from taum) from taum where fund_id = 2345
the result is always 5 decimal places even though fund_id tna = 2569698.23 and sum(tna) =98745612325879.36 which should equal .00000002602341683313994 instead the result = .00000
View 2 Replies
View Related
May 17, 2005
Hi there,
Here we have got a
asp.net application that was developed when database was
sitting on SQL server 6.5. Now client has moved all of their databases
to SQL server 2000. When the database was on 6.5 the previous
development team has used oledb connections all over. As the databases
have been moved to SQL server 2000 now i am in process of changing the
database connection part. As part of the process i have a login
authorization code.
Private Function Authenticate(ByVal username As String, ByVal password As String, ByRef results As NorisSetupLib.AuthorizationResult) As Boolean
Dim conn As IDbConnection = GetConnection()
Try
Dim cmd As IDbCommand = conn.CreateCommand()
Dim sql As String = "EDSConfirmUpdate" '"EDSConfirmUpdate""PswdConfirmation"
'Dim cmd As SqlCommand = New SqlCommand("sql", conn)
cmd.CommandText = sql
cmd.CommandType = CommandType.StoredProcedure
NorisHelpers.DBHelpers.AddParam(cmd, "@logon", username)
NorisHelpers.DBHelpers.AddParam(cmd, "@password", password)
conn.Open()
'Get string for return values
Dim ReturnValue As String = cmd.ExecuteScalar.ToString
'Split string into array
Dim Values() As String = ReturnValue.Split(";~".ToCharArray)
'If the return code is CONTINUE, all is well. Otherwise, collect the
'reason why the result failed and let the user know
If Values(0) = "CONTINUE" Then
Return True
Else
results.Result = Values(0)
'Make sure there is a message being returned
If Values.Length > 1 Then
results.Message = Values(2)
End If
Return False
End If
Catch ex As Exception
Throw ex
Finally
If (Not conn Is Nothing AndAlso conn.State = ConnectionState.Open) Then
conn.Close()
End If
End Try
End Function
''' -----------------------------------------------------------------------------
''' <summary>
''' Getting the Connection from the config file
''' </summary>
''' <returns>A connection object</returns>
''' <remarks>
''' This is the same for all of the data classes.
''' Reads a specific
connection string from the web.config file for the service, creates a
connection object and returns it as an IDbConnection.
''' </remarks>
''' -----------------------------------------------------------------------------
Private Function GetConnection() As IDbConnection
'Dim conn As IDbConnection = New System.Data.OleDb.OleDbConnection
Dim conn As IDbConnection = New System.Data.SqlClient.SqlConnection
conn.ConnectionString = NorisHelpers.DBHelpers.GetConnectionString(NorisHelpers.DBHelpers.COMMON)
Return conn
End Function
in the above GetConnection() method i
have commented out the .net dataprovider for oledb and changed it to
.net dataprovider for SQLconnection. this function works fine. But in
the authenticate method above at the line
Dim ReturnValue As String = cmd.ExecuteScalar.ToString
for some reason its throwing the below error.
Run-time exception thrown : System.Data.SqlClient.SqlException - @password is not a parameter for procedure EDSConfirmUpdate.
If i comment out the
Dim conn As IDbConnection = New System.Data.SqlClient.SqlConnection
and uncomment the .net oledb provider,
Dim conn As IDbConnection = New System.Data.OleDb.OleDbConnection
then it works fine.
I also have changed the webconfig file as below.
<!--<add
key="Common" value='User ID=**secret**;pwd=**secret**;Data
Source="ESMALLDB2K";Initial Catalog=cj_common;Auto
Translate=True;Persist Security Info=False;Provider="SQLOLEDB.1";'
/>-->
<add key="Common" value='User ID=**secret**;pwd=**secret**;Data Source="ESMALLDB2K";Initial Catalog=cj_common;' />
Please help. Thanks in advance.
View 4 Replies
View Related
Jul 20, 2005
Just a quick question about connection management. My application willnever need more than 1 or 2 connections about at any given time. Also, I donot expect many users to be connected at any given time. For efficiency, Iwould like to keep connections alive throughout the lifetime of the objectsrequiring them, rather than opening a new connection, executing code andthen closing it again. What is the most efficient way of doing this?Should I perform the open/close or just one open when I create the objectand a close when I dispose of it?
View 1 Replies
View Related
Apr 2, 2008
Dear readers,
On my page people can opload foto's with a <asp:FileUpload ID="myfile" runat="server" BorderWidth="3px" BorderColor="Silver" BorderStyle="Inset" />
and stored the filePath in the database
Now i want, that when there is no picture selected, the path to Noimage.jpg picture who is in my image map will stored on my datadbase.
my script start like this If Not (myfile.HasFile) Then
////how can i select a standard image from
my imageMap and store path to database /////
Dim cnn As Data.SqlClient.SqlConnection
Dim cmd As Data.SqlClient.SqlCommand
Dim strSQL As String
Dim connString As String = (ConfigurationManager.ConnectionStrings("Personal").ConnectionString)
strSQL = "Insert Into tblMateriaal(ArtikelGroep,Artikelnaam,ArtikelType,ArtikelMaat,Aantal,Prijs,ContactPersoon,EmailAdress,Aanvul) Values(@ArtikelGroep,@ArtikelNaam,@ArtikelType,@ArtikelMaat,@Aantal,@Prijs,@ContactPersoon,@EmailAdress,@Aanvul)"
cnn = New Data.SqlClient.SqlConnection(connString)
cmd = New Data.SqlClient.SqlCommand(strSQL, cnn)
Dim plaatje As New Data.SqlClient.SqlParameter("@plaatje", System.Data.SqlDbType.NVarChar)
plaatje.Value = " "
cmd.Parameters.Add(plaatje)
Dim ArtikelGroep As New Data.SqlClient.SqlParameter("@ArtikelGroep", System.Data.SqlDbType.NVarChar)
ArtikelGroep.Value = ddl1.SelectedValue
cmd.Parameters.Add(ArtikelGroep)
Dim ArtikelNaam As New Data.SqlClient.SqlParameter("@ArtikelNaam", System.Data.SqlDbType.NVarChar)
ArtikelNaam.Value = tb1.Text
cmd.Parameters.Add(ArtikelNaam)
cnn.Open()
cmd.ExecuteNonQuery()
cnn.Close()
End if Lots of thanks
View 2 Replies
View Related
Apr 30, 2007
Hi,
I am having a problem updating one field in a table the update should be the product of two other fields from the same row.
There are atleast 3000+ records need to be updated here.
e.g.
update A
set A.b = A.c * A.D
here b c and d are from same row .. I was wondering if someone knows how to solve this problem.
Thanks in advance.
View 8 Replies
View Related
May 7, 2008
HI Guys, I have a question.
I am converting Access SQL to SQL Server. One of the statements calls for a wildcard if the user does not select a value for the designated parm field. The value is selected from a cbolist (of names).
Current Statement:
And tblRetailer_Contact.faxcontact LIKE *
I substituted:
And tblRetailer_Contact.faxcontact LIKE ‘%@faxContacts%’
This might work if the User selects a name but if the User leaves it blank it will not work. Any ideas on how I go about establishing a wildcard if not name is selected?
DECLARE @FaxContact as varchar (50)
SET @H_Date = (SELECT StartDate FROM tblRpt_Params WHERE RptID = 5)
SET @Start_Date = (REPLACE(REPLACE(CONVERT(VARCHAR (8), @H_Date, 112), '-', ''), ' ', ''))
SET @H_Date = (SELECT EndDate FROM tblRpt_Params WHERE RptID = 5)
SET @End_Date = (REPLACE(REPLACE(CONVERT(VARCHAR (8), @H_Date, 112), '-', ''), ' ', ''))
SET @FaxContact = (SELECT FaxContact FROM tblRpt_Params WHERE RptID = 5)
SELECT tblEData.Timestamp As [TimeStamp],
LTRIM(RTrim([ResultsCustName])) AS CustName,
LTRIM(RTrim([ResultsPH])) AS Phone, Status As [Status],
FaxContact AS FaxContact,
ResultsPKey As ResultsKey
INTO tmpE_Callbacks
FROM tblEData
LEFT JOIN tblContact
ON tblEData.RetailerPrefix = tblContact.Prefix
WHERE tblEData.Timestamp BETWEEN @Start_Date And @End_Date
AND FaxContact Like '%@FaxContact%'
Thanx so much,
Trudye
View 11 Replies
View Related
Jan 25, 2006
I am new to writing sprocs so forgive me if this is trivial. I am selecting fields from a table and placing them into a temp table in row format. (Row 1 in temp table is the first row in a file that will be created using DTS package). My question is: How can a format a field that I have selected that only has, say 3 chars, into a value of 5.
Ex: field in DB = aaa
I need to format it as: 2 spaces + aaa
But the length of the value will be varying from record to record.
View 7 Replies
View Related
Jan 23, 2008
I need to get the Bacup of my SQl 2000 database
but i need only last 100 records of all tables in my database.
or
i want to create new database from existing , schama is same but i need to import only 1000 record from all tables
View 2 Replies
View Related
Feb 20, 2007
How would I reference the selected value of a dropdown parameter in SSRS using VS2005?
For instance, the city Miami is selected I want to find out if both dropdowns match eachother...
iif(dropdown1.selected.value = dropdown2.selected.value,false,true)
View 9 Replies
View Related
Feb 28, 2008
How can I get an Id of selected record? something like
Code Snippet
DECLARE @Id uniqueidentifier
SELECT @Id = ID FROM DataTable
BUT! I need also retrieve a data in the same query. Is that possible or there is a different way? Thanks.
View 4 Replies
View Related
Oct 13, 2006
I have to dts rows by timestamp. For example if my dts downloaded at 10 am then in the next run i want to grab rows updated in the AS400 after 10am. what is the best way to go in ssis?
thanks...
kushpaw
View 5 Replies
View Related
Oct 8, 2007
Hello,
I've gotton both the sprocs in these tutorials to work in the C# app:
http://www.sqlserverdatamining.com/DMCommunity/TipsNTricks/4503.aspx
http://www.sqlserverdatamining.com/DMCommunity/TipsNTricks/2271.aspx
But when I try to call them in the Managment Studio I get the following error:
"No cube specified. A cube must be specified for this command to work."
What am I missing here?
Thanks in advance,
Adam
View 8 Replies
View Related
Feb 24, 2007
Hello all! How can I get data from SqlDataSource for row selected in GridView?
View 3 Replies
View Related
Dec 1, 2005
Hi. With VWD i've produced the following code.<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:50469ConnectionString %>"SelectCommand="SELECT * FROM [ibs] WHERE ([liedID] = @liedID)"><SelectParameters><asp:ControlParameter ControlID="ListBox1" Name="liedID" PropertyName="SelectedValue" Type="Int16" />But the query is only returning one row of the table. Even when multiple values were selected in the ListBox1. Could someone tell me how to do?Thanks, Kin Wei.
View 2 Replies
View Related
Feb 12, 2006
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" tableid: 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.
View 10 Replies
View Related
May 16, 2006
I know how to get the events that start say on May, and I know how to get the events that end on May, however, How would I get the events that start on January and end in July. The month of May should display that event too.
so far, as an example, I have: SELECT
Events.startDate,
Events.endDate
FROM Events
WHERE
Events.Active = 1
AND
startDate BETWEEN convert(smalldatetime, '5/1/2006') AND convert(smalldatetime, '5/31/2006')
ORDER BY Events.startDate ASC; thank in advance.
View 3 Replies
View Related
May 29, 2001
Hi every body,
I am making a program which is currently dealing with thousands of records.
What I want is to have a button in the front END which make me able to fetch only first 100 record.If the desired record doesn't come with in first 100 record I press this button another time to fetch next 100 records i.e. from 101 to 199.
How can it be possible in SQL Server stored procedure.
Eagerly waiting from all of you GENIUS people.
Kailash
View 1 Replies
View Related
Nov 23, 1999
Hi !
Is there any function for counting each row selected.
For example if I do "select * from employers order by salary"
and get:
10 Matthew Norton 5000
15 Ben King 4000
13 Caroline Stewart 2500
97 Joe Langkow 1300
How can I rank this so that I can get a number like that Caroline has got the third best salary in the company ?
View 2 Replies
View Related
Nov 20, 2006
Ok..............so I'm totally new to this whole SQL thing and I need some help..........please!
I have a table rf_log with the following fields:
PACKSLIP varchar(20)
BINLABEL varchar(8)
EXTENDED varchar(50)
TERMID smallint
USERID varchar(8)
ACTION varchar(8)
QUANTITY int
Q_SCALER smallint
REFERENCE2 varchar(30)
REFERENCE3 varchar(30)
DATE_TIME varchar(23)
DATE_CREAT timestamp(8)
LOCATION varchar(20)
TOTLABEL varchar(20)
CLIENTNAME varchar(15)
PO_NUM varchar(25)
SERIAL varchar(25)
LICENSE_PLATE varchar(22)
What I need to do is to get a list of packslips where the packslip number will BEGIN with the user selected parameter.
For example if the user input is 'ORD000888' then I could possibly get a return of:
Ord000888-0
Ord000888-1
Ord000888-2...............and so on.
I have tried this but unsuccesfully:
SELECT PACKSLIP,BINLABEL,EXTENDED,TERMID,USERID,QUANTITY,Q_SCALER,TOTLABEL,REFERENCE2,REFERENCE3,DATE_TIME, DATE_CREAT,CLIENTNAME,PO_NUM,SERIAL,LOCATION,LICENSE_PLATE
FROM rf_log
WHERE PACKSLIP LIKE ?C
I have also tried:
DECLARE @Pickslip varchar(30)
SET @Pickslip = ?C
SELECT PACKSLIP
FROM rf_log
WHERE PACKSLIP LIKE @Pickslip
None of these worked. Any help would be greatly appreciated.
View 5 Replies
View Related
Apr 1, 2008
Hi all,
I have the situation below. I can't use dual. Thank you for your time.
Example Query:
select name
from employee
where id=1;
Result:
0 rows selected
Wanted Result:
1 row selected
View 5 Replies
View Related
May 9, 2008
I want to display the data in a datasheetview in ms access project.
The data is between particular date. What command should i used for this?
My form contailn feilds : UserId,FromDate,ToDate
Enter the userid & Particular date & after click on submit data for that period should display in datasheet view.
Please help me in this as soon as possible.
View 2 Replies
View Related
Dec 28, 2005
Hi,
Wondering if anyone can help with this..
I want to INSERT some data already SELECTED in a query and also some other variables.. Will the **dodgy code** make it easier to understand I wonder..
** DODGY CODE **
INSERT INTO tblTableOne(Column1, Column2, Column3, Column4)
VALUES( ( SELECT Column1, Column2 FROM tblTableTwo ), "Text for Column3", "And text for column4")
** END OF DODGY CODE **
I understand it may have something to do with TEMP TABLES perhaps??
Any help greatly appreciated..
KingRoon
Chaotician Man,
Slice the lines of virgin pathways.
Harmony Hero.
View 4 Replies
View Related
May 2, 2007
Hi
In the page load of my webpage I call a databind for a gridview.
It generally calls this event handler :
protected void SqlDataSource1_Selected(object sender, SqlDataSourceStatusEventArgs e)
However sometimes (seemingly randomly) it doesn't.
Any ideas?
Thanks
p
protected void Page_Load(object sender, EventArgs e)
{
...
if (searchText != "")
SqlDataSource1.SelectParameters["search"].DefaultValue = searchText;
else{
SqlDataSource1.SelectParameters["search"].DefaultValue = "";
GridView1.DataBind();
}
View 2 Replies
View Related
May 9, 2007
How can i get ALL the selected items into the database? this loop only accepts one item. I have tried with a "clear" action, does not work.... protected void Button2_Click(object sender, EventArgs e) { if (Page.IsValid) { // Define data objects SqlConnection conn; SqlCommand comm; // Open the connection string connectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString; // Initialize connection conn = new SqlConnection(connectionString); // Create command comm = new SqlCommand("INSERT INTO TestTabel (TestNavn) VALUES (@TestNavn)",conn); // Add command parameters foreach (ListItem item in TestListBox.Items) { if (item.Selected) { comm.Parameters.Add("@TestNavn", System.Data.SqlDbType.NVarChar); comm.Parameters["@TestNavn"].Value = Item.Text; } } // Enclose database code in Try-Catch-Finally try { // Open the connection conn.Open(); // Execute the command comm.ExecuteNonQuery(); // Reload page if the query executed successfully Response.Redirect("Default.aspx"); } catch(Exception Arg) { Response.Write(Arg.Message); // Display error message Label1.Text = "Error !"; } finally { // Close the connection conn.Close(); } } }
View 1 Replies
View Related
Aug 5, 2007
In a few places in my application I want to execute a procedure for every selected record. The only way that I know how to do this is to use a cursor, as below. This code works perfectly, but everything I read says that one should use set operations rather than cursors wherever possible, as they are much more efficient. So what I really want to do is something like Exec procedure argument [,argument]... where argument in (Selet value from ....)or perhaps Exec procedure (select ...) [,argument]or SELECT (procedure....
all of which are invalid. Is there any syntax that avoids the cursor in: ---Copy all facts (and their details, if any) to the new INDI
Declare ccopyIndi cursor for --Step through facts
Select Factid from gdbfact
where factindiid = @IndiidFrom
Open ccopyIndi
FETCH Next from ccopyIndi into @Factid
while @@Fetch_status = 0
Begin
exec dbo.gdbcopyfact @NewIndiid, @Factid
Fetch next from ccopyIndi into @Factid
End
CLOSE ccopyIndi
DEALLOCATE ccopyIndi
(BTW, dbo.gdbcopyfact is NOT a simple INSERT statement)
View 5 Replies
View Related
Oct 2, 2007
Can this be done?
I have a procedure where I have Values and Selected Table items that have to be inserted into a nother table that require them to be stored in the same record to the data correctly placed?
View 1 Replies
View Related