Showing posts with label example. Show all posts
Showing posts with label example. Show all posts

Thursday, March 22, 2012

datetime Parameter issue

I'm using a sproc to insert the time (Now()) into a datetime field. Somehow the time "seconds" are not making it into the field. For example, the variable grabs the value of Now() - "9/16/2005 01:58:15 AM" to insert into the field. But when I view the records, the datetime value is "2005-09-16 13:58:00.000".
What am I doing wrong?
Thanks for your help!
Lynnette
Here is a snippet of the code and the sproc:

Dim recDateAs DateTime = Now()
cmd.Parameters.Add(New SqlParameter("@.DELastChg", SqlDbType.DateTime)).Value = recDate

ALTER PROC usp_AddTmpFLSAfromPT
@.dtWdate datetime,
@.whereString as varchar(255),
@.DEuser as varchar(30),
@.DELastChg datetime

AS

DECLARE @.strSQL as varchar(2000)

SET @.strSQL =
'
INSERT INTO tmpFLSAEmpInfo
( Emp_Number,
PT_ID,
Emp_Division,
Emp_Dept,
--Emp_DeptInfo,
Emp_Supervisor,
Emp_Location,
Emp_Union,
Emp_SG,
Emp_Shift,
DEusername,
DELastChg,
WrkDate
)
SELECT
Employee2.Emp_Number,
Employee2.[ID],
Employee2.Division,
Employee2.Job_Dept_Code,
Employee2.Job_Supervisor,
Employee2.Loc_Name,
Employee2.[Union],
Employee2.Sched_Group,
Employee2.Shift,
''' + @.DEUser + ''',
''' + CONVERT(varchar, @.DELastChg) + ''',
''' + CONVERT(varchar, @.dtWdate) + '''

FROM Employee2
WHERE '
+ @.whereString

EXEC(@.strSQL)

You are prbly losing the seconds because of the conversion to varchar in your code above. Put in the size also. Perhaps something like this :CONVERT(varchar(20), @.dtWdate) might help.|||Thanks for the response! I tried your suggestion, but it had no effect - still losing the seconds. I tried using CONVERT(datetime, @.DELastChg, 131) but then I get an error that I cannot convert string to DATETIME. I am hopelessly stuck.
Any other suggestions?
Thanks!
Lynnette|||Changed it toCONVERT(varchar, @.DELastChg, 113) and it works!
Does anyone know what the store procedures that start with
dt_% are? for example dt_properties?
Thanxs
cs
< for example dt_properties?
You can transfer diagrams of the database by using dt_properties.
"cs" <anonymous@.discussions.microsoft.com> wrote in message
news:18fb501c42145$f667e300$a601280a@.phx.gbl...
> Does anyone know what the store procedures that start with
> dt_% are? for example dt_properties?
> Thanxs
|||These are created by Enterprise Manager when you do certain operations. It is OK to delete them, but when you
do such an operation, they will be created again.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"cs" <anonymous@.discussions.microsoft.com> wrote in message news:18fb501c42145$f667e300$a601280a@.phx.gbl...
> Does anyone know what the store procedures that start with
> dt_% are? for example dt_properties?
> Thanxs
sql
Does anyone know what the store procedures that start with
dt_% are? for example dt_properties?
Thanxscs
< for example dt_properties?
You can transfer diagrams of the database by using dt_properties.
"cs" <anonymous@.discussions.microsoft.com> wrote in message
news:18fb501c42145$f667e300$a601280a@.phx
.gbl...
> Does anyone know what the store procedures that start with
> dt_% are? for example dt_properties?
> Thanxs|||These are created by Enterprise Manager when you do certain operations. It i
s OK to delete them, but when you
do such an operation, they will be created again.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"cs" <anonymous@.discussions.microsoft.com> wrote in message news:18fb501c42145$f667e300$a60
1280a@.phx.gbl...
> Does anyone know what the store procedures that start with
> dt_% are? for example dt_properties?
> Thanxs

Tuesday, March 20, 2012

Does anyone know what the store procedures that start with
dt_% are? for example dt_properties?
Thanxscs
< for example dt_properties?
You can transfer diagrams of the database by using dt_properties.
"cs" <anonymous@.discussions.microsoft.com> wrote in message
news:18fb501c42145$f667e300$a601280a@.phx.gbl...
> Does anyone know what the store procedures that start with
> dt_% are? for example dt_properties?
> Thanxs|||These are created by Enterprise Manager when you do certain operations. It is OK to delete them, but when you
do such an operation, they will be created again.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"cs" <anonymous@.discussions.microsoft.com> wrote in message news:18fb501c42145$f667e300$a601280a@.phx.gbl...
> Does anyone know what the store procedures that start with
> dt_% are? for example dt_properties?
> Thanxssql

