Showing posts with label inside. Show all posts
Showing posts with label inside. Show all posts

Monday, March 12, 2012

inside user define function can not use getdate() function?

Hi,
I can not use getdate() inside user define function? What can i
replace with that?
Thank you very much!
Best regards,
Florence
The best option is to pass it in...
CREATE FUNCTION YourFunction(@.param1, @.param2, ..., @.TheDate DATETIME)
...
SELECT ColA, ColB, ColC,
dbo.YourFunction(ColA, ColB, ColC, ..., GETDATE())
...
Adam Machanic
SQL Server MVP
http://www.sqljunkies.com/weblog/amachanic
"Florence Lee" <florencelee@.visualsolutions.com.my> wrote in message
news:OlK%23p%23V6EHA.2568@.TK2MSFTNGP10.phx.gbl...
> Hi,
> I can not use getdate() inside user define function? What can i
> replace with that?
> --
> Thank you very much!
> Best regards,
> Florence
>

Friday, March 9, 2012

inside user define function can not use getdate() function?

Hi,
I can not use getdate() inside user define function? What can i
replace with that?
--
Thank you very much!
Best regards,
FlorenceThe best option is to pass it in...
CREATE FUNCTION YourFunction(@.param1, @.param2, ..., @.TheDate DATETIME)
...
SELECT ColA, ColB, ColC,
dbo.YourFunction(ColA, ColB, ColC, ..., GETDATE())
...
Adam Machanic
SQL Server MVP
http://www.sqljunkies.com/weblog/amachanic
--
"Florence Lee" <florencelee@.visualsolutions.com.my> wrote in message
news:OlK%23p%23V6EHA.2568@.TK2MSFTNGP10.phx.gbl...
> Hi,
> I can not use getdate() inside user define function? What can i
> replace with that?
> --
> Thank you very much!
> Best regards,
> Florence
>

inside user define function can not use getdate() function?

Hi,
I can not use getdate() inside user define function? What can i
replace with that?
Thank you very much!
Best regards,
FlorenceThe best option is to pass it in...
CREATE FUNCTION YourFunction(@.param1, @.param2, ..., @.TheDate DATETIME)
...
SELECT ColA, ColB, ColC,
dbo.YourFunction(ColA, ColB, ColC, ..., GETDATE())
...
Adam Machanic
SQL Server MVP
http://www.sqljunkies.com/weblog/amachanic
--
"Florence Lee" <florencelee@.visualsolutions.com.my> wrote in message
news:OlK%23p%23V6EHA.2568@.TK2MSFTNGP10.phx.gbl...
> Hi,
> I can not use getdate() inside user define function? What can i
> replace with that?
> --
> Thank you very much!
> Best regards,
> Florence
>

Inside SQL Server

