From View Inserts The Value Of The Last Inserting At Page Reload A Second Time

Apr 19, 2007

Hi folks,

After getting a form view inserting some values into a mdb file, it inserts the same values a second time on page reload.

How may I cure this? Any suggestions?

VB Code is below.

many thanks in advance

Rosi

 1 <%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="km_Eingabe.aspx.vb" Inherits="km_Eingabe" title="km-Eingabe" %>
2 <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
3 <table style="width: 750px; height: 210px">
4 <tr>
5 <td style="height: 38px">
6 </td>
7 <td style="height: 38px">
8 <asp:DropDownList ID="dropdownlist1" runat="server" AutoPostBack="True" DataSourceID="AccessDataSource2"
9 DataTextField="polKennz" DataValueField="polKennz">
10 </asp:DropDownList>
11 </td>
12 <td style="height: 38px">
13 </td>
14 </tr>
15 <tr>
16 <td style="height: 235px">
17 </td>
18 <td style="height: 235px" valign="top">
19 &nbsp;&nbsp;
20 <asp:FormView ID="FormView1" runat="server" CellPadding="4" DataSourceID="SqlDataSource1"
21 ForeColor="#333333">
22 <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
23 <EditRowStyle BackColor="#999999" />
24 <EditItemTemplate>
25
26 </EditItemTemplate>
27 <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
28 <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
29 <EmptyDataTemplate>
30 keine Daten vorhanden
31 <br />
32 <asp:LinkButton ID="NewButton" runat="server" CommandName="New" Text="Neuer Eintrag"></asp:LinkButton>
33 </EmptyDataTemplate>
34 <InsertItemTemplate>
35 Datum:
36 <asp:TextBox ID="DatumTextBox" runat="server" Text='<%# Bind("Datum", "{0:d}") %>'>
37 </asp:TextBox>
38 <br />
39 Fahrer:
40 <asp:TextBox ID="FahrerTextBox" runat="server" Text='<%# Bind("Fahrer") %>'>
41 </asp:TextBox>
42 <br />
43 polKennz:
44 <asp:TextBox ID="polKennzTextBox" runat="server" Text='<%# Bind("polKennz") %>'>
45 </asp:TextBox>
46 <br />
47 neuer_Eintrag:
48 <asp:TextBox ID="neuer_EintragTextBox" runat="server" Text='<%# Bind("neu") %>'></asp:TextBox>
49 <br />
50 aktuell:
51 <asp:TextBox ID="aktuellTextBox" runat="server" Text='<%# Bind("aktuell") %>'></asp:TextBox>&nbsp;<br />
52 <br />
53 <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert"
54 Text="EinfĂĽgen" OnClick="InsertButton_Click">
55 </asp:LinkButton>&nbsp;
56 <asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel"
57 Text="Abbrechen">
58 </asp:LinkButton>
59 </InsertItemTemplate>
60 <ItemTemplate>
61 Datum:
62 <asp:Label ID="DatumLabel" runat="server" Text='<%# Bind("Datum") %>'></asp:Label><br />
63 Fahrer:
64 <asp:Label ID="FahrerLabel" runat="server" Text='<%# Bind("Fahrer") %>'></asp:Label><br />
65 polKennz:
66 <asp:Label ID="polKennzLabel" runat="server" Text='<%# Bind("polKennz") %>'></asp:Label><br />
67 neu:
68 <asp:Label ID="neuLabel" runat="server" Text='<%# Bind("neu") %>'></asp:Label><br />
69 lfdNr:
70 <asp:Label ID="lfdNrLabel" runat="server" Text='<%# Eval("lfdNr") %>'></asp:Label><br />
71 aktuell:
72 <asp:Label ID="aktuellLabel" runat="server" Text='<%# Bind("aktuell") %>'></asp:Label><br />
73 Dienststelle:
74 <asp:Label ID="DienststelleLabel" runat="server" Text='<%# Bind("Dienststelle") %>'></asp:Label><br />
75 <asp:LinkButton ID="NewButton" runat="server" CommandName="New" Text="Neuer Eintrag"></asp:LinkButton>
76 </ItemTemplate>
77 <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
78 </asp:FormView>
79 </td>
80 <td style="height: 235px">
81 </td>
82 </tr>
83 <tr>
84 <td>
85 </td>
86 <td>
87 </td>
88 <td>
89 </td>
90 </tr>
91 </table>
92 <asp:AccessDataSource ID="AccessDataSource2" runat="server" DataFile="~/App_Data/KfzDaten_Ansicht.mdb"
93 SelectCommand="SELECT DISTINCT [polKennz] FROM [qry_KennzeichenAlle_ohne_ausgesondert]">
94 </asp:AccessDataSource>
95 <asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/KfzDaten_Ansicht.mdb"
96 SelectCommand="SELECT DISTINCT [Datum], [Nutzer], [Fahrer], [polKennz], [aktuell], [neu], [gefahren] FROM [qry_Fahrtenbuch_letzter_Eintrag_pro_Kfz] WHERE ([polKennz] = ?)">
97 <SelectParameters>
98 <asp:ControlParameter ControlID="DropDownList1" Name="polKennz" PropertyName="SelectedValue"
99 Type="String" />
100 </SelectParameters>
101 </asp:AccessDataSource>
102 <asp:SqlDataSource ID="SqlDataSource1" DataSourceMode="DataSet" ConflictDetection="CompareAllValues" InsertCommandType="Text" runat="server" ConnectionString="<%$ ConnectionStrings:KfzDaten_Ansicht_mdbConnectionString %>" ProviderName="<%$ ConnectionStrings:KfzDaten_Ansicht_mdbConnectionString.ProviderName %>"
103 InsertCommand= "INSERT INTO Tab_import_Fahrtenbuch([Datum], [Fahrer], [polKennz], [neu], [aktuell]) VALUES (@Datum, @Fahrer, @polKennz, @Eingabe_neu, @Eingabe_aktuell )" >
104 <SelectParameters>
105 <asp:ControlParameter ControlID="dropdownlist1" Name="newparameter" PropertyName="SelectedValue" />
106 </SelectParameters>
107 <InsertParameters>
108 <asp:FormParameter FormField="DatumTextBox" Name="Datum" Type="string" />
109 <asp:FormParameter FormField="FahrerTextBox" Name="Fahrer" Type="string" />
110 <asp:FormParameter FormField="polKennzTextBox" Name="polKennz" Type="string" />
111 <asp:FormParameter FormField="neuer_EintragTextBox" Name="neu" Type="Int32" ConvertEmptyStringToNull="false" />
112 <asp:FormParameter FormField="aktuellTextBox" Name="aktuell" Type="Int32" ConvertEmptyStringToNull="false" Direction="Input" />
113 </InsertParameters>
114 </asp:SqlDataSource>
115 &nbsp; &nbsp;&nbsp;
116 </asp:Content>
117
118
 