Sunday, March 11, 2012

.RDL standards?

Hi,
Is the rdl schema based on a standard? For example will the "<ReportItems>"
element ever be renamed?
Thanks,
ShawnThe XML spec is posted on MS website. There are 3rd party product offering
supporting it. Given both facts I would say it is more likely to have
additional extensions added rather than anything going away.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"sysdesigner" <sysdesigner@.discussions.microsoft.com> wrote in message
news:A70C11F6-3A10-48FE-AC95-F629FB329FBD@.microsoft.com...
> Hi,
> Is the rdl schema based on a standard? For example will the
> "<ReportItems>"
> element ever be renamed?
> Thanks,
> Shawn

Sunday, February 19, 2012

.ASP .Net on SQL2000\Win2000

Can anyone tell me what the SQL requirements are regarding using APS.NET are
?
For example, can it work with windows only authentication? Are there
articles out there I can refer to?
Thanks for your help.start with this..
http://support.microsoft.com/kb/247931/en-us|||That's what I needed. Thanks!
"Omnibuzz" wrote:

> start with this..
> http://support.microsoft.com/kb/247931/en-us

Thursday, February 16, 2012

**to trace what has happened**

Hi
In SQL2000, how can I find what has happened in my DB in particular date?
for example I insert a ne row in table1 and I update 2 rows in table2. now
how can find what did I perfome?
I don't want to monitor the changes simentanously, I want to refer to them
afre some times.
should I refer to .log file of my db?(if ye ,how?) or should I do
something else?
any help would be thanked.Hi,
SQL Server will not log the events by default. In this case probably you can
write triggers to audit the Delete/Insert and Update events.
Thanks
Hari
SQL Server MVP
"M" <rez1824@.yahoo.co.uk> wrote in message
news:op.tf2mdvein9ig5y@.system109.parskhazar.net...
> Hi
> In SQL2000, how can I find what has happened in my DB in particular date?
> for example I insert a ne row in table1 and I update 2 rows in table2. now
> how can find what did I perfome?
> I don't want to monitor the changes simentanously, I want to refer to them
> afre some times.
> should I refer to .log file of my db?(if ye ,how?) or should I do
> something else?
> any help would be thanked.|||you could enable c2 auditing as many gov types are forced to do.
mike.menard
"M" <rez1824@.yahoo.co.uk> wrote in message
news:op.tf2mdvein9ig5y@.system109.parskhazar.net...
> Hi
> In SQL2000, how can I find what has happened in my DB in particular date?
> for example I insert a ne row in table1 and I update 2 rows in table2. now
> how can find what did I perfome?
> I don't want to monitor the changes simentanously, I want to refer to them
> afre some times.
> should I refer to .log file of my db?(if ye ,how?) or should I do
> something else?
> any help would be thanked.|||I think it does it, cause when we set the database in full mode it somehow
save the changes so it can use it when it wants to restore the db based on
the last changes.
is it right?
in other words, if I want to know what has happened during a period of
time should I save the changes as a log file, or is there any place to
have it systematically?
thanks
On Mon, 18 Sep 2006 15:17:22 +0330, Hari Prasad
<hari_prasad_k@.hotmail.com> wrote:

> Hi,
> SQL Server will not log the events by default. In this case probably you
> can
> write triggers to audit the Delete/Insert and Update events.
> Thanks
> Hari
> SQL Server MVP
> "M" <rez1824@.yahoo.co.uk> wrote in message
> news:op.tf2mdvein9ig5y@.system109.parskhazar.net...
>
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/|||Have a look at these:
http://sqlserver2000.databases.aspf...erver-data.html
Andrew J. Kelly SQL MVP
"M" <rez1824@.yahoo.co.uk> wrote in message
news:op.tf33aps8n9ig5y@.system109.parskhazar.net...
>I think it does it, cause when we set the database in full mode it somehow
>save the changes so it can use it when it wants to restore the db based on
>the last changes.
> is it right?
> in other words, if I want to know what has happened during a period of
> time should I save the changes as a log file, or is there any place to
> have it systematically?
> thanks
> On Mon, 18 Sep 2006 15:17:22 +0330, Hari Prasad
> <hari_prasad_k@.hotmail.com> wrote:
>
>
> --
> Using Opera's revolutionary e-mail client: http://www.opera.com/mail/