A couple of years ago, I bought a copy of "Inside SQL Server 7.0" (Ron
Soukup and Kalen Delaney / Microsoft Press). Due to unforeseen
circumstances, I never got around to reading it.
About a week ago, I finaly had time to start reading. I must say I
really enjoy getting to know all the mechanics and inner workings of
SQL Server and some of the backgrounds provided might help me create
more efficient databases.
On the other hand, I am well aware that my professional focus now has
to be on SQL Server 2000, not SQL Server 7.0. While reading, I often
find myself wondering how much of what I read still applies to SQL
Server 2000. Have there been major reworkings of the inner mechanics
of SQL Server between 7.0 or 2000, or is 2000 basically (as I've once
read somewhere) "the same as 7.0 but with XML support thrown in"?
Basically, what I want to know is how I can make the best use of my
limited time and money:
a) Continue reading, but order "Inside SQL Server 2000" as well; check
out the differences between the books when the latter arrives.
b) Order "Inside SQL Server 2000" first. Stop reading for now and read
only the 2000 edition.
c) Don't bother with "Inside SQL Server 2000" until I need information
on specific aspects of SQL Server 2000 (like XML?). Spend the money
saved to treat my children to an extra ice cream.
Any insights on this would be greatly appreciated!
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)Hugo
Creat books
a) Continue reading, but order "Inside SQL Server 2000" as well; check
out the differences between the books when the latter arrives
"Hugo Kornelis" <hugo@.pe_NO_rFact.in_SPAM_fo> wrote in message
news:l7gd501kukf2pj1ia4vo0ud57lojog2m6d@.
4ax.com...
> A couple of years ago, I bought a copy of "Inside SQL Server 7.0" (Ron
> Soukup and Kalen Delaney / Microsoft Press). Due to unforeseen
> circumstances, I never got around to reading it.
> About a week ago, I finaly had time to start reading. I must say I
> really enjoy getting to know all the mechanics and inner workings of
> SQL Server and some of the backgrounds provided might help me create
> more efficient databases.
> On the other hand, I am well aware that my professional focus now has
> to be on SQL Server 2000, not SQL Server 7.0. While reading, I often
> find myself wondering how much of what I read still applies to SQL
> Server 2000. Have there been major reworkings of the inner mechanics
> of SQL Server between 7.0 or 2000, or is 2000 basically (as I've once
> read somewhere) "the same as 7.0 but with XML support thrown in"?
> Basically, what I want to know is how I can make the best use of my
> limited time and money:
> a) Continue reading, but order "Inside SQL Server 2000" as well; check
> out the differences between the books when the latter arrives.
> b) Order "Inside SQL Server 2000" first. Stop reading for now and read
> only the 2000 edition.
> c) Don't bother with "Inside SQL Server 2000" until I need information
> on specific aspects of SQL Server 2000 (like XML?). Spend the money
> saved to treat my children to an extra ice cream.
> Any insights on this would be greatly appreciated!
> Best, Hugo
> --
> (Remove _NO_ and _SPAM_ to get my e-mail address)|||Hugo,
Difficult... I'd say it partly depends on how much you understand and
remember right now. You could continue reading, check differences and use
the second pass as repetition. However, it might not be easy to spot the
differences when you get the 2000 edition, which would suggest stop reading
and wait for a while.
I think the Inside book is great if you are the intended audience, so I
definitely recommend that you go for the 2000 edition. I would probably go
for option B, stop reading and continue when you get the 2000 edition.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"Hugo Kornelis" <hugo@.pe_NO_rFact.in_SPAM_fo> wrote in message
news:l7gd501kukf2pj1ia4vo0ud57lojog2m6d@.
4ax.com...
> A couple of years ago, I bought a copy of "Inside SQL Server 7.0" (Ron
> Soukup and Kalen Delaney / Microsoft Press). Due to unforeseen
> circumstances, I never got around to reading it.
> About a week ago, I finaly had time to start reading. I must say I
> really enjoy getting to know all the mechanics and inner workings of
> SQL Server and some of the backgrounds provided might help me create
> more efficient databases.
> On the other hand, I am well aware that my professional focus now has
> to be on SQL Server 2000, not SQL Server 7.0. While reading, I often
> find myself wondering how much of what I read still applies to SQL
> Server 2000. Have there been major reworkings of the inner mechanics
> of SQL Server between 7.0 or 2000, or is 2000 basically (as I've once
> read somewhere) "the same as 7.0 but with XML support thrown in"?
> Basically, what I want to know is how I can make the best use of my
> limited time and money:
> a) Continue reading, but order "Inside SQL Server 2000" as well; check
> out the differences between the books when the latter arrives.
> b) Order "Inside SQL Server 2000" first. Stop reading for now and read
> only the 2000 edition.
> c) Don't bother with "Inside SQL Server 2000" until I need information
> on specific aspects of SQL Server 2000 (like XML?). Spend the money
> saved to treat my children to an extra ice cream.
> Any insights on this would be greatly appreciated!
> Best, Hugo
> --
> (Remove _NO_ and _SPAM_ to get my e-mail address)|||Tibor
I hold in respect for you, your experience but permit me to be not agree
with you.
There a lots of things which don't change since we read 'inside 7.0'
At this time we can say , hey wait for SQL Server 2005 because inside 2000
might or might not be relevant.
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:ORhWeV0CEHA.2052@.TK2MSFTNGP11.phx.gbl...
> Hugo,
> Difficult... I'd say it partly depends on how much you understand and
> remember right now. You could continue reading, check differences and use
> the second pass as repetition. However, it might not be easy to spot the
> differences when you get the 2000 edition, which would suggest stop
reading
> and wait for a while.
> I think the Inside book is great if you are the intended audience, so I
> definitely recommend that you go for the 2000 edition. I would probably go
> for option B, stop reading and continue when you get the 2000 edition.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
>
> "Hugo Kornelis" <hugo@.pe_NO_rFact.in_SPAM_fo> wrote in message
> news:l7gd501kukf2pj1ia4vo0ud57lojog2m6d@.
4ax.com...
>|||Disagreeing is OK, Uri :-)
Yes, it is a close call, I agree.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:O0gDSl0CEHA.308@.TK2MSFTNGP11.phx.gbl...
> Tibor
> I hold in respect for you, your experience but permit me to be not agree
> with you.
> There a lots of things which don't change since we read 'inside 7.0'
> At this time we can say , hey wait for SQL Server 2005 because inside 2000
> might or might not be relevant.
>
>
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote
in
> message news:ORhWeV0CEHA.2052@.TK2MSFTNGP11.phx.gbl...
use
> reading
go
>|||Uri Dimant wrote:

