Showing posts with label course. Show all posts
Showing posts with label course. Show all posts

Friday, February 24, 2012

Default values for SQL Server Data Types

Hi,

I need to populate some SqlParameter but I temporarily need to populate with a default value for the data type in question. Of course I can work them out, but I was wondering if there is already a way of doing this, from the .Net Classes or from SQL Server but without making a trip to the DB.

Thanks

John

ADO.NET does not have a feature where you can mark a parameter as default (unfortunately).

In general if you don't send the parameter, then the server side default will be used, so you could just omit the parameter to get the default, then add parameters later when you have values to supply. But this may mean rebuilding your parameters collection.

Also, if you need to fetch the actual defaults for a stored procedure parameters, then there is no choice but to make a trip to the server. ADO.NET is not magic. (G)

Tuesday, February 14, 2012

Default port problem

My default port was of course 1433. I recently changed to to 5 digit number
but had some problems with it in Delphi. So I changed it back. Now I can't
get EM to connect. I looked at the db registration settings but nothing in
there about port #. How do I get EM to work again? Also, now it seems that
to run QA I have to include 1433 in the server name when I open up QA
outside of EM. I never had to do that before. Why would this change and how
do I get it back to the way it was (without reinstalling MS SQL 2k).
Thanks,
KeithHi Keith,
On the machine running SQL server go under Programs->Microsoft SQL Server
and run both the Client Network Utility and the Server Network utility. In
both of these, select TCP/IP and select properties. Make sure the port
numbers in both match.
You should then (if possible) restart your SQL service.
If you're still having problems, go back into the mentionned utilities and
look at the preference order of each of the protocols. Let me know what the
order in each is, and I'll try to help further!
Adam
--
Adam J Warne, MCDBA
"Keith G Hicks" wrote:

> My default port was of course 1433. I recently changed to to 5 digit numbe
r
> but had some problems with it in Delphi. So I changed it back. Now I can't
> get EM to connect. I looked at the db registration settings but nothing in
> there about port #. How do I get EM to work again? Also, now it seems that
> to run QA I have to include 1433 in the server name when I open up QA
> outside of EM. I never had to do that before. Why would this change and ho
w
> do I get it back to the way it was (without reinstalling MS SQL 2k).
> Thanks,
> Keith
>
>|||That helped a lot. Thanks :-).
"Adam Warne" <AdamWarne@.discussions.microsoft.com> wrote in message
news:61D96FFA-B230-42B9-AF1E-C8C10F1187A5@.microsoft.com...
Hi Keith,
On the machine running SQL server go under Programs->Microsoft SQL Server
and run both the Client Network Utility and the Server Network utility. In
both of these, select TCP/IP and select properties. Make sure the port
numbers in both match.
You should then (if possible) restart your SQL service.
If you're still having problems, go back into the mentionned utilities and
look at the preference order of each of the protocols. Let me know what the
order in each is, and I'll try to help further!
Adam
--
Adam J Warne, MCDBA
"Keith G Hicks" wrote:

> My default port was of course 1433. I recently changed to to 5 digit
number
> but had some problems with it in Delphi. So I changed it back. Now I can't
> get EM to connect. I looked at the db registration settings but nothing in
> there about port #. How do I get EM to work again? Also, now it seems that
> to run QA I have to include 1433 in the server name when I open up QA
> outside of EM. I never had to do that before. Why would this change and
how
> do I get it back to the way it was (without reinstalling MS SQL 2k).
> Thanks,
> Keith
>
>|||Hi Adam,
I recently changed my default port settings as well and have followed all
the advice that's available, but I have had no luck connecting through my
development platform - Delphi. Things worked fine until I changed port
settings. Is there somewhere else to check for settings, such as the
registry, that could be causing problems? I'm also hearing that different
versions of MDAC are producing varying results in Delphi.
Bill
"Adam Warne" <AdamWarne@.discussions.microsoft.com> wrote in message
news:61D96FFA-B230-42B9-AF1E-C8C10F1187A5@.microsoft.com...
> Hi Keith,
> On the machine running SQL server go under Programs->Microsoft SQL Server
> and run both the Client Network Utility and the Server Network utility.
> In
> both of these, select TCP/IP and select properties. Make sure the port
> numbers in both match.
> You should then (if possible) restart your SQL service.
> If you're still having problems, go back into the mentionned utilities and
> look at the preference order of each of the protocols. Let me know what
> the
> order in each is, and I'll try to help further!
> Adam
> --
> Adam J Warne, MCDBA
>
> "Keith G Hicks" wrote:
>