I have this sql syntax which displays the records within the xml but instead of displaying 4 records (3 records relating to the last question ID) but instead resulting in only two records picking only the first options 'Unhelpful'.
Hi Everybody,I am facing another probs. I have created a trigger for table Tab1 forperticular column col1 for checking value ranges.But at time for usinginsert statement it is working fine but when I am importing data fromflat file through DTS the trigger is not working.How to solve this.RegardsArijit Chatterjee
Hello... I am stuck with update statement... I am having 3 tables abc,def and xyz... i want to update column1 of abc with column2 of def values (here the probs is i dont have any common fields between them) i am having common values between def(column10) and xyz(column10_new) so i am using inner join something like below....
but this looks like wrong to me...bcoz when i do this (only select): select column2 FROM def inner join xyz on def. column10 = xyz. column10_new i am getting different as compared to the update below....
UPDATE abc SET column1 = column2 FROM def inner join xyz on def. column10 = xyz. column10_new
can anyone suggest how to solve this update??? Thanks
Hi Group,I am trying to display the multiplication through this way----------------------select 1163436036*100----------------------Getting the error============================Server: Msg 8115, Level 16, State 2, Line 1Arithmetic overflow error converting expression to data type int.============================For that reason I was tried to convert that to nvarchar------------------------select convert(numeric(36,2),1163436036*100)------------------------But still getting the error=============================Server: Msg 8115, Level 16, State 2, Line 1Arithmetic overflow error converting expression to data type int.=============================Please help me to solve it out..Thanks and RegardsArijit Chatterjee
I have production server 2000. The server gets disconnected sometime by itself and sometime it is working fine.Sometimes it even doesn't get restarted. Is there any problem with service packs and some performance issues. Can you SQL guru give me best suggestion and how should i proceed.
when i update i want only date portion tp be displayed from datetime datatype... create table temp11 (datecolumn datetime) insert into temp11 values (getdate ()) insert into temp11 values (getdate ()) insert into temp11 values (getdate ()) insert into temp11 values (getdate ())
now when i am running this query,i am getting what i want... select convert (varchar, datecolumn,111) from temp11
but when i am tyring to update in the temp11 table using the below query...
update temp11 set datecolumn = convert (varchar, datecolumn,111)
i am getting date and time as well like... 2008-01-14 00:00:00.000 2008-01-14 00:00:00.000 2008-01-14 00:00:00.000 2008-01-14 00:00:00.000
i only want the date portion in my updated new table..... any suggestions plzzzzzzzzz is it poss thru any sql query???or shud be done in the front end only???
You notice after installing SQL Server 2005 that there is a warning message in the SQL Server log that SQL Server cannot lock pages in memory. What must you do to allow SQL Server to lock memory pages in memory?
After installing SQL Server, your customer complains that transactions are slow. You notice that there is excessive I/O in the TempDb. You want to move TempDb to another set of disks, so you have the sytem administrator configure two more logical disks on the server. What must you do to configure the SQL Server TempDb on this new set of disks?
You are instructed to install SQL Server in an Active / Active cluster environment. What two network related pieces of information must you have prior to performing the installation?
Has anyone faced problems in calling one stored procedure from within another stored procedure ? I am considering using nested SPs, and would appreciate any inputs on it.
Am trying to import XLS data into SQL 2005 SP2 thro a SSIS Data Flow task. My Excel Connection string has IMEX=1, ImportMixedTypes is set to Text and the typeguessrows is set to 0.
Import works fine for cells of Format Text, but when I have a large number (in a general Format cell) it gets converted into scientific notation(e.g. 3.234175e+7) in the table.
Hi. I am trying to figure out the code for sorting a manual (non-identity) number column in my table. the purpose is to show the user's pictures in perfect order (1,2,3,4,5,6...).
The Jist of my problem... When a user first inserts six pictures, he gets:
|1| |2| |3| |4| |5| |6|
All is good. But, say he deletes picture |3|. Now the list order looks like this:
|1| |2| <- |3| is removed |4| |5| |6|
And, then he inserts two more pictures, now he his this:
|1| |2|
|4| |5| |6| |7| <- |7| & |8| are added |8|
What i want to acheive is a "reshuffling" of the number order every time a picture is removed. So, when |3| is removed, |4| becomes |3|, |5| becomes |4| and so on. There should never be a gap in the order.
I am new to stored procedures, and have been trying to figure this out. Below is my guesswork:
BEGIN SELECT @photo_date = CONVERT(DATETIME,convert(char(26), getdate(), 109)) END
BEGIN SET @photo_number = 1 SELECT
@photo_number = ( SELECT COUNT(*) FROM dbo.PersonalPhotos b WHERE a.photo_date < b.photo_date ) FROM dbo.PersonalPhotos a ORDER BY a.photo_date END
BEGIN
My thinking is that it would be a safe bet to use the "photo_date" column as a litmus for my "photo_number" column (ie, the most recent record inserted by the user will always be at a later date than the previously inserted record). So:
I get the below error only when my IDE open. It connects well when it is found closed. [SqlException (0x80131904): Cannot open user default database. Login failed.Login failed for user 'JPASPNET'.] I could solve this by giving the logged in windows user to impersonate under IIS window > WEBSITE > ASP.NET tab > EDIT CONFIG > APPLICATION tab But I wish someone could give me the proper solution. I almost tried all from giving ASPNET user as a administrator to configuring the same in Express management tool. Environment: XP pro, VWD and SQL Express
I got an approach like that: 1) Read something from DB - check the value, if true stop if false go on2) Read the second Value (another SQL Statement) - check the value etc. Now I could open the connection at 1) and if I have to go to 2) I leave the connection open and use the same connection at 2). Is it ok to do that? The other scenario would be opening a connection at 1), immediately close it after I read the value and open a new connection at 2). Thanks for the input!
Post installation of SQL Server 2014 Express edition, I am able to connect to the Database Instance.
But while opening a new query window in SSMS or opening a table getting the error:
Package 'RadLangSvc.Package, RadLangSvc, Version 12.0.0.0, Culture=Neutral, Public Token=89845dcd8080cc91' failed to load
Object reference not set to an instance of an object. (mscorlib)..Have already tried installing the componentsDACProjectSystemSetup_enu.msi, TSql LanguageService_enu.msi, DACFramework_enu.msi from path VS 2010 WCU DAC.
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?
Hello Im trying to open an example RDL file I downloaded..the file type is XML ..when i open it up it contains all XML
How can i view this in GUI format from Visual Studio? It is an example off how to use default 'select all' in multivalued parameters so i assume I can see it working as a project ? Not sure how to use this XML file?
what are all the minimum required permissions to do ddl , dml statements on database. we have so many logins .which and every having sysadmin, i removed sysadmin permission and assign db_owner permission to 7 users and only 3 users having error
cannot open database ' db_nam' requested by login. the login failed. Login failed for user 'ohmvarun1'
Hi all, now, i create a job to open a page on timely basis. The job's Vb script is like that:Dim WshShellSet WshShell =CreateObject("WScript.Shell")WshShell.Run ("http://www.google.com")Set WsShell = Nothing when i run that job, i got that error:The job succeeded. The Job was invoked by User hostusername. The last step to run was step 1 (Step 1). how can i solve it? i still don't know whether that script will open a webpage or not
Hello everybody I would like to know more about the number of possible connection to a sql server is it by pool ? or there is max for all the database ? all the server ? how I can get the number of connection open ? Thx in advance
When I try to open a .MDF file with SQL Server Management Studio Express last version I get an error : There is no editor available for "DATABASE.MDF" Make sure the application for the file type (.MDF) is installed. How can I open the MDF file.I tried to use also the database NORTHWIND.MDF provided with MSSQL 2000 sample but the same error. What can I do ? I am using Microsoft SQL Server 2005 Express. I want to open the .MDF file to create a index for Full Text Search. Thank You !
"There is already an open datareader associated with this command which must be closed first." I have received this same error before, but I'm not sure why I'm getting it here.'Create a Connection object. MyConnection = New SqlConnection("...............................")
'Check whether a TMPTABLE_QUERY stored procedure already exists. MyCommand = New SqlCommand("...", MyConnection)
With MyCommand 'Set the command type that you will run. .CommandType = CommandType.Text
'Open the connection. .Connection.Open()
'Run the SQL statement, and then get the returned rows to the DataReader. MyDataReader = .ExecuteReader()
'Try to create the stored procedure only if it does not exist. If Not MyDataReader.Read() Then .CommandText = "create procedure tmptable_query as select * from #temp_table"
MyDataReader.Close() .ExecuteNonQuery() Else MyDataReader.Close() End If
.Dispose() 'Dispose of the Command object. MyConnection.Close() 'Close the connection. End With As you can see, the connection is opened and closed, and the datareader is closed. Here's what comes next...'Create another Connection object. ESOConnection = New SqlConnection("...")
If tx_lastname.Text <> "" Then If (InStr(sqlwhere, "where")) Then sqlwhere = sqlwhere & " AND lname like '" & Replace(tx_lastname.Text, "'", "''") & "%'" Else sqlwhere = " where lname like '" & Replace(tx_lastname.Text, "'", "''") & "%'" End If End If If tx_firstname.Text <> "" Then If (InStr(sqlwhere, "where")) Then sqlwhere = sqlwhere & " AND fname like '" & Replace(tx_firstname.Text, "'", "''") & "%'" Else sqlwhere = " where fname like '" & Replace(tx_firstname.Text, "'", "''") & "%'" End If End If
dynamic_con = sqlwhere & " order by arr_date desc "
'create the temporary table on esosql. CreateCommand = New SqlCommand("CREATE TABLE #TEMP_TABLE (".............", ESOConnection)
With CreateCommand 'Set the command type that you will run. .CommandType = CommandType.Text
'Open the connection to betaserv. ESOConnection.Open()
'Run the SQL statement. .ExecuteNonQuery()
End With
'query our side ESOCommand = New SqlCommand("SELECT * FROM [arrest_index]" & dynamic_con, ESOConnection)
'loop through recordset and populate temp table While ESODataReader.Read()
MyInsert = New SqlCommand("INSERT INTO #TEMP_TABLE VALUES("......", ESOConnection)
'Set the command type that you will run. MyInsert.CommandType = CommandType.Text
'Run the SQL statement. MyInsert.ExecuteNonQuery()
End While
ESODataReader.Close() 'Create a DataAdapter, and then provide the name of the stored procedure. MyDataAdapter = New SqlDataAdapter("TMPTABLE_QUERY", ESOConnection)
'Set the command type as StoredProcedure. MyDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure
'Create a new DataSet to hold the records and fill it with the rows returned from stored procedure. DS = New DataSet() MyDataAdapter.Fill(DS, "arrindex")
'Assign the recordset to the gridview and bind it. If DS.Tables(0).Rows.Count > 0 Then GridView1.DataSource = DS GridView1.DataBind() End If
'Dispose of the DataAdapter MyDataAdapter.Dispose()
'Close server connection ESOConnection.Close() Again, a separate connection is open and closed.I've read you can only have 1 datareader available per connection. Isn't that what I have here? The error is returned on this line: MyInsert.ExecuteNonQuery() Help is appreciated.
Hi Forum, I dont have a lot of experience with SQL and have a problem running .sql file. I use VWD 2005 ex and SQL server 22005 ex Im following some instructions to create the .mdf database I need for API. Step one; was to create a blank .mdf, which ive done! Step two; Create the Tables and Stored Procs. Tables and stored procs are defined in two script files CreateTables.sql and CreateStoredProcs.sql within Database folder. Run CreateTables.sql first
How do I open and run the .sql files in VWD 05? many thnaks Paul
Can't open Northwind - asp.net - dataaccess-sqldatasource
I remembered doing walkthrough using Northwind. However it wasn't an http project but a file project using the development server. Northwind allowed me to add, edit and insert, and the web page looked fine. I opened a simple project just to see whether I could get my sqlserver on the internet. (vs studio 2005, sqlserver 2005) I created the project in http location http://localhost/Northwind . I dragged a sqldatasource to the page, configuring it to display ID and ProductName. I clicked advanced, but noticed the generate insert, edit and delete were grayed out. That told me something was wrong with my authetification. I configured my sqlserver 2005 to have integrated security. I built the solution and website, then pressed cntl-F5. I got a login error. Nowhere did the page ask me for username and password. First questions - how do I get this to open up a web page, and how to I get it to allow me to generate insert, edit and delete statements? dennist685 Server Error in '/Northwind' Application.-------------------------------------------------------------------------------- Cannot open database "Northwind" requested by the login. The login failed.Login failed for user 'YOUR-02910F1DF1ASPNET'. 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.Data.SqlClient.SqlException: Cannot open database "Northwind" requested by the login. The login failed.Login failed for user 'YOUR-02910F1DF1ASPNET'. 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: [SqlException (0x80131904): Cannot open database "Northwind" requested by the login. The login failed.Login failed for user 'YOUR-02910F1DF1ASPNET'.] System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +735123 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188 System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1838 System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +33 System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +628 System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +170 System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +359 System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28 System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +424 System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66 System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +496 System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +82 System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105 System.Data.SqlClient.SqlConnection.Open() +111 System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +121 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +137 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +83 System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1770 System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +17 System.Web.UI.WebControls.DataBoundControl.PerformSelect() +149 System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70 System.Web.UI.WebControls.DetailsView.DataBind() +4 System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82 System.Web.UI.WebControls.DetailsView.EnsureDataBound() +181 System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +69 System.Web.UI.Control.EnsureChildControls() +87 System.Web.UI.Control.PreRenderRecursiveInternal() +41 System.Web.UI.Control.PreRenderRecursiveInternal() +161 System.Web.UI.Control.PreRenderRecursiveInternal() +161 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360
I set up SQL Server 7 desktop, sp3 on my laptop, but get the following error each time I try to use the Open Table item on the popup menu in Enterprise Manager:
The query cannot be executed because some files are either missing or not registered. Run setup again to make sure all required files are registered.
Re-running setup does nothing, and an uninstall and re- install didn't fix the problem either.
I can't count the number of times I've set up SQL7 in the past, and I never had this error before.
The PC is running Win2K Pro and has Office XP, and ColdFusion 4.5a installed.
We installed an aplication written by us in VB5 and Sql 7.0 in one of our customers site.
The customer is telling us that we left "open conections" when our program finishes.
I want to check in our server, testing our programs, which, where and how many conections we open and which are those we left opened.
We look with the Server Enterprice Manager in the Managment under currect activity, but we don't know how to interpret the data there, and we don't know how to see wich are the conections we left opened.