> Hugo
> Creat books
> a) Continue reading, but order "Inside SQL Server 2000" as well; check
> out the differences between the books when the latter arrives
I must agree with this. As others have noted that are not that many
differences and I also know that for myself it took me a few reads
before I even fully understood why certain things were important. (Why
did I have to know what a page and extant were?) So I would definably
read the 7 book first, then once you finish that, start reading the 2000
book, then hopefully when you are done with that you can read the 2005
book. Another added benefit of reading 7 before 2000 is that it saves
your 2000 copy from getting worn down so quickly. I'm to the point where
I need to get another copy, except I've been a little leery because I'm
so excited to get a hold of 2005 (Yukon).
Aaron Weiker
http://blogs.sqladvice.com/aweiker
http://aaronweiker.com/|||Hi Hugo
The actual differences between the products are minimal in terms of what is
covered in the 2000 version. There was a slight change to the way rows on a
page are organized and what it means for the rows to be 'in order'. I also
greatly expanded the details of internal index storage and gave indexes
their own chapter. There were also a few small optimizer changes.
But most of the work of the 2000 version was the new features:
LOTS of details on Recovery Models (new feature)
More details on the internals of backup and restore
User Defined Functions, creation and optimization (this is a brand new
feature)
Lots of details on new database options and ALTER DATABASE
Lots of details about creation and use of Indexed Views for performance
enhancement
Details on 'instead of' triggers
etc.
So if you want details of these NEW features, you need the new version of
the book.
(But, XML is NOT included because in SQL Server 2000, XML is not "Inside"
SQL Server. It is only a thin wrapper around it. )
But, I would think that ice cream for your kids was more important.
However, if you buy the book, the royalties might be enough for me to buy an
extra ice cream for MY kids.
:-)
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Hugo Kornelis" <hugo@.pe_NO_rFact.in_SPAM_fo> wrote in message
news:l7gd501kukf2pj1ia4vo0ud57lojog2m6d@.
4ax.com...
> A couple of years ago, I bought a copy of "Inside SQL Server 7.0" (Ron
> Soukup and Kalen Delaney / Microsoft Press). Due to unforeseen
> circumstances, I never got around to reading it.
> About a week ago, I finaly had time to start reading. I must say I
> really enjoy getting to know all the mechanics and inner workings of
> SQL Server and some of the backgrounds provided might help me create
> more efficient databases.
> On the other hand, I am well aware that my professional focus now has
> to be on SQL Server 2000, not SQL Server 7.0. While reading, I often
> find myself wondering how much of what I read still applies to SQL
> Server 2000. Have there been major reworkings of the inner mechanics
> of SQL Server between 7.0 or 2000, or is 2000 basically (as I've once
> read somewhere) "the same as 7.0 but with XML support thrown in"?
> Basically, what I want to know is how I can make the best use of my
> limited time and money:
> a) Continue reading, but order "Inside SQL Server 2000" as well; check
> out the differences between the books when the latter arrives.
> b) Order "Inside SQL Server 2000" first. Stop reading for now and read
> only the 2000 edition.
> c) Don't bother with "Inside SQL Server 2000" until I need information
> on specific aspects of SQL Server 2000 (like XML?). Spend the money
> saved to treat my children to an extra ice cream.
> Any insights on this would be greatly appreciated!
> Best, Hugo
> --
> (Remove _NO_ and _SPAM_ to get my e-mail address)|||On Tue, 16 Mar 2004 08:28:24 -0800, Kalen Delaney wrote:

>But, I would think that ice cream for your kids was more important.
>However, if you buy the book, the royalties might be enough for me to buy a
n
>extra ice cream for MY kids.
LOL!!
I'll see if my next assignment will earn me enough to buy the book AND
some ice cream. That would make all kids happy.
Thanks, Kalen, for your detailed explanation of the differences. I
didn't even realize how many of the features I use heavily are new.
I'm glad to know that my current reading is not a waste of time, but
you certainly made me eager to start reading about the 2000-specific
deatils as well.
Thanks as well for writing a great book!
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)

Inside MDF file

Hi,
Is there any place where I can learn about the internal structure of a typical database file MDF ?
I'm not planning to do a competitor product Just want to know how it is internally organized.
Any link, articles, books recommendations are welcome.
Thanks,
"Inside SQL Server 2000" is a good start.
"Craig Kenisston" <craigkenisston@.hotmail.com> wrote in message
news:6A1F69A7-DB09-4180-8691-40BB1F2D3202@.microsoft.com...
> Hi,
> Is there any place where I can learn about the internal structure of a
typical database file MDF ?
> I'm not planning to do a competitor product Just want to know how it is
internally organized.
> Any link, articles, books recommendations are welcome.
>
> Thanks,
|||Hi,
Have a look into the below link:-
http://msdn.microsoft.com/library/de...us/architec/8_
ar_da2_9sab.asp
Thanks
Hari
MCDBA
"Craig Kenisston" <craigkenisston@.hotmail.com> wrote in message
news:6A1F69A7-DB09-4180-8691-40BB1F2D3202@.microsoft.com...
> Hi,
> Is there any place where I can learn about the internal structure of a
typical database file MDF ?
> I'm not planning to do a competitor product Just want to know how it is
internally organized.
> Any link, articles, books recommendations are welcome.
>
> Thanks,
|||Inside SQL Server 2000 by Kalen Delaney is one of the best books on the
subject. Books online has some information and Ken Henderson's Guru's Guide
to SQL Server Architecture looks promising (although I have not yet added
this one to my library).
"Craig Kenisston" <craigkenisston@.hotmail.com> wrote in message
news:6A1F69A7-DB09-4180-8691-40BB1F2D3202@.microsoft.com...
> Hi,
> Is there any place where I can learn about the internal structure of a
typical database file MDF ?
> I'm not planning to do a competitor product Just want to know how it is
internally organized.
> Any link, articles, books recommendations are welcome.
>
> Thanks,

Inside MDF file

