All I Wanted Was To Submit Customers Info To My Emailbox
Jan 28, 2008
I have created an order form for my business. I placed a submit button at the bottom. I wanted all the clients information to go into my emailbox. Someone told me about MS SQL Server. I got excited and downloaded the 2005 Express version with all the trimmings. Now I am more confused than I was before. Someone please explain to me what I should do first. Redo the form with the studio then work with the server? I think I may have deleted something important from the server trying to figure it out. Help!!!!!!!!!!
View 7 Replies
ADVERTISEMENT
Aug 26, 2004
Hi
I have a table called tblsample, where i have information stored row wise. Ther four quarter information is stored for many years. I want those information column wise for a given year.
say
select col1, col2 from tblsample where rqtr=1 and ryear = 2000
select col1, col2 from tblsample where rqtr=2 and ryear = 2000
select col1, col2 from tblsample where rqtr=3 and ryear = 2000
select col1, col2 from tblsample where rqtr=4 and ryear = 2000
i want information like
for the Year 2000
1 qtr 2 qtr 3 qtr 4 qtr
How to acheive this in MSSQL 2000
View 3 Replies
View Related
Oct 6, 2011
I have a list of customers in my Customers table. What I am looking to do is to create QR codes for each customer in Reporting Services. I need to include the customer name, address, postcode, telephone number and contact name.
View 5 Replies
View Related
Dec 6, 2006
Hi I am totally new programing and thought I would try my hands on ASP.NET 2.0. I created a web form that would take user information and submit it to a SQL database. However I am not sure how to properly setup the SQL connection. What am I doing wrong?default.aspx.cs:using System;using System.Data;using System.Configuration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;public partial class _Default : System.Web.UI.Page{ protected void MultiView1_ActiveViewChanged(object sender, EventArgs e) { } protected void Button1_Click1(object sender, EventArgs e) { String ConnStr = "Data Source=TECATE;Initial Catalog=subscribe_mainSQL;Integrated Security=True"; String SQL = "Insert into main (email,fname,lname,userid,status) values ('" + email.Text + "', " + fname.Text + "','" + lname.Text + "','" + userid.Text + "','" + degree.SelectedItem.Value + "')"; }} default.aspx:<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" EnableSessionState="True" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server"> <title>Email Sign Up Page</title></head><body style="text-align: center"> <form id="form1" runat="server"> <asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0" OnActiveViewChanged="MultiView1_ActiveViewChanged"> <asp:View ID="signup" runat="server"> <br /> <table style="background-color: #f0f0f0" width="450"> <tr> <td style="width: 18px; height: 23px"> </td> <td style="font-weight: bold; font-size: medium; width: 383px; color: black; font-family: verdana; height: 23px"> Email Subcribe System</td> <td style="width: 19px; height: 23px"> </td> </tr> </table> <table style="color: white; font-family: verdana; background-color: #5d7b9d" width="450"> <tr> <td style="width: 19px; height: 20px"> </td> <td align="center" style="width: 153px; height: 20px"> </td> <td align="left" style="width: 18px; height: 20px"> </td> <td style="width: 115px; height: 20px"> </td> </tr> <tr> <td style="width: 19px"> </td> <td align="left" style="width: 153px"> <asp:Label ID="Label1" runat="server" Font-Names="Verdana" Font-Size="X-Small" Text="First Name:"></asp:Label></td> <td align="left" style="width: 18px"> </td> <td align="left" style="width: 115px"> <asp:Label ID="Label2" runat="server" Font-Names="Verdana" Font-Size="X-Small" Text="Last Name:"></asp:Label></td> </tr> <tr> <td style="width: 19px; height: 26px"> <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="fname" ErrorMessage="*" ForeColor="White"></asp:RequiredFieldValidator></td> <td align="left" style="width: 153px; height: 26px"> <asp:TextBox ID="fname" runat="server" MaxLength="20"></asp:TextBox></td> <td align="left" style="width: 18px; height: 26px"> <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="lname" ErrorMessage="*" ForeColor="White"></asp:RequiredFieldValidator></td> <td align="left" style="width: 115px; height: 26px"> <asp:TextBox ID="lname" runat="server" MaxLength="20"></asp:TextBox></td> </tr> <tr> <td style="width: 19px; height: 9px"> </td> <td align="left" style="width: 153px; height: 9px"> <asp:Label ID="Label3" runat="server" Font-Names="Verdana" Font-Size="X-Small" Text="10 Digit USC ID:"></asp:Label></td> <td align="left" style="width: 18px; height: 9px"> </td> <td align="left" style="width: 115px; height: 9px"> <asp:Label ID="Label4" runat="server" Font-Names="Verdana" Font-Size="X-Small" Text="USC Email:"></asp:Label></td> </tr> <tr> <td style="width: 19px"> <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="uscid" ErrorMessage="*" ForeColor="White"></asp:RequiredFieldValidator></td> <td align="left" style="width: 153px"> <asp:TextBox ID="uscid" runat="server" MaxLength="10"></asp:TextBox></td> <td align="left" style="width: 18px"> <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="email" ErrorMessage="*" ForeColor="White"></asp:RequiredFieldValidator></td> <td align="left" style="width: 115px"> <asp:TextBox ID="email" runat="server"></asp:TextBox></td> </tr> <tr> <td style="width: 19px"> </td> <td align="left" style="width: 153px"> <asp:Label ID="Label5" runat="server" Font-Names="Verdana" Font-Size="X-Small" Text="Degree Status:"></asp:Label></td> <td align="left" style="width: 18px"> </td> <td align="left" style="width: 115px"> <asp:Label ID="Label6" runat="server" Font-Names="Verdana" Font-Size="X-Small" Text="Confirm USC Email:"></asp:Label></td> </tr> <tr> <td style="width: 19px"> <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="degree" ErrorMessage="*" ForeColor="White"></asp:RequiredFieldValidator></td> <td align="left" style="width: 153px"> <asp:DropDownList ID="degree" runat="server"> <asp:ListItem></asp:ListItem> <asp:ListItem>Undergraduate</asp:ListItem> <asp:ListItem>Graduate</asp:ListItem> <asp:ListItem Value="PhD">Ph.D</asp:ListItem> </asp:DropDownList> </td> <td align="left" style="width: 18px"> </td> <td align="left" style="width: 115px"> <asp:TextBox ID="confirmemail" runat="server"></asp:TextBox></td> </tr> <tr> <td style="width: 19px; height: 21px"> </td> <td align="left" style="width: 153px; height: 21px"> </td> <td align="left" style="width: 18px; height: 21px"> </td> <td align="right" style="width: 115px; height: 21px"> </td> </tr> <tr> <td style="width: 19px; height: 21px"> </td> <td align="left" style="width: 153px; height: 21px"> <br /> <asp:CompareValidator ID="CompareValidator1" runat="server" ControlToCompare="email" ControlToValidate="confirmemail" ErrorMessage="*Emails Do Not Match" Font-Names="Verdana" Font-Size="X-Small" ForeColor="White"></asp:CompareValidator> </td> <td align="left" style="width: 18px; height: 21px"> </td> <td align="right" style="width: 115px; height: 21px"> <asp:Button ID="Button1" runat="server" CommandName="NextView" Font-Bold="True" Font-Names="Verdana" Font-Size="Small" OnClick="Button1_Click1" Text="Submit" /></td> </tr> </table> <div align="center"> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConflictDetection="CompareAllValues" ConnectionString="<%$ ConnectionStrings:subscribe_mainSQLConnectionString %>" InsertCommand="INSERT INTO [main] (, [uscid], [fname], [lname], [degree]) VALUES (@email, @uscid, @fname, @lname, @degree)" OldValuesParameterFormatString="original_{0}" SelectCommand=" WHERE = @original_email AND [uscid] = @original_uscid AND [fname] = @original_fname AND [lname] = @original_lname AND [degree] = @original_degree"> <InsertParameters> <asp:Parameter Name="email" Type="String" /> <asp:Parameter Name="uscid" Type="String" /> <asp:Parameter Name="fname" Type="String" /> <asp:Parameter Name="lname" Type="String" /> <asp:Parameter Name="degree" Type="String" /> </InsertParameters> </asp:SqlDataSource> </div> </asp:View> <asp:View ID="thankyou" runat="server"> <br /> <table style="background-color: #f0f0f0" width="450"> <tr> <td style="width: 18px; height: 23px"> </td> <td style="font-weight: bold; font-size: medium; width: 383px; color: black; font-family: verdana; height: 23px"> Email Subcribe System</td> <td style="width: 19px; height: 23px"> </td> </tr> </table> <div align="center"> <br /> <br /> <br /> <asp:Label ID="Label7" runat="server" Font-Bold="True" Font-Names="Verdana" Font-Size="Small" Text="Thank you for registering."></asp:Label> </div> </asp:View> </asp:MultiView><div align="center"> </div> </form></body></html>
View 6 Replies
View Related
May 7, 2007
I want to be able to see when records have been added to a table. The issue is we have a DTS job scheduled to run every night. The developer who wrote it password protected it and doesn't work here anymore. I want to add a step to this series of DTS jobs and want to run it just prior to his job. Is there a way to see when the records are being added or when this job is being run? Thanks again, you guys are the best.
ddave
View 3 Replies
View Related
Mar 8, 2007
Hi
I am trying to create a Quiz system and i need to put the user's Unique ID in the Result Data Table, so that the when they submit there results it puts there Unique ID by the side so that they can view it in there profile, and not anyone elses.
Thanks
Gareth Cork
View 1 Replies
View Related
Jun 20, 2008
Is it possible to submit a existing sql-server job from web page by using C#.
View 2 Replies
View Related
Feb 3, 2004
I have a registration form, and upon the user clicking the submit button, I want the information to be processed and sent to my SQL database. Each textbox (i.e. username, password, email address) has a corresponding field in a table in the database.
How can I accomplish this? I under stand that I will need an onclick event handler.
View 1 Replies
View Related
Dec 7, 2005
Old Frontpage user here... I need to submit a form to a database, like in Frontpage and store the database on the web server.
How do I accomplish this with Visual Studio Express...is there a ASP.NET component or do I need to code it?
Many Thanks,
Jake
p.s. my ASP.NET 2.0 books are coming for Christmas!
View 1 Replies
View Related
Dec 25, 2002
I need to have an way to automatically submit a sql query in Sql
2000 - the query joins several lables and exports the info to a file.
Right now I've been doing it interactively in Query analyzer and
using the export to option... I can't use DTS (query way too
complicated!) and the file created is >255 lrecl so that seems to be
a big problem too!
Any suggestions? Save me from this same predicament on New Years Day!
Thanks and Happy Holidays! :(
View 1 Replies
View Related
Feb 27, 2008
Hi there, i have written a page and for a long time it worked (or so i thought) now all of a sudden it dosnt. I have gone right back to basics and tried to only insert one variable, tried using a text box, a string pre populated, or a string populated by the text box - nothing seems to work. However if i hard code in the thing that i want, even into the SQL or into my param it works, whats going on! i think my programming skills are letting me down here!
here is what i am trying to use (as you can see i have commented out all that i was using to get back to basics)
Are there any pointers?SqlConnection objConnAddStock = new SqlConnection(sAddStock);
//This is the sql statement.
int intUpdateQSStockID = Convert.ToInt32(Request.QueryString["qsStockID"]);
string strCondition;strCondition = "Brand New 12";using (objConnAddStock)
{
objConnAddStock.Open();string sqlAddStock = "UPDATE tbl_stock SET condition = @condition WHERE stock_id = " + intUpdateQSStockID;
/*cat_id = @cat_id, sub_cat_id = @sub_cat_id, n_or_sh = @n_or_sh, " +
"description = @description, size = @size, colour = @colour, cost_price = @cost_price, " +
"selling_price = @selling_price, condition = @condition, notes = @notes, " +
"buying_in_recipt = @buying_in_recipt, visible = @visible, picture1 = @picture1, " +
"picture2 = @picture2, [picture3] = @picture3, picture4 = @picture4, " +
"picture1_thumb = @picture1_thumb, picture2_thumb = @picture2_thumb, " +
"picture3_thumb =@picture3_thumb, picture4_thumb = @picture4_thumb, title = @title, " +
"display_price = @display_price WHERE Stock_id = " + intUpdateQSStockID;*/
SqlCommand objCmdAddStock = new SqlCommand(sqlAddStock, objConnAddStock);
objCmdAddStock.Parameters.AddWithValue("@condition", conditionTextBox.Text);/* objCmdAddStock.Parameters.AddWithValue("@cat_id", DropDownList2.SelectedValue);
objCmdAddStock.Parameters.AddWithValue("@sub_cat_id", DropDownList1.SelectedValue);
objCmdAddStock.Parameters.AddWithValue("@n_or_sh", n_or_shTextBox.Text);
objCmdAddStock.Parameters.AddWithValue("@description", txtDescription.Text);
objCmdAddStock.Parameters.AddWithValue("@size", sizeTextBox.Text);
objCmdAddStock.Parameters.AddWithValue("@colour", colourTextBox.Text);
objCmdAddStock.Parameters.AddWithValue("@cost_price", cost_priceTextBox.Text);
objCmdAddStock.Parameters.AddWithValue("@selling_price", selling_priceTextBox.Text);
objCmdAddStock.Parameters.AddWithValue("@condition", conditionTextBox.Text);
objCmdAddStock.Parameters.AddWithValue("@notes", notesTextBox.Text);
objCmdAddStock.Parameters.AddWithValue("@buying_in_recipt", TextBox3.Text);
objCmdAddStock.Parameters.AddWithValue("@visible", DropDownList4.SelectedValue);
objCmdAddStock.Parameters.AddWithValue("@picture1", txtPicture1.Text);
objCmdAddStock.Parameters.AddWithValue("@picture2", txtPicture2.Text);
objCmdAddStock.Parameters.AddWithValue("@picture3", txtPicture3.Text);
objCmdAddStock.Parameters.AddWithValue("@picture4", txtPicture4.Text);
objCmdAddStock.Parameters.AddWithValue("@picture1_thumb", txtPicture1_thumb.Text);
objCmdAddStock.Parameters.AddWithValue("@picture2_thumb", txtPicture2_thumb.Text);
objCmdAddStock.Parameters.AddWithValue("@picture3_thumb", txtPicture3_thumb.Text);
objCmdAddStock.Parameters.AddWithValue("@picture4_thumb", txtPicture4_thumb.Text);
objCmdAddStock.Parameters.AddWithValue("@title", txtTitle.Text);
objCmdAddStock.Parameters.AddWithValue("@display_price", txtDisplay.Text);*/
try
{
objCmdAddStock.ExecuteNonQuery();
}catch (Exception ex)
{Label17.Text = Convert.ToString(ex);
}finally
{
objConnAddStock.Close();
}Label17.Text = Convert.ToString(intUpdateQSStockID);
}
View 3 Replies
View Related
Mar 8, 2006
Hi,
I want to submit db name as as default parameter when calling procedure WITHOUT using variables
Example
use master
go
create procedure get_caller_db @s sysname = DB_NAME() --produce error
as
select @s as [caller db name]
go
use mySuperDB
exec master.dbo.get_caller_db
--
caller db name
--------------
mySuperDB -- result I want
View 2 Replies
View Related
Oct 15, 2006
I have a Monthlyexpense column. How do I Sum up this column and put the Total in my ytdexpenses column. Do I use a stored procedure, because I want the monthlyExpenses to SUm up every time I submit a monthly expense to the database and siplay in the ytdExpenses Column.
When I Write a Query all of the rows in the ytdExpenses shows the same amount and do not total up every time I submit to the database. Help please.
monthlyExpenses ytdExpenses
$1,000   $1,000
$2,000   $3,000
$3,000   $6,000
$2,000   $8,000
$5,000   $13,000
View 20 Replies
View Related
Sep 30, 2007
pls i have asp.net page that i want to connect to sql server express edition database and i want data to be submited from the page into sql server express edition database that i have in my project folder when i click on submit button pls help me with the code to do this
View 1 Replies
View Related
Aug 17, 2007
I have a report created in Reporting Services that contains 5 parameters. Two are text [date] fields, and three are drop-down multi-value parameters. One is driven from the result of another, and both of those work fine. My issue is with the final multi-value parameter, which is simply a list of customers. It gets populated from the data set without a problem, and I can select from 1 to all of the options. However, on submitting the report. This one parameter gets cleared out, the report does not run, but instead waits for me to select the customers (again) and resubmit.
Occasionally, I can select a few customers and it will, in fact, run the report. However, 90% of the time it just clears the field and waits.
I can trace the database, and everything looks normal - on submit nothing is sent to the database, so it's not like there's a problem with the query. I've verified the customer table and all records look similar - I don't see any obvious data issues.
Suggestions?
View 4 Replies
View Related
Apr 8, 2004
I would like to insert a set of data to my database to 2 different tables.
what will be the SQL Statement for such ? Is it possible to do so?
for example, a webpage contain 2 textbox which require user to key in data. Once click submit button. the info will saved to 2 tables....
View 3 Replies
View Related
Nov 5, 2013
Currently, I have a set of data that is available on a SQL Server. I want to be able to display the information in the front-end (ie. Access form, excel, webpage?), and if the user wants to edit any information they may do so and with a click of a button, submits to the sql server.
View 1 Replies
View Related
Jul 20, 2005
Hi all,I have a internet page written in asp to submit into authorscurriculum vitae publications (title, author, year, etc.).If the author submit less than 8000 characters it functions OK, but Ifthe author try's to submit more than 8000 characters the asp page doesnot return an error but the text is not saved in the database or,sometimes, it returned a "Typ mismatch" error.Here is the sp:---------------------------------------------------------------------CREATE PROCEDURE sp_CV_publications(@formCommandnvarchar(255)='process',@id numeric=null,@id_personint=null,@typPubID tinyint= NULL,@publicationstext=null)ASif @formCommand='process'beginINSERT INTO CV_publications(idperson,typPubID,publications)VALUES (@id_person@typPubID,@publications);select 1 as status, @@IDENTITY AS insertedID, * FROMCV_publications WHERE id=@@IDENTITYend----------------------------------------------------------------------------The server is running IIS5 and SqlServer 2000Any ideas ???
View 1 Replies
View Related
Aug 2, 2006
Ok guys I have read everything in my previous post but unfortunately can not seem to get it to work properly. Would anyone like to do this 10 minutes work (I am sure). Obviously I dont expect it to be free but if I continue I am going to get a sledge hammer to this now.
Thanks in advance
View 20 Replies
View Related
Nov 30, 2006
Hi, does somebody recognize the problem with my code? -Thanks!
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. Parser Error Message: This is an unexpected token. The expected token is 'NAME'. Line 58, position 52.Source Error:
<sessionState mode="SQLServer"stateConnectionString="Jensen"sqlConnectionString=
"datasource=Database;userid=username;password=pass"cookieless="false"timeout="60"/>
View 1 Replies
View Related
Sep 23, 1999
Always looking for people who are strong with microsoft technology for new oppurtunities in the Seattle area. If you are good, we can help you find your ideal next position.
don't be shy. shoot me an e-mail.
thanks
Pat Copeland
View 2 Replies
View Related
Sep 16, 1999
I am looking for strong SQL developers and/or DBA's for some really sweet companies here in Seattle. Anyone interested that is good and wants to hear about new oppurtunities? I would love to help you out.
don't be shy just shoot me an e-mail.
View 2 Replies
View Related
May 8, 2002
Please help to find an example of the code written on VC++ for an extended stored procedure (dll) for SQL Server 2000.
Thanks
View 1 Replies
View Related
Mar 19, 2004
OK...this is driving me nuts....
In the First DELETE and bcp I was getting the thread being launched by xp_cmdshell was being blocked by the parent thread...
put in WAITFOR...sometime it worked...started with an empty table..it worked....left the 28k rows, blocked...
Now, put SELECT COUNT(*)...works each and every g-d damn time...
HUH?
Now I get to the bcp out..
added the same code WAITFOR/SELECT *...
blocks each and ever g-d damn time....
I'm very reticent to COMMIT and start another tranny block...
Anyone have any ideas?
SET NOCOUNT ON
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[wrk_DataHold]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[wrk_DataHold]
GO
CREATE TABLE wrk_DataHold(Col1 varchar(8000))
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[wrk_OldNew]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[wrk_OldNew]
GO
CREATE TABLE wrk_OldNew(Old varchar(255),New varchar(255))
GO
INSERT INTO wrk_OldNew(Old,New)
SELECT 'SEVERAL EE~S', ''
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[usp_ModifyRows]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[usp_ModifyRows]
GO
CREATE PROC usp_ModifyRows
@Path sysname
, @FName sysname
AS
SET NOCOUNT ON
BEGIN TRAN
DECLARE @cmd varchar(8000), @Servername sysname, @rc int, @error int, @rowcount int
, @Old varchar(255), @New varchar(255), @x int
CREATE TABLE #bcpLog(Col1 varchar(8000))
SET @rc = 0
DELETE FROM wrk_DataHold
SELECT @error = @@error, @rowcount = @@ROWCOUNT
IF @error <> 0
BEGIN
SET @rc = -1
GOTO usp_ModifyRows_Error
END
SELECT @x=COUNT(*) FROM wrk_DataHold
WAITFOR DELAY '000:00:10'
SET @cmd = 'bcp wrk_DataHold in ' + @Path + @FName + ' -S ' + @@SERVERNAME + ' -U -P -c'
INSERT INTO #bcpLog(Col1) EXEC master..xp_cmdShell @cmd
DECLARE OldNew CURSOR FOR SELECT Old, New FROM wrk_OldNew
OPEN OldNew
FETCH NEXT FROM OldNew INTO @Old, @New
WHILE @@FETCH_STATUS = 0
BEGIN
UPDATE wrk_DataHold
SET Col1 = REPLACE(Col1,@Old,@New)
WHERE Col1 LIKE '%'+@Old+'%'
SELECT @error = @@error, @rowcount = @@ROWCOUNT
IF @error <> 0
BEGIN
SET @rc = -1
GOTO usp_ModifyRows_Error
END
INSERT INTO #bcpLog(Col1)
SELECT 'REPLACE "'+ RTRIM(@Old) + '" With "' + RTRIM(@New)+ '"' UNION ALL
SELECT '('+CONVERT(varchar(25),@rowcount)+' row(s) affected)'
FETCH NEXT FROM OldNew INTO @Old, @New
END
CLOSE OldNew
DEALLOCATE OldNew
SELECT @x=COUNT(*) FROM wrk_DataHold
WAITFOR DELAY '000:00:10'
SELECT @FName = SUBSTRING(@FName,1,CHARINDEX('.',@FName)-1)+'.new'
INSERT INTO #bcpLog(Col1)
SELECT 'Preparing to Write out new file '+ @Path + @FName
/*
SET @cmd = 'bcp wrk_DataHold out ' + @Path + @FName + ' -S ' + @@SERVERNAME + ' -U -P -c'
INSERT INTO #bcpLog(Col1) EXEC master..xp_cmdShell @cmd
SET @cmd = 'bcp #bcpLog out D:cpLog.txt -S ' + @@SERVERNAME + ' -U -P -c'
INSERT INTO #bcpLog(Col1) EXEC master..xp_cmdShell @cmd
*/
COMMIT TRAN
usp_ModifyRows_Exit:
SELECT * FROM #bcpLog
DROP TABLE #bcpLog
SET NOCOUNT OFF
RETURN @rc
usp_ModifyRows_Error:
CLOSE OldNew
DEALLOCATE OldNew
ROLLBACK TRAN
GOTO usp_ModifyRows_Exit
GO
SET NOCOUNT OFF
View 5 Replies
View Related
Feb 8, 2006
I have a SQL Server (Express) database that I use in a Visual Studio (Visual Basic) 2005 application.
The application is of the Decision Support type, that routine deletes the contents of some of the database tables and then re-populates them with new data. There is no reason for keeping the "old" contents and no reason to restore the old content.
(It does this using "BULK INSERT" statements, as in:
"BULK INSERT SharePrices FROM "C:SharePrice.txt")
Because of all the data replacing, the log file gets huge quickly. I don't need the log file at all.
(I suspect that the logging is also taking up time unncessarily.)
Is there any way I can set the database not to have a log file at all, or to have a small log file?
(I've tried deleting the log file from SQL Server Management SQL Express, but get a message that there has to be a log file.)
When I restrict the log file size, my application returns error messages that the log file is too small, and the application can't do what it needs to do.
I have already made sure that in the database that the recovery mode is set to "Simple" and that "AutoShrink" is set to true.
I've tried manual "Shrinks". These work. However, as soon as the application accesses the database, the log file gets huge again.
I realise I may have to do (unnecessary) backups before/after my bulk insert statements. If so, I'd appreciate some help on how to do this from within a Visual Basic 2005 application. (I'm actually using the Data Access block from the Enterprise Library for my data access.)
I'd really appreciate your help.
Kind regards
Reg Bust
View 3 Replies
View Related
Oct 31, 2007
Dear all,
Can anybody provide sample t-sql procedures coding to do the following tasks?
I want to call a sql stored procedures with parameter passing. I write down the pseudo codes as follows:
In the SQL server side, write a stored procedure which performs the following:
With input parameter "ABCDE";
execute SQL statement "select * from table A where tableA.field B = "ABCDE";
For each record from the result of the above SQL statement,
"select * from tableB where tableB.field C=tableA.fieldX"
if the record can be found in tableB,
"update tableB set tableB.fieldD=something";
if the record cannot be found in tableB,
"insert a new record in tableB"
My actual application requirement is that I have an input file of over hundred thousand records which acts as a primary file to update or to add records to another file. My client side application, which is VB.NET, call a sql procedures once to perform this task. I don't want the VB.NET program to loop through all the input records and call a sql procedure a hundred thousand times!
thanks in advance!
View 8 Replies
View Related
Feb 27, 2008
I want to calculate how many number of people have got loans. In my report, there is one column called customerName. I can use count(CustomerName). But sometimes cutomers name appears twise or thrise. count(customerName) does not give the write nu of customers. How do I write T-SQL expression to get the rite no of customer?
Thanks
View 5 Replies
View Related
Sep 30, 2005
hi! I'm still fairly wet behind the ears when it comes to databases, especially sql server 2000. But I just got a copy from my University and I really want to spend some time messing with it. The first thing I want to try is making a shopping cart that stores the items in the database rather than in the session. I'm using asp.net (VB) and I had previously made a simple shopping cart for a SMALL site that stored all the information in a dataset stored in the session... but I've been told that isn't a good idea and reccomended I store the data in the sql database. so that's what I want to do!
I'm looking for resources that can help me get this started. These are the first questions I have about this approach, and any advice from you experts would be most appreciated!
1) do I store the data in a temporary table or do I use the regular table and make temporary rows? if the former how do I transfer the rows from the temp table to the order table? if the latter how do I change it from temporary to peromanent? in either case, how do I eliminate rows if the user abandons their cart?
2) how do I first initialize an order and keep track of the orderID for each user and ensure that no one is assigned a duplicate orderID?
those are my biggest confusions about this approach. I've looked for books on this but most are either too much about sql syntax and big-time server management, or they are too general and not specific to sql server. I've tried looking online, but I can't find much information on doing this using asp.net 2.0. thanks again for your help!
-SelArom
View 6 Replies
View Related
Jul 20, 2005
I am looking for sql server certifcation questions any one hasany.like dumps or some thing
View 1 Replies
View Related
Jun 26, 2007
Hello,
In the ErrorLog of my Sql Server , i found this line :
2007-06-26 05:35:18.37 Serveur The SQL Network Interface library could not register the Service Principal Name (SPN) for the SQL Server service. Error: 0x54b, state: 3. Failure to register an SPN may cause integrated authentication to fall back to NTLM instead of Kerberos. This is an informational message. Further action is only required if Kerberos authentication is required by authentication policies.
Operating System XP Home SP2
SQL Server 2005 Express Edition with Advanced SP1 )
( idem for another workstation with XP Pro SP2 and same version of SQL Server 2005 Express
My problem is :
i want use the windows authentification but my computers are on Worhkgroup linked by a router ( no window server )
i have read that's possible to connect from a remote computer to a computer having a SQL Server 2005 Express through SPN
How can i do it ? ( activating NTLM ? but how ?)
I'm writing a C# program which must be executing on several computers with a SQL Server 2005 Express installed on a particular computer. These computers will belong to a domain of Windows Server 2003.
As i can't connect to this "normal" network, i am trying to simulate this network at home because i want to test this program and especially the possible locks problems.
I don't know whether i'm querying with the "correct" forum.
Sorry for my poor english.
I shall appreciate any help about this problem
Have a nice day
View 1 Replies
View Related
Apr 27, 2006
Hi!
I'm new to SSIS (and quite new to SQL Server). I have a process which I'd like to automize via SSIS - just don't know how and couldn't figure it out yet by playing around with the program. Shouldn't be too difficult though.
First of all, that's the process as I do it now:
1) Load several flatfile sources (dumps of SQL tables) into an SQL database.
2) Add identifier rows (to some tables), set the primary and foreign keys so the database is "recreated" and I can work on it.
3) Do several simple transformations, aggregations and selects across tables and finally write a new table containing information for reporting stuff.
I succeded in loading flatfiles within the data flow view, doing some transformations and saving the output to a flatfile. What I didn't find out: how can I "recreate" the database enabling me to perform "SELECT/FROM/WHERE" statements across tables? Will I have to write the imported files to tables within a db (how?) or can I avoid this step?
A little guide (newbie friendly) would be great help!
View 11 Replies
View Related
Apr 16, 2007
I created a report which has duplicates on one field. I want the report to display the duplicates, but cannot figure out how. Anywhere I have found where there is a "Hide Duplicates" option I have it turned off (in matrix properties), but the report matrix still hides the duplicates. I don't understand why this would happen since the other fields on the same record are not duplicates. I tried grouping but that was no help.
The query in the dataset DOES return the duplicates as expected.
Anyone know how to fix this, or if it is a bug?
Thanks,
Chris
View 1 Replies
View Related
Apr 10, 2002
I have three tables, Employer, Customer and CustomerEmployer. The employer table contains all employers and the customeremployer table contains customer records for an employer. For example
Employer Table
EmployerID Name Address
1 ABC Company 123 Main Street
2 CDE Company 1 South Street
3 JJJ Company 3 Timothy Street
4 ZZZ Company 2 Rust Street
Customer Employer Table
ID EmployerID CustomerID
1 3 1
2 3 2
Customer Table
ID Name
1 Joe Smith
2 Jane Thomas
3 Tim James
I would like to run a select statement which lists all the employers and whether the employer has already been assigned to a customer. For example, for Joe Smith I would like to see all the employers listed AND some marker indicating that Joe is already assigned to EmployerID 3, JJJ Company.
Results
EmployerID Name Address CustomerID
1 ABC Company 123 Main Street
2 CDE Company 1 South Street
3 JJJ Company 3 Timothy Street 3
4 ZZZ Company 2 Rust Street
I have tried unions and many types of joins but none seem to work correctly. I was using the following select statement however only employers that are contained in the customeremployer table appear.
SELECT Employer.EmployerID, Employer.Name, Address, Employer.City,
CustomerEmployer.CustomerID
FROM CustomerEmployer RIGHT OUTER JOIN
Employer ON CustomerEmployer.EmployerID = Employer.EmployerID
WHERE (CustomerEmployer.CustomerID = @customerid) OR (CustomerEmployer.CustomerID IS NULL)
ORDER BY Name
Any ideas?
Thanks.
View 1 Replies
View Related