View 5 Replies


ADVERTISEMENT

Data Getting Truncated As I Insert I.e. Instead Of Inserting Hello It Inserts 'H'

Jul 25, 2005

m inserting some data in big-sized field
and small-sized fields, data of varchar type, int's, dateTime, and
others... i am using something called a stored procedure to add data
into a table.. now when i execute the stored procedure my data gets
truncated (although i made the sizes for my fields ridiculously big
like 1000 just in case) for example if i want to enter Jasmine it only
inserts 'J' in the field

I am sure there's something wrong in the stored procedure, and I am
guessing it's a problem of using single vs. double quotes and stuff
like that within my insert statement...
the following is my stored procedure:

CREATE procedure addLabor
@lName varchar,
@fName varchar,
@mName varchar,
@title varchar,
@craft varchar,
@lastFour varchar,
@SSN varchar,
@dateOfHire varchar,
@currentProj varchar,
@status tinyInt,
@project_id int,
@updateBy varchar,
@updateDate varchar,
@address varchar,
@email varchar,
@phone varchar,
@zip varchar,
@myfeedBack varchar,
@ethnicity varchar,
@userID int
as
BEGIN
SET NOCOUNT OFF
DECLARE @newid INT
insert into laborPersonal ( lName, fName, mName, title, craft,
lastFour, SSN, dateOfHire,  currentProj, status, project_id,
updateBy,

updateDate, address, email, phone, zip, ethnicity)
 VALUES
