Is there any way of comparing specific rows in a table? i.e. I want to delete one of two rows in a table (that also has more rows in it other than the 2 i want to compare). Basicaly, each of the rows have a date field and a unique idtntifier, I want to compare two rows against each other using the unique indetifier and delete the one with the earliest date.
Anyone know how this can be done?
appreciated.......Please send sample script that create this two tables and inset couple of rows. This will be the best way to help you.
Eyal|||as the term unique identifier already states, it is unique. This means that you can't compare on that field. Isn't there another 'identifying' column (a foreign key)? Otherwise, if all columns except the identifier and date compare all columns to each other.
Showing posts with label specific. Show all posts
Showing posts with label specific. Show all posts
Tuesday, March 27, 2012
Thursday, March 22, 2012
Comparing data model
All,
An up gradation is going on in my project. Here, I have some tables
in a project specific database and the same (w.r.t name) set of tables
(but the modified one) in a different database. We are using
sqlserver2000.
Now I need to find out what are modifications- means the name &
features of the new columns.
Just by looking the table's structure and manually comparing it, the
work can be done.
If any one knows any approach that can compare the two tables (with the
same name residing in different db) then the work can be done more
effectively.
Any input will be highly appreciated.Not sure if this is what you need. There is a tool to compare
schema/structure of databases, Red Gate SQL Compare. www.red-gate.com.
Ben Nevarez, MCDBA, OCP
Database Administrator
"MUKUT" wrote:
> All,
> An up gradation is going on in my project. Here, I have some tables
> in a project specific database and the same (w.r.t name) set of tables
> (but the modified one) in a different database. We are using
> sqlserver2000.
> Now I need to find out what are modifications- means the name &
> features of the new columns.
> Just by looking the table's structure and manually comparing it, the
> work can be done.
> If any one knows any approach that can compare the two tables (with the
> same name residing in different db) then the work can be done more
> effectively.
> Any input will be highly appreciated.
>|||If you are willing to use a Java-based tool in your environment, you
can use SchemaCrawler, a free open-source tool that can compare schemas
as well as data. SchemaCrawler is a command-line tool to output your
database schema and data in a readable form. The output is designed to
be diff-ed with previous versions of your database schema.
http://schemacrawler.sourceforge.net/
All you will need is a JDBC driver, a good free one is jTDS
(http://jtds.sourceforge.net/) and any diff tool such as WinMerge.
Sualeh Fatehi.
An up gradation is going on in my project. Here, I have some tables
in a project specific database and the same (w.r.t name) set of tables
(but the modified one) in a different database. We are using
sqlserver2000.
Now I need to find out what are modifications- means the name &
features of the new columns.
Just by looking the table's structure and manually comparing it, the
work can be done.
If any one knows any approach that can compare the two tables (with the
same name residing in different db) then the work can be done more
effectively.
Any input will be highly appreciated.Not sure if this is what you need. There is a tool to compare
schema/structure of databases, Red Gate SQL Compare. www.red-gate.com.
Ben Nevarez, MCDBA, OCP
Database Administrator
"MUKUT" wrote:
> All,
> An up gradation is going on in my project. Here, I have some tables
> in a project specific database and the same (w.r.t name) set of tables
> (but the modified one) in a different database. We are using
> sqlserver2000.
> Now I need to find out what are modifications- means the name &
> features of the new columns.
> Just by looking the table's structure and manually comparing it, the
> work can be done.
> If any one knows any approach that can compare the two tables (with the
> same name residing in different db) then the work can be done more
> effectively.
> Any input will be highly appreciated.
>|||If you are willing to use a Java-based tool in your environment, you
can use SchemaCrawler, a free open-source tool that can compare schemas
as well as data. SchemaCrawler is a command-line tool to output your
database schema and data in a readable form. The output is designed to
be diff-ed with previous versions of your database schema.
http://schemacrawler.sourceforge.net/
All you will need is a JDBC driver, a good free one is jTDS
(http://jtds.sourceforge.net/) and any diff tool such as WinMerge.
Sualeh Fatehi.
Sunday, March 11, 2012
Compare Permissions Between Databases
I need to compare the permissions for a specific user between two databases
for views, tables, and stored procedures, to make sure that they are the
same.
If I could just figure out how to extract the data from each database, I
don't mind a certain level of manual comparison in Excel.
I have been digging around the syspermissions table, but can't find the
access level that has been granted/denied.
Any suggestions?
Thanks!Look up the PERMISSIONS function in SQL Server Books Online. It returns a
bitmap which can be massaged in t-SQL to retreive the object/statement
permissions.
Anith
for views, tables, and stored procedures, to make sure that they are the
same.
If I could just figure out how to extract the data from each database, I
don't mind a certain level of manual comparison in Excel.
I have been digging around the syspermissions table, but can't find the
access level that has been granted/denied.
Any suggestions?
Thanks!Look up the PERMISSIONS function in SQL Server Books Online. It returns a
bitmap which can be massaged in t-SQL to retreive the object/statement
permissions.
Anith
Sunday, February 12, 2012
Command Line SQL Server Shutdown??
I need to write a script to run at a specific time to shutdown a
SQL Server. I also need to start the SQL Server back up.
Does anyone know the command line that could be used in a BAT script
to shutdown and then restart a SQL Server v.7
Please reply via email and post
Thanks in Advance,
JohnJohn,
You can use NET STOP and NET START, as in
net stop MSSQLServer
net start MSSQLServer
Please note that if sqlserveragent is dependent, then stop that service
first before stopping SQLServer service.These commands are documented in
BooksOnLine.
Dinesh
SQL Server MVP
--
--
SQL Server FAQ at
http://www.tkdinesh.com
"John" <jkimb@.kimberlyconsulting.com> wrote in message
news:pan.2004.05.07.21.19.25.367752@.kimberlyconsulting.com...
> I need to write a script to run at a specific time to shutdown a
> SQL Server. I also need to start the SQL Server back up.
> Does anyone know the command line that could be used in a BAT script
> to shutdown and then restart a SQL Server v.7
> Please reply via email and post
> Thanks in Advance,
> John
>|||"Dinesh T.K" <tkdinesh@.nospam.mail.tkdinesh.com> wrote in message
news:uEvi3qHNEHA.2064@.TK2MSFTNGP12.phx.gbl...
> John,
> You can use NET STOP and NET START, as in
> net stop MSSQLServer
> net start MSSQLServer
> Please note that if sqlserveragent is dependent, then stop that service
> first before stopping SQLServer service.These commands are documented in
> BooksOnLine.
In that case net stop mssqlserver /y also stops dependent services
SQL Server. I also need to start the SQL Server back up.
Does anyone know the command line that could be used in a BAT script
to shutdown and then restart a SQL Server v.7
Please reply via email and post
Thanks in Advance,
JohnJohn,
You can use NET STOP and NET START, as in
net stop MSSQLServer
net start MSSQLServer
Please note that if sqlserveragent is dependent, then stop that service
first before stopping SQLServer service.These commands are documented in
BooksOnLine.
Dinesh
SQL Server MVP
--
--
SQL Server FAQ at
http://www.tkdinesh.com
"John" <jkimb@.kimberlyconsulting.com> wrote in message
news:pan.2004.05.07.21.19.25.367752@.kimberlyconsulting.com...
> I need to write a script to run at a specific time to shutdown a
> SQL Server. I also need to start the SQL Server back up.
> Does anyone know the command line that could be used in a BAT script
> to shutdown and then restart a SQL Server v.7
> Please reply via email and post
> Thanks in Advance,
> John
>|||"Dinesh T.K" <tkdinesh@.nospam.mail.tkdinesh.com> wrote in message
news:uEvi3qHNEHA.2064@.TK2MSFTNGP12.phx.gbl...
> John,
> You can use NET STOP and NET START, as in
> net stop MSSQLServer
> net start MSSQLServer
> Please note that if sqlserveragent is dependent, then stop that service
> first before stopping SQLServer service.These commands are documented in
> BooksOnLine.
In that case net stop mssqlserver /y also stops dependent services

Command Line SQL Server Shutdown??
I need to write a script to run at a specific time to shutdown a
SQL Server. I also need to start the SQL Server back up.
Does anyone know the command line that could be used in a BAT script
to shutdown and then restart a SQL Server v.7
Please reply via email and post
Thanks in Advance,
John
John,
You can use NET STOP and NET START, as in
net stop MSSQLServer
net start MSSQLServer
Please note that if sqlserveragent is dependent, then stop that service
first before stopping SQLServer service.These commands are documented in
BooksOnLine.
Dinesh
SQL Server MVP
--
SQL Server FAQ at
http://www.tkdinesh.com
"John" <jkimb@.kimberlyconsulting.com> wrote in message
news:pan.2004.05.07.21.19.25.367752@.kimberlyconsul ting.com...
> I need to write a script to run at a specific time to shutdown a
> SQL Server. I also need to start the SQL Server back up.
> Does anyone know the command line that could be used in a BAT script
> to shutdown and then restart a SQL Server v.7
> Please reply via email and post
> Thanks in Advance,
> John
>
|||"Dinesh T.K" <tkdinesh@.nospam.mail.tkdinesh.com> wrote in message
news:uEvi3qHNEHA.2064@.TK2MSFTNGP12.phx.gbl...
> John,
> You can use NET STOP and NET START, as in
> net stop MSSQLServer
> net start MSSQLServer
> Please note that if sqlserveragent is dependent, then stop that service
> first before stopping SQLServer service.These commands are documented in
> BooksOnLine.
In that case net stop mssqlserver /y also stops dependent services
SQL Server. I also need to start the SQL Server back up.
Does anyone know the command line that could be used in a BAT script
to shutdown and then restart a SQL Server v.7
Please reply via email and post
Thanks in Advance,
John
John,
You can use NET STOP and NET START, as in
net stop MSSQLServer
net start MSSQLServer
Please note that if sqlserveragent is dependent, then stop that service
first before stopping SQLServer service.These commands are documented in
BooksOnLine.
Dinesh
SQL Server MVP
--
SQL Server FAQ at
http://www.tkdinesh.com
"John" <jkimb@.kimberlyconsulting.com> wrote in message
news:pan.2004.05.07.21.19.25.367752@.kimberlyconsul ting.com...
> I need to write a script to run at a specific time to shutdown a
> SQL Server. I also need to start the SQL Server back up.
> Does anyone know the command line that could be used in a BAT script
> to shutdown and then restart a SQL Server v.7
> Please reply via email and post
> Thanks in Advance,
> John
>
|||"Dinesh T.K" <tkdinesh@.nospam.mail.tkdinesh.com> wrote in message
news:uEvi3qHNEHA.2064@.TK2MSFTNGP12.phx.gbl...
> John,
> You can use NET STOP and NET START, as in
> net stop MSSQLServer
> net start MSSQLServer
> Please note that if sqlserveragent is dependent, then stop that service
> first before stopping SQLServer service.These commands are documented in
> BooksOnLine.
In that case net stop mssqlserver /y also stops dependent services

Command line printing to specific printers, and specific trays
Hi All,
Could you guys please help me with printing reports invoked thru command line/ URL access to print automatically to specific printers and specific trays and also is it possible to set the specific printer and tray as parameters.
Any suggestions is appreciated
Thanks A lot in advance
e,g :
http://localhost/reportserver?/testreports/employee sales&UserID='ABC'&LName=Lastname='victor'&rs:Command=Render
There are no url parameters to make the report automatically print. You can print using the ActiveX control that ships with RS 2005 or you could look into using the printer delivery sample for printing your reports.
Subscribe to:
Posts (Atom)