When I check the log from EM. It sows that it is full. I increased the size of the log(expand) and still not work. I dumped the transaction logs with nolog option this also does not work. Then I run
dbcc checktable(syslogs) and still it is showing the same. When I ran the DBCC
I got the follwing message.
" Checking syslogs
The total number of data pages in this table is 1.
*** NOTICE: Notification of log space used/free cannot be reported because the log segment is not on its own device.
Table has 18 data rows.
DBCC execution completed. If DBCC printed error messages, see your System Administrator "
Any idea how I can overcome this problem. My sql server version is 6.5.
Also in the message what is the mean that log segment is not on ots own device.
In SSIS, I put a File System Task in a Foreach Loop Container to do some file operation. I check the Traverse Subfolders in the Loop, and I want to take a look the full path name during operation. I'd like to show the full path name on a message box? How should I do?
1. I downloaded ChartFXRSTrial and created one chart, and able to deploy it in ReportServer, but the problem is the reports are not showing there, i checked the configuration of .dll files in the help provided by chartFX, but couldn't get anything, so could help me on this.
2. How to give Tooltip for the X- axis or Y- axis values in the ReportServer , i tried using chartproperties of .rdl file, but didnt understand it. can help me on this, and one more i tried with Dundas too, If im giving tooltip as #valy then, it is showing samething in reportserver instead the values of 'Y-axis'.
Hello all, I am making an auction system using C#, .NET and MS SQL Server. I have a page to add new products to DB, which works fine.
What I like to have is that, I want to be able to show friendly confirmation and error messages to users.
So it is going to work like this: - user adds a new product - if successful there is a message on the page that reads: The products (product name) was successfully added to the database. And form fields are clear, ready for the next product info to be entered. - if not successful, the message should tell the user and maybe indicates the reason too. Like: the product code used already exists.
Currently for the successful attempts I get the form page with all the fields filled with the entered data and for un-successful one the ASP.NET error page.
Can anybody help please? Does anybody knows about a tutorial or an article or ...?
After some of the recent discussions on Index fragmentation I've produced this code to do a show contig on all the tables in a specific database on SQL Server 7.
It can probably be made more generic for those interested
CREATE PROCEDURE dbo.sproc_SHOWCONTIG AS CREATE TABLE #Tables ( Table_ID INT IDENTITY(1, 1) NOT NULL, TableName SYSNAME NOT NULL )
-- Put all the (user) table names into at temporary table - in order so that the output is in order INSERT INTO #Tables (TableName) SELECT NAME FROM Shire2.dbo.sysobjects where type = 'U' order by NAME
DECLARE @Current as SYSNAME --DECLARE @SQL as nvarchar(4000) DECLARE @ID int
WHILE EXISTS (SELECT 1 FROM #Tables) BEGIN --print 'in BEGIN' -- get current table into a variable name SET @CURRENT = (SELECT TOP 1 TableName FROM #Tables) --print 'Current = ' + @current SET @ID = OBJECT_ID(@CURRENT) DBCC SHOWCONTIG (@ID) --EXEC sp_executesql @SQL DELETE FROM #Tables WHERE TableName = @CURRENT END
I have installed default instance of SQLServer 2005 DE on Windows Server 2003 host. I also installed a named instance of MSDE rel A. I can connect to the MSDE instance from Management Studio but it does not appear in the list of servers when I try to add the connection in VS2005 server explorer. What am I doing wrong?
I have sql server 2000. I copied a database from one server to another. I have one table that has a full-text index. When I transferred over the database, the index still existed, but was not populated. I made sure the path for the file is pointing to a new correct location. I did "start full population". It only populated one entry @ 1MB. On the old server the index is 100MB with more than 3 million records.
I tried rebuilding, re-creating, and it all works, but when I run "start full population", it only populates 1 record. I double checked the table in question and it has over 3 million records and proper primary key.
I have a document that is stored in SQL DB - DBname (doctest.mdf)- Table name(Documents)- Column names(ID, LINK, Content, Adddate, FileType). The doc is named Showme.doc What I'm trying to do is I have a listview that is linked to the DB. The columns of the listview show LINK and Adddate. The LINK column is a hyperlink. When the page is loaded the list view shows the info in the DB. The link is a hyperlink so that when I place my cursor over the link it is clickable. Now how do I make it so that when the user clicks on the LINK the document is retrieved and opened? I uploaded the document with the fileupload control. If FileUpload1.HasFile Then Using reader As New BinaryReader(FileUpload1.PostedFile.InputStream) Dim btcontent As Byte() = reader.ReadBytes(FileUpload1.PostedFile.ContentLength) cmd3.Parameters.Add("@CONTENT", SqlDbType.VarBinary).Value = btcontent End Using end if I would be thankful for help. Thanks, Ty
Hi, I need to make the format by pulling the number from a table from sql server 7.0 and show the result in a table and have the following format $120,534.45 is that possible.
I have a sql query that gets the count of exams held in each month.
Below is the code that I have used.
select Examid, count(*) as CumCount from [dbo].[Exams] where ExamCategory in ('Major','Critical') and Month(EXOCCRDATE) = Month(getdate()) and Year(EXOCCRDATE) = Year(getdate()) group by Examid
The code works good when we have data for the current month. When we dont have any exams for the current month, the code outputs empty values. I want the code to be altered so that when there is no value returned in the output, i want a default value shown in the output.
I have attached the sample data that I am using. In the data we dont have dates for the month of October. So when I run the code it will display empty output. So what I need is I need a text like 'No Data' to be shown when no value is returned by the query.
write a query that lists item, mfg serial number, and inspection date. The caveat is that, where there is more than one record for an item, he only wants item listed once. For example:
I have a query below to show all the records with joining these two tables.
SELECT DISTINCT B.BF_ORGN_CD, B.LEV5, A.BF_ACTY_CD FROM BF_ORGN A INNER JOIN BF_ORGN_CNSL_TBL B ON A.CD=B.BF_ORGN_CD WHERE A.BF_ACTY_CD IS NOT NULL ORDER BY B.BF_ORGN_CD,A.BF_ACTY_CD
My goal is only to show all the duplicate records.
Bf_ORGN_CD LEV5 BF_ACTY_CD AC_21234_2 AC_21200_1 402 AC_21236_2 AC_21200_1 402 AC_21238_2 AC_21200_1 402 AC_29000_1 AC_29000_1 802 ---> NOT SHOW (ONLY 1 RECORD) AC_29988_1 AC_29988_1 801 ---> NOT SHOW (ONLY 1 RECORD)
I have a table with some rows and columns what i want is i want to Show sum of particular column in the last row. This is my code.
SELECT DISTINCT Cluster.ClusterName, Gruppe.GruppeName, Arbeitspaket.ArbeitspaketName, BMWProjekt, AnzahlAP, Abgerechnet, InBearbeitung, Billanz FROM Bestellung INNER JOIN Cluster ON Bestellung.Cluster = Cluster.rowid INNER JOIN Arbeitspaket ON Bestellung.Arbeitspaket = Arbeitspaket.rowid INNER JOIN Gruppe ON Bestellung.Gruppe = Gruppe.rowid WHERE Projekt ="EA-284-Nxx" AND AnzahlAP <> 0 AND Abgerechnet is 1 AND InBearbeitung is NULL AND Billanz is NULL;
I have setup ssl encryption for SQL connections by using a self-signed certificate (not the best I know) and setting "Force Encryption" to Yes. Now I am trying to show that the connection is indeed encrypted and I like to see which the ssl-key is used for a connection; preferably the one that I provided. How can I do this? I am just not comfortable trusting the OS or SQL to do what I ask.The query "SELECT encrypt_option FROM sys.dm_exec_connections" Shows incrypted but no extra info.
I made a select query which shows following output as shown in picture .
Now I want to add one more column in this query to show current bags and Bags in these 2 columns i want to show calculation like in first rows currentbags column (Receivedbags-DeleiveredBags) and in currentWeight column RecivedWeight+loss-gain-Deliverdweight) which is 1400 and 697.5 after that in secound row i want to add frist rows currentbags value+ second rows (Receivedbags-DeleiveredBags) and same in weight like daily stock register so output looked like below image
There is one more column common date according to which i have to make calculation like
rid commondate recdate recbags recweight loss gain delbags delwght
When I create a Smart Device project and and try to add a reference to SQL Server CE only the old version (3.0.3600.0) shows up. How do I get the new one (3.1) to show up?
I have tried to convert my SQL Server Express Database file to SQL Server Compact Edition database file and it successfully. But I have some problem with the FK, I could not see the FK symbol in my new SQL Server Compact Edition database file. So i tried another method to implement the FK which is this code of line here
The second method also has no error but I could not see any FK show. Does anyone has this problem? Any suggestion to solve it? Please do share with me.
Thanks,
Bombie
ps: I attached to sreen shots of my DB, 1 is (SQL Express DB) and another is SQL Compact DB.
Hi, I'm new around here and am stumped. I have created a form where I submit the information into a SQL Server 2000 table. When I submit the information through the form, only the first character of each field populates inside of the SQL table. This happens for every field except for two, zip and comments. The zip field is numeric and the comments field is text. All the other fields are varchar fields; and these are the fields with the problems. I have attempted to change the data type to text, but that did not work either. I am doing this through a stored procedure I created. Here is the asp code: Public Class WebForm1 Inherits System.Web.UI.Page Protected WithEvents txtFirstName As System.Web.UI.WebControls.TextBox Protected WithEvents txtLastName As System.Web.UI.WebControls.TextBox Protected WithEvents txtAddress1 As System.Web.UI.WebControls.TextBox Protected WithEvents txtAddress2 As System.Web.UI.WebControls.TextBox Protected WithEvents txtCity As System.Web.UI.WebControls.TextBox Protected WithEvents txtZip As System.Web.UI.WebControls.TextBox Protected WithEvents txtEmail As System.Web.UI.WebControls.TextBox Protected WithEvents txtPhone As System.Web.UI.WebControls.TextBox Protected WithEvents txtComments As System.Web.UI.WebControls.TextBox Protected WithEvents ddlState As System.Web.UI.WebControls.DropDownList Protected WithEvents ddlGift1 As System.Web.UI.WebControls.DropDownList Protected WithEvents ddlGift2 As System.Web.UI.WebControls.DropDownList Protected WithEvents ddlGift3 As System.Web.UI.WebControls.DropDownList Protected WithEvents Form1 As System.Web.UI.HtmlControls.HtmlForm Protected WithEvents SqlConnection1 As System.Data.SqlClient.SqlConnection Protected WithEvents SqlCommand1 As System.Data.SqlClient.SqlCommand Protected WithEvents btnSubmit As System.Web.UI.WebControls.Button #Region " Web Form Designer Generated Code " 'This call is required by the Web Form Designer. <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent() Me.SqlConnection1 = New System.Data.SqlClient.SqlConnection() Me.SqlCommand1 = New System.Data.SqlClient.SqlCommand() ' 'SqlConnection1 ' Me.SqlConnection1.ConnectionString = "data source=NDAVENPORT2;initial catalog=Bluestreak;integrated security=SSPI;persi" & _ "st security info=False;workstation id=NDAVENPORT2;packet size=4096" ' 'SqlCommand1 ' Me.SqlCommand1.CommandText = "dbo.[InsertFreeOrders]" Me.SqlCommand1.CommandType = System.Data.CommandType.StoredProcedure Me.SqlCommand1.Connection = Me.SqlConnection1 Me.SqlCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, False, CType(10, Byte), CType(0, Byte), "", System.Data.DataRowVersion.Current, Nothing)) Me.SqlCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@firstname", System.Data.SqlDbType.VarChar, 50)) Me.SqlCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@lastname", System.Data.SqlDbType.VarChar, 50)) Me.SqlCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@address1", System.Data.SqlDbType.VarChar, 100)) Me.SqlCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@address2", System.Data.SqlDbType.VarChar, 100)) Me.SqlCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@city", System.Data.SqlDbType.VarChar, 50)) Me.SqlCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@state", System.Data.SqlDbType.VarChar, 50)) Me.SqlCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@zip", System.Data.SqlDbType.Decimal, 9, System.Data.ParameterDirection.Input, False, CType(18, Byte), CType(0, Byte), "", System.Data.DataRowVersion.Current, Nothing)) Me.SqlCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@email", System.Data.SqlDbType.VarChar, 50)) Me.SqlCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@phone", System.Data.SqlDbType.VarChar, 50)) Me.SqlCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@item1", System.Data.SqlDbType.VarChar, 50)) Me.SqlCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@item2", System.Data.SqlDbType.VarChar, 50)) Me.SqlCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@item3", System.Data.SqlDbType.VarChar, 50)) Me.SqlCommand1.Parameters.Add(New System.Data.SqlClient.SqlParameter("@comments", System.Data.SqlDbType.VarChar, 2147483647)) End Sub Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init 'CODEGEN: This method call is required by the Web Form Designer 'Do not modify it using the code editor. InitializeComponent() End Sub #End Region Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'Put user code to initialize the page here End Sub Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSubmit.Click If IsValid Then SqlCommand1.Parameters("@firstname").Value = txtFirstName.Text SqlCommand1.Parameters("@lastname").Value = txtLastName.Text SqlCommand1.Parameters("@address1").Value = txtAddress1.Text SqlCommand1.Parameters("@address2").Value = txtAddress2.Text SqlCommand1.Parameters("@city").Value = txtCity.Text SqlCommand1.Parameters("@state").Value = ddlState.SelectedItem.Text SqlCommand1.Parameters("@zip").Value = txtZip.Text SqlCommand1.Parameters("@email").Value = txtEmail.Text SqlCommand1.Parameters("@phone").Value = txtPhone.Text SqlCommand1.Parameters("@item1").Value = ddlGift1.SelectedItem.Text SqlCommand1.Parameters("@item2").Value = ddlGift2.SelectedItem.Text SqlCommand1.Parameters("@item3").Value = ddlGift3.SelectedItem.Text SqlCommand1.Parameters("@comments").Value = txtComments.Text SqlConnection1.Open() SqlCommand1.ExecuteNonQuery() SqlConnection1.Close() Response.Redirect("Success.aspx") End If End Sub End ClassMy stored procedure looks like this:CREATE PROCEDURE dbo.InsertFreeOrders ( @firstname varchar( 50 ), @lastname varchar( 50 ), @address1 varchar( 100 ), @address2 varchar( 100 ), @city varchar( 50 ), @state varchar( 50 ), @zip numeric, @email varchar( 50 ), @phone varchar( 50 ), @item1 varchar( 50 ), @item2 varchar( 50 ), @item3 varchar( 50 ), @comments text )ASInsert FreeOrders ( o_first_name, o_last_name, o_address_1, o_address_2, o_city, o_state, o_zip, o_email, o_phone, o_item_1, o_item_2, o_item_3, o_comments ) Values ( @firstname, @lastname, @address1, @address2, @city, @state, @zip, @email, @phone, @item1, @item2, @item3, @comments )GOSo it is working, just not completely and I am stumped here. Any help would be great! Thanks.
In Query Analyzer I could go to the Query menu and select Show ServerTrace and it would give me trace information with duration, CPU, Readsand Writes cost. I have been using SQL Server 2005 for a couple monthsnow and I can't seem to find that option in SQL Management Studio. Am Imissing something?Jason
I'm getting the error message "The parameter is incorrect" when I'm trying to perform "Show Table Data" from the SQL Server Compact Edition" within VS 2008. Any ideas? Thank you in advance, .
I have a windows 8 pc that I just got and installed sqlexpress 2014. My buddy haw windows 7 and installed sqlexpress on his pc. We create a db on his pc, did a backup, copied the backup to my pc. In ssms I right click on "database" > restore database. click device and the button to find my file. I navigate to the folder where the file shows in file explorer but the .bak file does not show in ssms to restore from. This is probably a windows thing but I have don't know what to look at.
I am trying to print Companies with less than 100 employees for all dates.Here's my table structure
Create table CompanyEmployeeArchive( Company varchar(100) not null, Employees int, Dateinserted date)
Insert into CompanyEmployeeArchive values('Microsoft',1001,'2015-01-01') Insert into CompanyEmployeeArchive values('Microsoft',1050,'2015-02-01') Insert into CompanyEmployeeArchive values('Microsoft',1600,'2015-03-01') Insert into CompanyEmployeeArchive values('IBM',10,'2015-01-01') Insert into CompanyEmployeeArchive values('IBM',80,'2015-02-01') Insert into CompanyEmployeeArchive values('Apple',90,'2015-01-01') Insert into CompanyEmployeeArchive values('Apple',900,'2015-02-01') Insert into CompanyEmployeeArchive values('Apple',1000,'2015-03-01')
I want companies that have employees less than 100 for all dates i.e. Only IBM. Apple has < 100 employees only on one month.Select Company, dateinserted, employees from CompanyEmployeeArchive group by company,dateinserted,employees having employees < 100 order by company, dateinserted this query lists Apple too. How can I change the query so Apple does not show up in the list.
well as you can see from my thread SQLServer is new to me i am used to mysql and i c'ant find the equivalent anywhere on the net... Seams easy enough but i have been at it for 6 hrs and i give up... I am just making a quick database view tool. So please tell me.
How do i load the all tables of a database via an sql command?
Since it took me a while to find this i thought migth as well slap ip somewhere so here is the command to load all data bases... In any case worked for me so...
- > select * from master.dbo.sysdatabases;
And where in the ... can you find a reference to all sql server commands? ... Please.
There are many duplicate records on my data table because users constantly register under two accounts. I have a query that identify the records that have a duplicate, but it only shows one of the two records, and I need to show the two records so that I can reconcile the differences.The query is taken from a post on stack overflow. It gives me 196, but I need to see the 392 records.
How to identify the duplicates and show the tow records without having to hard code any values, so I can use the query in a report, and anytime there are new duplicates, the report shows them.