Hi,
At a high level, this is what I need to do in a stored procedure:
CREATE VIEW TEMP_VIEW AS
SELECT * FROM SOURCE_XLS...Sheet1$
-the reason for creating the view is that the number of columns in Sheet1$ is not static.
By creating the view, I then can determine with sysobject/syscolumns how many columns I have to process for each row.
DECLARE my_cursor CURSOR
FOR SELECT * FROM TEMP_VIEW
OPEN my_cursor
DECLARE ? ?
FETCH NEXT FROM my_cursor INTO ??
WHILE <etc>
DO STUFF WITH EACH COLUMN IN THAT ROW (as noted above, this will never be a static list of columns)
END
CLOSE my_cursor
DEALLOCATE my_cursor
so, Im obviously stuck on what Im going to fetch my_cursor into. Am I limited to scalar types?
and, inside the WHILE loop, can I refer to the columns by their index (i.e. which column number they are in the result set as opposed to the name)
or is it back to the drawing board for a completely different approach.
Thanks for any input.
Cheers,
David.came up with a better approach...ignore the above.|||Very good!
-PatP
Showing posts with label level. Show all posts
Showing posts with label level. Show all posts
Friday, March 9, 2012
Moving Source
Wednesday, March 7, 2012
Moving production server to new box
I'm moving my prod server to a new box. Is the plan below
workable ?
I install the new server at the same SP level as the old
server.
I copy the mdf and ldf files to the new location.
I over write the mdf and ldf files for master with the old
servers copy.
I restart the server.
Since the directory structure is different, I assume that
master will come up but other db's will be suspect.
I update sysdatbases to point to the correct path for the
user databases.
I restart the server.
Is this too simplistic 'Please read this article, and do not move or overwrite MDF/LDF files with
the server shut down!:
http://support.microsoft.com/?kbid=224071
"Jack A" <anonymous@.discussions.microsoft.com> wrote in message
news:1411901c41370$84d51b00$a301280a@.phx
.gbl...
> I'm moving my prod server to a new box. Is the plan below
> workable ?
> I install the new server at the same SP level as the old
> server.
> I copy the mdf and ldf files to the new location.
> I over write the mdf and ldf files for master with the old
> servers copy.
> I restart the server.
> Since the directory structure is different, I assume that
> master will come up but other db's will be suspect.
> I update sysdatbases to point to the correct path for the
> user databases.
> I restart the server.
> Is this too simplistic '
>|||A silly question but why not just use the Copy Database Wizard ?
http://msdn.microsoft.com/library/d...>
wiz_0z50.asp
J
-- Jack A wrote: --
I'm moving my prod server to a new box. Is the plan below
workable ?
I install the new server at the same SP level as the old
server.
I copy the mdf and ldf files to the new location.
I over write the mdf and ldf files for master with the old
servers copy.
I restart the server.
Since the directory structure is different, I assume that
master will come up but other db's will be suspect.
I update sysdatbases to point to the correct path for the
user databases.
I restart the server.
Is this too simplistic '|||Can i use this to move from a Sql 7 to Sql 2000. How do I
start the wizard. Cant find it anywhere in the interface.
>--Original Message--
>A silly question but why not just use the Copy Database
Wizard ?
>http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/adminsql/ad_onmigwiz_0z50.asp
>J
> -- Jack A wrote: --
> I'm moving my prod server to a new box. Is the plan
below
> workable ?
> I install the new server at the same SP level as the
old
> server.
> I copy the mdf and ldf files to the new location.
> I over write the mdf and ldf files for master with
the old
> servers copy.
> I restart the server.
> Since the directory structure is different, I assume
that
> master will come up but other db's will be suspect.
> I update sysdatbases to point to the correct path
for the
> user databases.
> I restart the server.
> Is this too simplistic '
>
>.
>|||The problem is if you have different path for the system databases. Move mas
ter and when you then start SQL
Server, it will look for model and tempdb in the *old* path, which might not
exists and SQL Server will not
start if it can't find these databases...
Moving SQL Server Databases
http://www.support.microsoft.com/?id=224071
Moving Databases between Servers
http://www.support.microsoft.com/?id=314546
Using WITH MOVE in a Restore to a New Location with Detach/Attach
http://support.microsoft.com/?id=221465
How To Transfer Logins and Passwords Between SQL Servers
http://www.support.microsoft.com/?id=246133
Mapping Logins & SIDs after a Restore
http://www.support.microsoft.com/?id=298897
Utility to map users to the correct login
http://www.dbmaint.com/SyncSqlLogins.asp
How to Resolve Permission Issues When a Database Is Moved Between SQL Server
s
http://www.support.microsoft.com/?id=240872
User Logon and/or Permission Errors After Restoring Dump
http://www.support.microsoft.com/?id=168001
Disaster Recovery Articles for SQL Server
http://www.support.microsoft.com/?id=307775
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"Jack A" <anonymous@.discussions.microsoft.com> wrote in message
news:1411901c41370$84d51b00$a301280a@.phx
.gbl...
> I'm moving my prod server to a new box. Is the plan below
> workable ?
> I install the new server at the same SP level as the old
> server.
> I copy the mdf and ldf files to the new location.
> I over write the mdf and ldf files for master with the old
> servers copy.
> I restart the server.
> Since the directory structure is different, I assume that
> master will come up but other db's will be suspect.
> I update sysdatbases to point to the correct path for the
> user databases.
> I restart the server.
> Is this too simplistic '
>|||HI
SQL 2000 Enterprise Manager: click 'Run a Wizard' button (or tools menu - Wi
zards...). Expand 'Management' and select 'Copy Database Wizard'.
Select a Source Server: Your old SQL 7.0 server. ...
-- Jack A wrote: --
Can i use this to move from a Sql 7 to Sql 2000. How do I
start the wizard. Cant find it anywhere in the interface.
>--Original Message--
>A silly question but why not just use the Copy Database
Wizard ?
url=/library/en-us/adminsql/ad_onmigwiz_0z50.asp
below
> workable ?
old
> server.
> I over write the mdf and ldf files for master with
the old
> servers copy.
> I restart the server.
> Since the directory structure is different, I assume
that
> master will come up but other db's will be suspect.
> I update sysdatbases to point to the correct path
for the
> user databases.
> I restart the server.
>
workable ?
I install the new server at the same SP level as the old
server.
I copy the mdf and ldf files to the new location.
I over write the mdf and ldf files for master with the old
servers copy.
I restart the server.
Since the directory structure is different, I assume that
master will come up but other db's will be suspect.
I update sysdatbases to point to the correct path for the
user databases.
I restart the server.
Is this too simplistic 'Please read this article, and do not move or overwrite MDF/LDF files with
the server shut down!:
http://support.microsoft.com/?kbid=224071
"Jack A" <anonymous@.discussions.microsoft.com> wrote in message
news:1411901c41370$84d51b00$a301280a@.phx
.gbl...
> I'm moving my prod server to a new box. Is the plan below
> workable ?
> I install the new server at the same SP level as the old
> server.
> I copy the mdf and ldf files to the new location.
> I over write the mdf and ldf files for master with the old
> servers copy.
> I restart the server.
> Since the directory structure is different, I assume that
> master will come up but other db's will be suspect.
> I update sysdatbases to point to the correct path for the
> user databases.
> I restart the server.
> Is this too simplistic '
>|||A silly question but why not just use the Copy Database Wizard ?
http://msdn.microsoft.com/library/d...>
wiz_0z50.asp
J
-- Jack A wrote: --
I'm moving my prod server to a new box. Is the plan below
workable ?
I install the new server at the same SP level as the old
server.
I copy the mdf and ldf files to the new location.
I over write the mdf and ldf files for master with the old
servers copy.
I restart the server.
Since the directory structure is different, I assume that
master will come up but other db's will be suspect.
I update sysdatbases to point to the correct path for the
user databases.
I restart the server.
Is this too simplistic '|||Can i use this to move from a Sql 7 to Sql 2000. How do I
start the wizard. Cant find it anywhere in the interface.
>--Original Message--
>A silly question but why not just use the Copy Database
Wizard ?
>http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/adminsql/ad_onmigwiz_0z50.asp
>J
> -- Jack A wrote: --
> I'm moving my prod server to a new box. Is the plan
below
> workable ?
> I install the new server at the same SP level as the
old
> server.
> I copy the mdf and ldf files to the new location.
> I over write the mdf and ldf files for master with
the old
> servers copy.
> I restart the server.
> Since the directory structure is different, I assume
that
> master will come up but other db's will be suspect.
> I update sysdatbases to point to the correct path
for the
> user databases.
> I restart the server.
> Is this too simplistic '
>
>.
>|||The problem is if you have different path for the system databases. Move mas
ter and when you then start SQL
Server, it will look for model and tempdb in the *old* path, which might not
exists and SQL Server will not
start if it can't find these databases...
Moving SQL Server Databases
http://www.support.microsoft.com/?id=224071
Moving Databases between Servers
http://www.support.microsoft.com/?id=314546
Using WITH MOVE in a Restore to a New Location with Detach/Attach
http://support.microsoft.com/?id=221465
How To Transfer Logins and Passwords Between SQL Servers
http://www.support.microsoft.com/?id=246133
Mapping Logins & SIDs after a Restore
http://www.support.microsoft.com/?id=298897
Utility to map users to the correct login
http://www.dbmaint.com/SyncSqlLogins.asp
How to Resolve Permission Issues When a Database Is Moved Between SQL Server
s
http://www.support.microsoft.com/?id=240872
User Logon and/or Permission Errors After Restoring Dump
http://www.support.microsoft.com/?id=168001
Disaster Recovery Articles for SQL Server
http://www.support.microsoft.com/?id=307775
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"Jack A" <anonymous@.discussions.microsoft.com> wrote in message
news:1411901c41370$84d51b00$a301280a@.phx
.gbl...
> I'm moving my prod server to a new box. Is the plan below
> workable ?
> I install the new server at the same SP level as the old
> server.
> I copy the mdf and ldf files to the new location.
> I over write the mdf and ldf files for master with the old
> servers copy.
> I restart the server.
> Since the directory structure is different, I assume that
> master will come up but other db's will be suspect.
> I update sysdatbases to point to the correct path for the
> user databases.
> I restart the server.
> Is this too simplistic '
>|||HI
SQL 2000 Enterprise Manager: click 'Run a Wizard' button (or tools menu - Wi
zards...). Expand 'Management' and select 'Copy Database Wizard'.
Select a Source Server: Your old SQL 7.0 server. ...
-- Jack A wrote: --
Can i use this to move from a Sql 7 to Sql 2000. How do I
start the wizard. Cant find it anywhere in the interface.
>--Original Message--
>A silly question but why not just use the Copy Database
Wizard ?
url=/library/en-us/adminsql/ad_onmigwiz_0z50.asp
below
> workable ?
old
> server.
> I over write the mdf and ldf files for master with
the old
> servers copy.
> I restart the server.
> Since the directory structure is different, I assume
that
> master will come up but other db's will be suspect.
> I update sysdatbases to point to the correct path
for the
> user databases.
> I restart the server.
>
Subscribe to:
Posts (Atom)