(@lName  , @fName , @mName , @title  , @craft , @lastFour  , @SSN ,@dateOfHire  , @currentProj ,
@status,  @project_id , @UpdateBy, @UpdateDate , @address , @email , @phone , @zip , @ethnicity )
SELECT @newid = SCOPE_IDENTITY()
insert into feedBack
(lID, feedBack, userID, project_id)
values
(@newid ,+'
+@myfeedBack + ',
+@userID  ,
@project_id )
SET NOCOUNT ON
END
GO


When i use 2 single quotes it insert the following string: "@lName" not the actual value of the variable @lName
my exec statement is this:
EXEC addLabor 'Razor', 'Nazor', 'mid', 'Mr', 'Carpenter Forman',
'1234',
'keOWVozC+wmBvaqgkVkZci5y4vFLdTKfZOVG4C6BSN6H2MBP6pdsIWA0SdPAlPJra0EjEj+uXI/kXSiBuwwnKQ==',
'6/27/2005 12:00:00 AM' , 'O.C. Public Library', 1, 3, '3', '7/25/2005
2:38:02 PM', '1233 Shady Canyon, Irvine', '', '', '12345',
'123-12-1234', 'African American', '3'

I appreciate any help or hints
thanks to all

View 1 Replies View Related

How To Set How Many Records Showed In Each Page In View Page?

Dec 12, 2007

I want to show more records in each page when i view report
Question is subject above
any idea? thanks

View 4 Replies View Related

Inserts Taking Longer Time

May 23, 2007

Hello All,

I have SQL Server 2005 installed on my machine and I am firing following query to insert 1500 records into a simple table having just on column.

Declare @i int
Set @i=0
While (@i<1500)
Begin
Insert into test2 values (@i)
Set @i=@i+1
End

Here goes the table definition,

CREATE TABLE [dbo].[test2](
[int] NULL
) ON [PRIMARY]

Now the problem with this is that on one of my server this query is taking just 500ms to run while on my production and other test server this query is taking more than 25 seconds.
Same is the problem with updates. I have checked the configurations of both the servers and found them to be the same. Also there are no indexes defined on either of the tables. I was wondering what can be the possible reason for this to happen. If any of u people has any pointers regarding this, will be really useful

Thanks in advance,
Mitesh

View 6 Replies View Related

Master And Child Table Inserts At A Time.

May 15, 2007

I have a situation here. Please
advice me on this.



I have a master table and a child
table. They have a PK and FK relationship. The master table has an identity
column with auto increment set to true. This map as a FK in the child table. My
questions are:

Can I have a single form to insert a new record into
master and child table at the same time?This has to be accomplished without stored
procedures. Can it be done?Is it possible to do this with a single insert query?
If yes, can it be done with sql data source or
dataset or tableadapters’?Please point me towards appropriate link for doing
so.





Thank you.

I am currently using SQL Server
2005 and VS 2005.

View 1 Replies View Related

Problem With A Lot Of Inserts In Short Time - SQL Server 2000

Feb 27, 2008

Hi!We have SQL Server 2000 on virtual machine (slowly). We run a pair ofstored procedures from ADO.NET 2.0 (WebService):- first procedure: insert into table A a data row with correlationID- next procedure: search for inserted record in tab A bycorrelationID and insert value into tab B with constraint to tab A.The problem is when we try to do this in short time (few minutes)thousands times (5000/6000 pairs in 5/6 minutes) in 100 parallelthreads:query in second procedure cannot find inserted record in firstprocedure.Everything is dirty read. no transactions.Have you any ideas?edi