Hi
Is there any place where I can learn about the internal structure of a typical database file MDF
I'm not planning to do a competitor product :) Just want to know how it is internally organized
Any link, articles, books recommendations are welcome
Thanks,"Inside SQL Server 2000" is a good start.
"Craig Kenisston" <craigkenisston@.hotmail.com> wrote in message
news:6A1F69A7-DB09-4180-8691-40BB1F2D3202@.microsoft.com...
> Hi,
> Is there any place where I can learn about the internal structure of a
typical database file MDF ?
> I'm not planning to do a competitor product :) Just want to know how it is
internally organized.
> Any link, articles, books recommendations are welcome.
>
> Thanks,|||Hi,
Have a look into the below link:-
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/architec/8_
ar_da2_9sab.asp
Thanks
Hari
MCDBA
"Craig Kenisston" <craigkenisston@.hotmail.com> wrote in message
news:6A1F69A7-DB09-4180-8691-40BB1F2D3202@.microsoft.com...
> Hi,
> Is there any place where I can learn about the internal structure of a
typical database file MDF ?
> I'm not planning to do a competitor product :) Just want to know how it is
internally organized.
> Any link, articles, books recommendations are welcome.
>
> Thanks,|||Inside SQL Server 2000 by Kalen Delaney is one of the best books on the
subject. Books online has some information and Ken Henderson's Guru's Guide
to SQL Server Architecture looks promising (although I have not yet added
this one to my library).
"Craig Kenisston" <craigkenisston@.hotmail.com> wrote in message
news:6A1F69A7-DB09-4180-8691-40BB1F2D3202@.microsoft.com...
> Hi,
> Is there any place where I can learn about the internal structure of a
typical database file MDF ?
> I'm not planning to do a competitor product :) Just want to know how it is
internally organized.
> Any link, articles, books recommendations are welcome.
>
> Thanks,

Inside MDF file

Hi,
Is there any place where I can learn about the internal structure of a typic
al database file MDF ?
I'm not planning to do a competitor product Just want to know how it is i
nternally organized.
Any link, articles, books recommendations are welcome.
Thanks,"Inside SQL Server 2000" is a good start.
"Craig Kenisston" <craigkenisston@.hotmail.com> wrote in message
news:6A1F69A7-DB09-4180-8691-40BB1F2D3202@.microsoft.com...
> Hi,
> Is there any place where I can learn about the internal structure of a
typical database file MDF ?
> I'm not planning to do a competitor product Just want to know how it is
internally organized.
> Any link, articles, books recommendations are welcome.
>
> Thanks,|||Hi,
Have a look into the below link:-
http://msdn.microsoft.com/library/d...-us/architec/8_
ar_da2_9sab.asp
Thanks
Hari
MCDBA
"Craig Kenisston" <craigkenisston@.hotmail.com> wrote in message
news:6A1F69A7-DB09-4180-8691-40BB1F2D3202@.microsoft.com...
> Hi,
> Is there any place where I can learn about the internal structure of a
typical database file MDF ?
> I'm not planning to do a competitor product Just want to know how it is
internally organized.
> Any link, articles, books recommendations are welcome.
>
> Thanks,|||Inside SQL Server 2000 by Kalen Delaney is one of the best books on the
subject. Books online has some information and Ken Henderson's Guru's Guide
to SQL Server Architecture looks promising (although I have not yet added
this one to my library).
"Craig Kenisston" <craigkenisston@.hotmail.com> wrote in message
news:6A1F69A7-DB09-4180-8691-40BB1F2D3202@.microsoft.com...
> Hi,
> Is there any place where I can learn about the internal structure of a
typical database file MDF ?
> I'm not planning to do a competitor product Just want to know how it is
internally organized.
> Any link, articles, books recommendations are welcome.
>
> Thanks,

Inside Info....

Anyone one have any inside info on SQL Server 2005... More specifically on
the version that will be avaiable... Such as what will MSDE become? Same
limitations as msde in the sql 05 version? Any info would be great...
Thanks,
Anthony NystromAnthony Nystrom wrote:
> Anyone one have any inside info on SQL Server 2005... More
> specifically on the version that will be avaiable... Such as what
> will MSDE become? Same limitations as msde in the sql 05 version?
> Any info would be great...
> Thanks,
> Anthony Nystrom
You can use the "MSDE" version of SQL Server 2005 now. It's called SQL
Server 2005 Express and you can download the beta here:
http://www.microsoft.com/sql/msde/default.asp
David G.

Inside Info....

