Here's something I've never run into before, and I hope someone can help.
I have two identical SQL2000 databases (DB1 and DB2). Each has a different
name and is part of a different merge scheme. My developer has an
application that writes data from a table in DB1 to an identical table in
DB2, but it's failing. He says that it's because the columns in one table
aren't in the same order as the columns in the other table. E.g., one table
has column19 in the 19th position, and the other table has column19 in the
15th position.
Is there a way to move a column from one position to another without
removing the databases from replication?
I'd really appreciate some help in this.
Thanks,
John Steen
Developers should never ever rely on the column order. Tell your developer
to stop being lazy and specify the columns in the insert statement. If he
doesn't he will introduce some very subtle bugs over time that will be nearly
impossible to track down. I made the same mistake at my first job while I
was still in college and still regret it.
|||Thank, Scott, I'll definitely pass that along to our developer.
Unfortunately, I don't think it's going to fly this time. We're trying to
piece together a quick solution for a short-term problem that will be going
away by the end of the month. He's not going to want to rewrite all his apps
just for that. If there's a way for me to change the position of the column
in the table so the app will work, I'd rather do that.
Thanks,
John
"Scott S." wrote:
> Developers should never ever rely on the column order. Tell your developer
> to stop being lazy and specify the columns in the insert statement. If he
> doesn't he will introduce some very subtle bugs over time that will be nearly
> impossible to track down. I made the same mistake at my first job while I
> was still in college and still regret it.
Showing posts with label ive. Show all posts
Showing posts with label ive. Show all posts
Friday, March 30, 2012
Resolving DNS names from extended stored procedures
I've developed an extended stored procedure in C and want to resolve a
hostname from within the stored procedure using DNS. I use getaddrinfo() to
try and resolve the name. It never works from within the extended stored
procedure when running within SQL Server 2000 (SP3a applied). A hard-coded
IP address does work. The error I get back is WSAHOST_NOT_FOUND (11001). If
I do an NSLOOKUP of the same hostname on the same machine, it works fine, so
the server is configured OK. SQL Server 2000 is running using an account
that does have network access; when I specify an IP address to my stored
procedure, which turns around and establishes a TCP connection to a
specified port and sends XML over the connection, it works.
Are there any known issues resolving DNS names from within extended stored
procedures?
Thanks in advance.
Rick
mailto:rgenter "at" silverlink.com
Are you doing a WSAStartup in your XP?
I have no problems doing gethostbyname to resolve the hostname back to an IP
address.
GertD@.SQLDev.Net
Please reply only to the newsgroups.
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use.
Copyright SQLDev.Net 1991-2004 All rights reserved.
"Rick Genter" <rgenter@.silverlink.com> wrote in message
news:eJhtjM%23qEHA.2604@.TK2MSFTNGP10.phx.gbl...
> I've developed an extended stored procedure in C and want to resolve a
> hostname from within the stored procedure using DNS. I use getaddrinfo()
> to try and resolve the name. It never works from within the extended
> stored procedure when running within SQL Server 2000 (SP3a applied). A
> hard-coded IP address does work. The error I get back is WSAHOST_NOT_FOUND
> (11001). If I do an NSLOOKUP of the same hostname on the same machine, it
> works fine, so the server is configured OK. SQL Server 2000 is running
> using an account that does have network access; when I specify an IP
> address to my stored procedure, which turns around and establishes a TCP
> connection to a specified port and sends XML over the connection, it
> works.
> Are there any known issues resolving DNS names from within extended stored
> procedures?
> Thanks in advance.
> Rick
> --
> mailto:rgenter "at" silverlink.com
>
hostname from within the stored procedure using DNS. I use getaddrinfo() to
try and resolve the name. It never works from within the extended stored
procedure when running within SQL Server 2000 (SP3a applied). A hard-coded
IP address does work. The error I get back is WSAHOST_NOT_FOUND (11001). If
I do an NSLOOKUP of the same hostname on the same machine, it works fine, so
the server is configured OK. SQL Server 2000 is running using an account
that does have network access; when I specify an IP address to my stored
procedure, which turns around and establishes a TCP connection to a
specified port and sends XML over the connection, it works.
Are there any known issues resolving DNS names from within extended stored
procedures?
Thanks in advance.
Rick
mailto:rgenter "at" silverlink.com
Are you doing a WSAStartup in your XP?
I have no problems doing gethostbyname to resolve the hostname back to an IP
address.
GertD@.SQLDev.Net
Please reply only to the newsgroups.
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use.
Copyright SQLDev.Net 1991-2004 All rights reserved.
"Rick Genter" <rgenter@.silverlink.com> wrote in message
news:eJhtjM%23qEHA.2604@.TK2MSFTNGP10.phx.gbl...
> I've developed an extended stored procedure in C and want to resolve a
> hostname from within the stored procedure using DNS. I use getaddrinfo()
> to try and resolve the name. It never works from within the extended
> stored procedure when running within SQL Server 2000 (SP3a applied). A
> hard-coded IP address does work. The error I get back is WSAHOST_NOT_FOUND
> (11001). If I do an NSLOOKUP of the same hostname on the same machine, it
> works fine, so the server is configured OK. SQL Server 2000 is running
> using an account that does have network access; when I specify an IP
> address to my stored procedure, which turns around and establishes a TCP
> connection to a specified port and sends XML over the connection, it
> works.
> Are there any known issues resolving DNS names from within extended stored
> procedures?
> Thanks in advance.
> Rick
> --
> mailto:rgenter "at" silverlink.com
>
Monday, March 26, 2012
Reseting the unique id if a table.
I'm building a web site. there is a database.
I've set a primary key and unique of a field.also I set it to auto numbering.
Everytime I insert a record , that field will increase 1 (type bigint , start from 1).
After lots time of inserting record , the id going to be larger number.. I wondering how can I reset that to zero?
Run query Truncate Table YuorTableName
Friday, March 23, 2012
Reset SA password
I have a need to reset the SA password on our SQL 2000 SP4 Server. Only one
production database is on this server and I've confirmed with the vendor
that the database is not using the SA account for anything.
Under Security, login, I see that I can r/c on SA and change the password
there.
Is that OK to do?
What's the impact of changing the SA password?
Anything else that I'm not thinking of?
Thank you!
Randy
Hi
Take a look atv sp_password stored procedure in the BOL
"RandyH" <RHollaw@.HOTmail.com> wrote in message
news:B69508E4-AFC5-445C-9DD0-CD50054496B9@.microsoft.com...
>I have a need to reset the SA password on our SQL 2000 SP4 Server. Only
>one production database is on this server and I've confirmed with the
>vendor that the database is not using the SA account for anything.
> Under Security, login, I see that I can r/c on SA and change the password
> there.
> Is that OK to do?
> What's the impact of changing the SA password?
> Anything else that I'm not thinking of?
> Thank you!
> Randy
|||Not sure what that means...sql n00b here...
but thanks!
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:u2O%23aEFqHHA.3264@.TK2MSFTNGP04.phx.gbl...
> Hi
> Take a look atv sp_password stored procedure in the BOL
>
>
> "RandyH" <RHollaw@.HOTmail.com> wrote in message
> news:B69508E4-AFC5-445C-9DD0-CD50054496B9@.microsoft.com...
>
|||Thanks, I will use profiler to check that out.
If no one or nothing is using SA, changing the password during production
hours won't affect anything?
"vt" <vinu.t.1976@.gmail.com> wrote in message
news:e%23JhkEFqHHA.1244@.TK2MSFTNGP04.phx.gbl...
> Hi Randy
> If you are 100% sure that, none of your application or users are using sa
> password then you can change it.
> You can use sol profiler to trace wheather some one is using it or not
>
> --
> VT
> Knowledge is power, share it...
> http://oneplace4sql.blogspot.com/
> "RandyH" <RHollaw@.HOTmail.com> wrote in message
> news:B69508E4-AFC5-445C-9DD0-CD50054496B9@.microsoft.com...
>
|||I guess that I'm looking for SA in the LoginName or NTUserName Column?
I've been running it for five minutes, and never saw SA scroll by . . .
"vt" <vinu.t.1976@.gmail.com> wrote in message
news:e%23JhkEFqHHA.1244@.TK2MSFTNGP04.phx.gbl...
> Hi Randy
> If you are 100% sure that, none of your application or users are using sa
> password then you can change it.
> You can use sol profiler to trace wheather some one is using it or not
>
> --
> VT
> Knowledge is power, share it...
> http://oneplace4sql.blogspot.com/
> "RandyH" <RHollaw@.HOTmail.com> wrote in message
> news:B69508E4-AFC5-445C-9DD0-CD50054496B9@.microsoft.com...
>
production database is on this server and I've confirmed with the vendor
that the database is not using the SA account for anything.
Under Security, login, I see that I can r/c on SA and change the password
there.
Is that OK to do?
What's the impact of changing the SA password?
Anything else that I'm not thinking of?
Thank you!
Randy
Hi
Take a look atv sp_password stored procedure in the BOL
"RandyH" <RHollaw@.HOTmail.com> wrote in message
news:B69508E4-AFC5-445C-9DD0-CD50054496B9@.microsoft.com...
>I have a need to reset the SA password on our SQL 2000 SP4 Server. Only
>one production database is on this server and I've confirmed with the
>vendor that the database is not using the SA account for anything.
> Under Security, login, I see that I can r/c on SA and change the password
> there.
> Is that OK to do?
> What's the impact of changing the SA password?
> Anything else that I'm not thinking of?
> Thank you!
> Randy
|||Not sure what that means...sql n00b here...
but thanks!
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:u2O%23aEFqHHA.3264@.TK2MSFTNGP04.phx.gbl...
> Hi
> Take a look atv sp_password stored procedure in the BOL
>
>
> "RandyH" <RHollaw@.HOTmail.com> wrote in message
> news:B69508E4-AFC5-445C-9DD0-CD50054496B9@.microsoft.com...
>
|||Thanks, I will use profiler to check that out.
If no one or nothing is using SA, changing the password during production
hours won't affect anything?
"vt" <vinu.t.1976@.gmail.com> wrote in message
news:e%23JhkEFqHHA.1244@.TK2MSFTNGP04.phx.gbl...
> Hi Randy
> If you are 100% sure that, none of your application or users are using sa
> password then you can change it.
> You can use sol profiler to trace wheather some one is using it or not
>
> --
> VT
> Knowledge is power, share it...
> http://oneplace4sql.blogspot.com/
> "RandyH" <RHollaw@.HOTmail.com> wrote in message
> news:B69508E4-AFC5-445C-9DD0-CD50054496B9@.microsoft.com...
>
|||I guess that I'm looking for SA in the LoginName or NTUserName Column?
I've been running it for five minutes, and never saw SA scroll by . . .
"vt" <vinu.t.1976@.gmail.com> wrote in message
news:e%23JhkEFqHHA.1244@.TK2MSFTNGP04.phx.gbl...
> Hi Randy
> If you are 100% sure that, none of your application or users are using sa
> password then you can change it.
> You can use sol profiler to trace wheather some one is using it or not
>
> --
> VT
> Knowledge is power, share it...
> http://oneplace4sql.blogspot.com/
> "RandyH" <RHollaw@.HOTmail.com> wrote in message
> news:B69508E4-AFC5-445C-9DD0-CD50054496B9@.microsoft.com...
>
Tuesday, February 21, 2012
Repository of databases
Hello,
I've written a tool that analyzes databases. However, to test it out
really well, I need to feed it a lot of different databases. Is there a
place where I can download either .mdf/.ldf set of files or sql scripts
for various databases? A repository of some kind, perhaps.
Thanks.
Backup database and restore it with a different name
"Frank Rizzo" <nospam@.nospam.com> wrote in message
news:OdOQoMs2FHA.3052@.TK2MSFTNGP10.phx.gbl...
> Hello,
> I've written a tool that analyzes databases. However, to test it out
> really well, I need to feed it a lot of different databases. Is there a
> place where I can download either .mdf/.ldf set of files or sql scripts
> for various databases? A repository of some kind, perhaps.
> Thanks.
|||Uri Dimant wrote:
> Backup database and restore it with a different name
I need databases with different schema to really test out the tool.
>
> "Frank Rizzo" <nospam@.nospam.com> wrote in message
> news:OdOQoMs2FHA.3052@.TK2MSFTNGP10.phx.gbl...
>
>
|||Hi Frank,
For Access sample databases, you could download them here
Access 2000 Tutorial: Northwind Traders Sample Database
http://www.microsoft.com/downloads/d...372-8dbe-422b-
8676-c632d66c529c&DisplayLang=en
For SQL sample databases, you could download them here
Northwind and pubs Sample Databases
http://www.microsoft.com/downloads/d...212-0356-46a0-
8da2-eebc53a68034&DisplayLang=en
You may also search download.microsoft.com with "sample" as key word for
more detailed information.
Thank you for your patience and cooperation. If you have any questions or
concerns, don't hesitate to let me know. We are always here to be of
assistance!
Sincerely yours,
Michael Cheng
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
================================================== ===
This posting is provided "AS IS" with no warranties, and confers no rights.
I've written a tool that analyzes databases. However, to test it out
really well, I need to feed it a lot of different databases. Is there a
place where I can download either .mdf/.ldf set of files or sql scripts
for various databases? A repository of some kind, perhaps.
Thanks.
Backup database and restore it with a different name
"Frank Rizzo" <nospam@.nospam.com> wrote in message
news:OdOQoMs2FHA.3052@.TK2MSFTNGP10.phx.gbl...
> Hello,
> I've written a tool that analyzes databases. However, to test it out
> really well, I need to feed it a lot of different databases. Is there a
> place where I can download either .mdf/.ldf set of files or sql scripts
> for various databases? A repository of some kind, perhaps.
> Thanks.
|||Uri Dimant wrote:
> Backup database and restore it with a different name
I need databases with different schema to really test out the tool.
>
> "Frank Rizzo" <nospam@.nospam.com> wrote in message
> news:OdOQoMs2FHA.3052@.TK2MSFTNGP10.phx.gbl...
>
>
|||Hi Frank,
For Access sample databases, you could download them here
Access 2000 Tutorial: Northwind Traders Sample Database
http://www.microsoft.com/downloads/d...372-8dbe-422b-
8676-c632d66c529c&DisplayLang=en
For SQL sample databases, you could download them here
Northwind and pubs Sample Databases
http://www.microsoft.com/downloads/d...212-0356-46a0-
8da2-eebc53a68034&DisplayLang=en
You may also search download.microsoft.com with "sample" as key word for
more detailed information.
Thank you for your patience and cooperation. If you have any questions or
concerns, don't hesitate to let me know. We are always here to be of
assistance!
Sincerely yours,
Michael Cheng
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
================================================== ===
This posting is provided "AS IS" with no warranties, and confers no rights.
Subscribe to:
Posts (Atom)