View 1 Replies View Related

Replication Performance Degrade In Unidirectional Direction And Lock Time Out (Update Are High Than Inserts)

Feb 21, 2007

 

We recently implemented merge replication.We were expereincing. The replication is between 2 SQL Servers (2005) over same network box, and since we have introduced the replication, the performance has degraded considerably on subscriber end.

1)   One thing that should be mention is that its a "unidirectional Direction" flow of changes is from publisher towards subscriber (only one publisher and distributor as well and one subscriber ).

2) Updates are high than inserts and only one article let say "Article1" ave update up to 2000 per day and i am experiecing that dbo.MSmerge_upd_sp_Article1_GUID taking more cpu time.what should be do..

 

on subscriber database  response time is going to slow and i am experiencing a lot of number of LOCK time outs on application end.

can any one can also suggest me server level settings for aviding locking time out.

 

looking for any experieced solution/suggestion.

Thanks in advance. 

View 3 Replies View Related

Inserting Browser Info Upon Page Load

Feb 21, 2008

I want to insert client browser and computer information upon page load.   I want to insert strComputerName into @ComputerName & strIpAddress into @IpAddress
what would the insert look like under the page load? 
SqlDataSource1.Insert() ? ? ? ? ?
 aspx 
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:CompInfoConnectionString1 %>"
SelectCommand="SELECT * FROM [Computer_Info]" InsertCommand="INSERT INTO [Computer_Info] ([ComputerName], [IpAddress], [BrowserInfo], [LastLogin], [UserName]) VALUES (@ComputerName, @IpAddress, @BrowserInfo, @LastLogin, @UserName)"
 
code behine aspx.vbProtected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
'pull comp nameDim host As System.Net.IPHostEntry
Dim strComputerName As String
Dim strIpAddress As Stringhost = System.Net.Dns.GetHostByAddress(Request.ServerVariables.Item("REMOTE_HOST"))
strComputerName = host.HostName
CompNameLabel.Text = strComputerName
'pull ip address
strIpAdress = Request.ServerVariables.Item("REMOTE_HOST")IpAddressLabel.Text = strIpAddress
End Sub
 
 
 

View 1 Replies View Related

Problem In Inserting Value In View

Aug 11, 2006

Hi There,

i have created one view on an exsisting table, but when i am inserting value in it, it is giving the following error msg:

Derived table 'View Name' is not updatable because a column of the derived table is derived or constant.

Thanx

View 1 Replies View Related

Inserting On A Distributed View

Apr 29, 2008

Hi folks,

I am trying to insert records on a distributed view (Fed_Entity) which UNIONs 2 tables on 2 different machines.


insert into Fed_Entity (EntityID,Bid,Account_Email,Password,Contact_First,Contact_Last,Address1) values(99,99,'99@abc.com','abc','test','test','test')

Fed_Entity is a basic distributed view. I am able to successfully run a select statement on this view which consolidates data from two tables.

I haven't yet defined a partition function .. I was just checking to see what will happen if I try to insert.

I have MS SQL SP4 installed. MS-SQL 2000 v. 8.00.2039 on both machines

I get the following error message:

Views referencing tables on multiple servers are not updatable on this SKU of SQL Server.

I thought that Insert/Updates were supported on MS-SQL 2000. Am I wrong?

View 3 Replies View Related

Inserting Records Using The Details View Or Programmatically

Aug 26, 2006

I'm a new user to vwd.  If I use a details view control on my page, I have noticed that the "New" link is not visible unless there is at least one record in the table. Is there any way of making it visible where there aren't any records?My web pages are currently hosted at vwdhosting. I have uploaded my database with the record structure onto the web site and I am using a remote connection string to access it. I have had users updating data in another table on the remote database. If I add records to my new table locally and upload the database to the remote site, all the data that my users have been adding will be lost. So, if I can't add my first record using a control on my web page when there are no records in the table, should I be doing it programmatically? If so, how?Thanks,Julie 