Anyone one have any inside info on SQL Server 2005... More specifically on
the version that will be avaiable... Such as what will MSDE become? Same
limitations as msde in the sql 05 version? Any info would be great...
Thanks,
Anthony Nystrom
Anthony Nystrom wrote:
> Anyone one have any inside info on SQL Server 2005... More
> specifically on the version that will be avaiable... Such as what
> will MSDE become? Same limitations as msde in the sql 05 version?
> Any info would be great...
> Thanks,
> Anthony Nystrom
You can use the "MSDE" version of SQL Server 2005 now. It's called SQL
Server 2005 Express and you can download the beta here:
http://www.microsoft.com/sql/msde/default.asp
David G.

Inside Common Table Expressions (CTE)

Hello all.
I would like to know exacly what improvements does CTE offers to compare its
performance to Table Variables for the perpouse of 'Paging' through data.
I curently build a table variable (i.e: @.return(rowid int identity, matchid
int)), populate it with matching ids and select from @.return where rowid
between N and N.
What advantages, if any does CTE have over the above solution?
What advantages, if any does CTE have over Cursor 'Paging'?
What details can you provide about the CTEs inner workings?
Thank you very much, in advance, for all your help!
- Eyal ZinderSome of what you are asking with regard to paging
may be answered here
http://www.aspfaq.com/show.asp?id=2120
There isn't a CTE sample but my own using
ROW_NUMBER()...OVER didn't perform significantly
better than the "RowCount" version.

Inside a project you lose the control?

I've got a project with 12 packages. One of them runnning and at the same time when I try to alter another one or even add a new task I see that all the tasks on toolbox are disabled.

Why?

I would like to hear a good reason for this behaviour, afaik I don't get the point...

Often the packages in one project call into each other, so if one of them is currently executing - there is a good chance others will be running as well. Although I agree this might be too restrictive sometimes - please file a suggestion to relax this behavior for next version.|||

Michael Entin - MSFT wrote:

please file a suggestion to relax this behavior for next version.

suggestions may be submitted here: https://connect.microsoft.com/feedback/default.aspx?SiteID=68

Friday, February 24, 2012

Inserting Records via Stored Procedure

I am trying to insert a record in a SQL2005 Express database. I can use the sp fine and it works inside of the database, but when I try to launch it via ASP.NET it fails...

here is the code. I realize it is not complete, but the only required field is defined via hard code. The error I am getting states it cannot find "sp_InserOrder"

===

ProtectedSub Button1_Click(ByVal senderAsObject,ByVal eAs System.EventArgs)Handles Button1.Click

Dim connAs SqlConnection =Nothing

Dim transAs SqlTransaction =Nothing

Dim cmdAs SqlCommand

conn =New SqlConnection(ConfigurationManager.ConnectionStrings("PartsConnectionString").ConnectionString)

conn.Open()

trans = conn.BeginTransaction

cmd =New SqlCommand()

cmd.Connection = conn

cmd.Transaction = trans

cmd.CommandText ="usp_InserOrder"

cmd.CommandType = Data.CommandType.StoredProcedure

cmd.Parameters.Add("@.MaterialID", Data.SqlDbType.Int)

cmd.Parameters.Add("@.OpenItem", Data.SqlDbType.Bit)

cmd.Parameters("@.MaterialID").Value = 3

cmd.ExecuteNonQuery()

trans.Commit()

=====

I get an error stating cannot find stored procedure. I added the Network Service account full access to the Web Site Directory, which is currently running locally on Windows XP Pro SP2.

Please help, I am a newb and lost...as you can tell from my code...

Are you absolutely sure that your stored procedure is called usp_InserOrder. It would make more sense if it was called usp_InsertOrder.|||It is called that. That is what I was thinking at firs, but I checked the database and that is what I named it.|||

I ran it inside of SQL 2005 here is the output...

(0 row(s) returned)

@.RETURN_VALUE = 0

Finished running [dbo].[InserOrder].

|||You code should read -cmd.CommandText ="InserOrder" as that is what it is called in the report you posted above.