View 2 Replies View Related

Error Creating And Inserting Data Into VIEW

Feb 27, 2008

I have written following SQL query, this creates temporary table, inserts rows into it. I need to create VIEW "vw_NumberOfAttachments" in the database. I initially created table using "CREATE TABLE" but then i got error as VIEW can not be filled by temporary table. Hence I am using DECLARE TABLE
--------------------------------
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE sp_GetViewNumberOfAttachments
-- Add the parameters for the stored procedure here

AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;

DECLARE @emailMessageID bigint
DECLARE @metaDataStorageID bigint
DECLARE @numberOfAttachments int

DECLARE @AttachmentDetails TABLE
(
emailMessageID bigint,
metaDataStorageID bigint,
numberOfAttachments int
)

DECLARE ATTACHMENT_CURSOR CURSOR
FOR
SELECT emailMessageID, metaDataStorageID
FROM ppaEmailMessage
WHERE hasAttachments='true'

OPEN ATTACHMENT_CURSOR
FETCH NEXT FROM ATTACHMENT_CURSOR INTO @emailMessageID, @metaDataStorageID

WHILE @@FETCH_STATUS = 0
BEGIN
-- here the table name need to get dynamically the name of the attachment table
-- for a moment it is written as ppaMsOfficeDoc, but that should change dynamically
set @numberOfAttachments = (SELECT count(*) FROM ppaMsOfficeDoc WHERE metaDataStorageID = @metaDataStorageID)

INSERT INTO @AttachmentDetails(emailMessageID, metaDataStorageID, numberOfAttachments)
VALUES (@emailMessageID, @metaDataStorageID, @numberOfAttachments)

FETCH NEXT FROM ATTACHMENT_CURSOR INTO @emailMessageID, @metaDataStorageID
END

CLOSE ATTACHMENT_CURSOR
DEALLOCATE ATTACHMENT_CURSOR

IF EXISTS (SELECT TABLE_NAME FROM INFORMATION_SCHEMA.VIEWS
WHERE TABLE_NAME = 'vw_NumberOfAttachments')
DROP VIEW vw_NumberOfAttachments
GO
CREATE VIEW vw_NumberOfAttachments
AS
SELECT @AttachmentDetails.emailMessageID, @AttachmentDetails.metaDataStorageID, @AttachmentDetails.numberOfAttachments
FROM @AttachmentDetails
GO
END
GO

----------------------

I am getting following errors:
-----------
Msg 102, Level 15, State 1, Procedure sp_GetViewNumberOfAttachments, Line 57
Incorrect syntax near 'vw_NumberOfAttachments'.
Msg 137, Level 15, State 2, Procedure vw_NumberOfAttachments, Line 3
Must declare the scalar variable "@AttachmentDetails".
Msg 102, Level 15, State 1, Line 2
Incorrect syntax near 'END'.
-----------
Can anyone please suggest whats wrong in there? Many thanks

View 1 Replies View Related

Inserting Into A Tmp Table Using A View --- Please Help Using SQL Query Analyzer

Nov 30, 2006

Hi there,I struggle to get this going i would like to insert data into 2 tmptables in a view.If i run the code on it's own it works perfectly until i want to createa view it complains about the INSERTthis is my codeCreate view dbo.vew_SwitchesAsINSERT INTO tmpInsSelectDistinctBIV.DATE,BIV.ID,CA.NAME,BIV.IND,BIV.AMOUNT,BIV.UNITS,BIV.INAME,MB.NOfrom Cars BIVLEFT JOIN MountainBikes MBON MB.ID = BIV.IDAND MB.CLASS = BIV.CLASSAND MB.NUMBER = BIV.NUMBERAND MB.DATE = BIV.DATELEFT JOIN Caterpillars CAON CA.ID = MB.NOwhere BIV.CLASS = 'SWCH'and BIV.IND = 'IN'AND BIV.UNITS = 0AND BIV.AMOUNT <0ORDER BY BIV.DATE ASC------ Step 2 -------Into tmpOutsInsert Into tmpOuts ---- All Switches In ----SelectDistinctBIV.DATE,BIV.ID,CA.NAME,BIV.IND,BIV.AMOUNT,BIV.UNITS,BIV.NAME,MB.NOfrom Cars BIVLEFT JOIN Mountainbikes MBON MB.ID = BIV._IDAND MB.CLASS = BIV.CLASSAND MB.NUMBER = BIV.NUMBERAND MB.DATE = BIV.DATELEFT JOIN Caterpillars CAON CA.ID = MB.NOwhere BIV.CLASS = 'SWCH'and BIV.IND = 'OUT'AND BIV.UNITS = 0AND BIV.AMOUNT <0ORDER BY BIV.DATE ASC----------------------Step 3 ----------------SelectDistinctins.DATE,ins.ID,ins.NAME ,insIND,ins.AMOUNT/100 as AmountIn,outs.IND,outs.AMOUNT/100 as AmountOut,outs.NAME


Quote:

View 4 Replies View Related

You Are Not Authorized To View This Page

Jul 17, 2006

Our Reporting Services was working fine
i think maybe the secuity update messed our server

now we can't see out reporting default website
we messed around with the IIS and we were able to
get to show the home pages of the reporting services
when we click on the report it gets "not authorized to view pages"
we messed around more with IIS and get can't see the homepage
of Reporting Services
the secuity patch was framework 1.1
we did remove the patch but the same problem
we are not sure if this was the cause or not
anybody know what i can do to resolve
not access the website and fix
You are not authorized to view this page

Need help asap

View 19 Replies View Related

You Are Not Authorized To View This Page

Nov 30, 2006

I cannot access the SRSserver/reports page and get a 401 error, no matter what credentials I supply when prompted.

This is a 2005 SRS install, with a distributed model - the database is located on a separate server. The account I am using is an admin on both servers (and in SQL).

I've tried enabling anonymous logon on the /reports virtual directory and that didn't help

I've used Filemon to see if there were file system permission problems...it showed no failures.

I created a test text file in the reportmanager directory and am able to view that, so it's something that the home.aspx file is trying to do.

I'm able to connect to the remote SQL server with Management Studio and everything in the SRS Config app is green.

Thanks

View 2 Replies View Related

Inserting Date And Time

Aug 11, 2003

I am wanting to populate a datetime field with data retrieved from 4 dropdowns month, day, year and hour 08:00 - 18:00.

I am having trouble joining them together in a format that the sql server recognises.

View 3 Replies View Related

Error While Inserting Time

Feb 10, 2007

hi i am trying to insert time in my column which is in my table.my table has one column named as "intime" which has datatype as datetime.

i am doing thuis in vb.net.
i used this code in vb.net to get time:

dim dat as datetime=datetime.now.tostring("hh:mm:ss tt")
and i got time.but i am having this spc for insert:

create procedure sptimeinsert(@time datetime)
as

insert into time values:

An unhandled exception of type 'System.Data.SqlTypes.SqlTypeException' occurred in system.data.dll

Additional information: SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM

please any one help to solve this error.

View 5 Replies View Related

Creating A View From ASP.Net Page (Problems)

Oct 6, 2006

Hello,I am having an error  when using the CREATE VIEW statement and trying to execute it from an ASP.net page. I get an error that says something along the lines of 'dbo' schema does not exist or you do not have permissions to access it. I have checked and the user has been granted every permission I can think of (including setting it to the DB owner), but it does not work. I am able to execute all the Select, Update, Insert statements that I wish to, and when I copy the statement into the SQL 2005 Management studio query menu it works perfectly, it just gives the error message from the ASP.net page.Here is an example (or as close as I can remember at this point) of some code I tried:myCommand.Connection = myConnectionmyCommand.Open()myCommand.CommandText = "Create View TestView as Select 1, 2"myCommand.ExecuteNonQuery()myCommand.Close() Any help would be appreciated.Thanks,StuporMan 

View 7 Replies View Related

Page Width View AS Default

Jul 12, 2007

Hello all,



When viewing a report, there is an option in the left corner for the size ie. 100%, 150%, page width, whole page etc from the dropdown list.



I was wondering is there a way to make the ''Page Width" option the default view for a particular report or site ?

View 1 Replies View Related

Inserting Just The Time Part Of The Date?

Mar 1, 2007

In the code below why does it not enter 10:00 AM but instead it enters: 1900-01-01 10:00:00.000 ?

Create Table MyDateTest
(
DateColumn datetime
)

insert into MyDateTest values ('10:00 AM')
select DateColumn from MyDateTest

--PhB

View 3 Replies View Related

Inserting Time In Smallint Field

Mar 14, 2008

I need to insert rows into a table which contains a smallint field
for time. The times are stored in that colum as integers (898,
11345, 1259, etc.) How can I enter a time like 9:15 AM into this field? I know how to display integer data in hh:mm format but I'm stumped on how I can do the reverse.

Thanks for any help offered.

View 12 Replies View Related

Inserting Nothing Takes A Long Time

Mar 21, 2008

Hi,I've a strange problem with a INSERT query. It's taking a long time toexecute. The format is like this :INSERT INTO table1SELECT ..FROM table2Executing the SELECT .. FROM table2 is taking 30 seconds. The resultis nothing: no records are selected.When i include the INSERT part it will take 12 hours to completeINSERT INTO table1SELECT ..FROM table2There's is an index on the table and when i delete it, it gives stillthe problem.Keh?Greetz,Hennie

View 1 Replies View Related

Problem With Setting Up IIS - You Are Not Authorized To View This Page

Mar 13, 2006

I am trying to set up IIS on our server (Windows 2003 with SQL Server
2000) and when I try to run a query in a browser I keep getting the
following messsage:-



You are not authorized to view this page



I have followed the tutorial (XMLStartup.doc) which was placed in
C:Program FilesMicrosoft SQL
Server80ToolsDevToolsSamplesxmlXMLStartup on installation, but
still get the above message when I get to the point of querying the
database.



Is there something I am doing wrong or is there some security measure I
have not taken into account yet that is preventing me from runing
queries?



any help appreciated - Thanks

View 1 Replies View Related

Reload Or Recompile

Oct 30, 2000

Does someone know whether it is better to drop and reload or sp_recompile a stored procedure to get a new, recompiled execution plan? I have another DBA telling me it is better to drop and reload the stored procedure rather than use sp_recompile. I would think that sp_recompile would be the preferred method.

View 1 Replies View Related

Possible To Reload Masterpage Over And Over Again?

Jun 16, 2012

I am doing a master page and i want the page to update itself when a new value comes in. Example, my master page default value has login and register (both are set as linkbutton)

Login | Register

Then in the login page, when the person successfully logged in to his/her account, master page update linkbutton login and register text will change to welcome john and logout.

Welcome John | Logout

View 1 Replies View Related

Parameter Reload

Jul 18, 2007

I have a problem with getting a dropdown list to change a txt field every time I select a new value on it.

I have a parameter called "Type" that is selected from a non-queried drop down list. This contains values like "Month" "Day" "Quarter" "Week", etc. I have a query that takes those parameters and then returns a "TimeInterval" for each one. I want this value to appear in a text box (Which is a MaxDate parameter for an entirely separate query) whenever the user selects a value from type. However there is a catch, the user needs to be able to also change the value of the textbox so that he/she can customize that end date for report rather than the values that I have pre-canned for them. This is a bit confusing so I'll try to give an example. The wants to run a report and selects "Week" from the drop down list, this value is passed one of my datasets and that data set returns the value 07/15/2007. That value will then populate in the MaxDate parameter field. The user then changes his/her mind selects "month" from the Type drop down list. What should happen is that the MaxDate field changes to be 07/01/2007 (This is returned correctly in my querry, but I can't get it to show in the maxDate field after the first time.), but instead it still shows 07/15/2007. Here is my SQL code for the dataSet that uses the parameter Type to return a date



IF(@Type= 'Day')
BEGIN
SELECT dbo.F_START_OF_DAY(getdate()) AS TimeInterval
END

IF(@Type='Year')
BEGIN
SELECT dbo.F_START_OF_YEAR(getdate()) AS TimeInterval
END

IF(@Type='Month')
BEGIN
SELECT dbo.F_START_OF_MONTH(getdate()) AS TimeInterval
END

IF(@Type='Quarter')
BEGIN
SELECT dbo.F_START_OF_QUARTER(getdate()) AS TimeInterval
END

ETC....................................

If you need any aditional information or have any questions, I'de be more than happy to answer them. Thanks in advance, /jcarver

View 3 Replies View Related

Asp.net Want To Make SQL Time Format Of 00:00:00:000 To 14:42:51:153 When Inserting In Database

Nov 12, 2007

I have asp.net 1.1 web form and it inserts date and time in  SQL database, but it insert only date not time , It insert date time in following format
2002-01-22 00:00:00.000
some one tell me why it is not inserting time or why it is inserting time as 00:00:00:000.
I want to my time to look like 14:42:51:153. (format)
How can I change my time format
give me asp.net codes for time formating or what do I need to do to resolve the problem,
 
thank you
maxmax

View 1 Replies View Related

Error While Inserting Time Id In Fact Table

Dec 31, 2007



Hi

My time dimension has date mm/dd/yy 00:00:00
where as the source has mm/dd/yy and some time not 00:00:00
I am sure the iserts in fact table are failing.
I do not want the time part to come anywhere in data mart.
what should i do in SSIS.

View 1 Replies View Related

How To Reload Report Every X Seconds?

Feb 28, 2008

Is there anyway of including/excluding some javascript to reload the report (with the parameters the user has chosen) on an automatic basis?

View 1 Replies View Related

Reload Data From The Database

Feb 25, 2008

Please, anyone out there can tell me if there is a special code that can reload data from the database and display in the application. Thank you.

View 10 Replies View Related

Inserting The Current Date And Time Into SQL Server Database

Mar 30, 2007

I need an SQL string that inserts the current date into a database.
So far I have tried:
SQL = "INSERT INTO X (START_DATE) VALUES ('" & Date.Now & "')"
mycomm = New SqlCommand(sql, myconn)
mycomm.ExecuteNonQuery()
However, there is a problem with the SQL command. The problem is related to the date. Is there a way of programatically inserting the current date/time into the SQL database? Language used is VB.

View 1 Replies View Related

Best Way To Backup/move A Database And Reload..

Feb 26, 2001

here's my situation. i want to take a copy of my database at work and take it home to my home pc. what/how is the best way to do this. i am relatively new to this stuff, so detailed directions would be nice.

sidebar - if i have the .mdf and .ldf files, can I restore from them?

View 2 Replies View Related

Empty Data Tables And Reload

May 6, 2015

I would like to empty out my 2k8 database (remove all the data in the tables only) And reloaded it with the data from production (2k5). I know I would have to dis-enable any constraints, triggers and remove all indexes before I can run a Truncate/Delete on all tables correct And then import the data via Wizard or script And lastly enable all the constraints & triggers, rebuild the indexes. Is this the only way to go about this? I don't want to do a backup & restore because the 2k5 doesn't have a 20% of the tables that are in 2k8. The 20% of those tables in 2k8 i'm not going to remove.

View 0 Replies View Related







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