|
Have a database project in your code which will have all the scripts logically placed in separate folders. Database will not do this for you. Either usea source control software or take regular backups. Former, IMHO, is simpler and suitable for your requirement.
If you don't have a DB backup, you cannot revert back unless you manually edit things.
|
|
|
|
|
We use code version tool. We also include the version number as comments in stored procedures and functions. Out versioning tool automatically applies the versioning comments.
|
|
|
|
|
As d@nish said, you'd best keep a copy of your procedures in a safe location. The database itself doesn't version the procedures, there's no change-history by default.
Try restoring a database-backup that contains the correct version of the sp's.
--edit; (to prevent this)
- Script your entire database, in the version that you're releasing to the customer(s).
- Archive them somewhere safe (SourceSafe - don't forget to label it, or even burned and nicely indexed on CD)
- Include all unit-tests for your procdures!
- Consider whether the sprocs have any dependencies themselves, like functions, views or other procedures.
- A scripter[^] might come in handy.
I are Troll
modified on Thursday, August 26, 2010 6:22 PM
|
|
|
|
|
Eddy Vluggen wrote: The database itself doesn't version the procedures,
Another argument against using stored procedures.
|
|
|
|
|
The database does not version any objects [Tables, Views, Triggers, Functions and Stored Procedures]; so using your argument, should we avoid databases altogether?
|
|
|
|
|
SilimSayo wrote:
PIEBALDConsult wrote: Another argument against using stored procedures.
The database does not version any objects [Tables, Views, Triggers, Functions and Stored Procedures]; so using your argument, should we avoid databases altogether?
It's not the non-versioning that's bad, it's sproc's. PI isn't saying that the database should do versioning, he just found an argument against sprocs. Like the argument or not, inline Sql usually gets backed up with the source.
Yes, some people will prefer sprocs. I prefer whatever my client pays me to, as it's kinda easy to switch between the two.
Yes, we can start a religious argument on the topic, but that shouldn't be part of the answer. How 'bout the lounge?
I are Troll
|
|
|
|
|
A database is for data; not code. Use a code base for code.
|
|
|
|
|
Indeed... So all those big database vendors must have been damn to include programming(coding) capabilities.
|
|
|
|
|
this is a newbie question:
I'm trying to download and install Microsoft SQL Server Express 2008.
When I search the Net (MSDN included), i see several listings and variants of the name:
1) MS SQL Server Express 2008
2) SQL Server 2008 R2 Express
3) SQL Server Management Studio Express
4) MS Server 2008 R2
others...
Is there a difference between 1) and 4)? (32/64 bit variations??)
3) SQL Server Management Studio Express look good as an "all-arounder" (manage users, etc...) Would you recommend?
* What is the most current Microsoft SQL Server?
* What is the most current FREE Microsoft SQL Server?
Thank you for helping me understand this.
Regards,
JJM
|
|
|
|
|
You should get SQL Server 2008 R2 Express WITH SQL Server Management Studio 2008 R2 (SSMS).
See here : http://www.microsoft.com/express/database/[^]
Choose the right version (32/64).
Cheers
I don't like my signature at all
|
|
|
|
|
I was tending toward the "SQL Server Management Studio Express", but then was reading the WiKi for Microsoft SQL Server:
http://en.wikipedia.org/wiki/Microsoft_SQL_Server[^]
I will be using PowerShell at some point and some users are accustomed to working in Unix world with scripts (hence the PowerShell).
PLUS, i think we're doing our development on the cheap (FREE version required).
Does your suggestion still fit the bill?
Thanks so much!
John John
|
|
|
|
|
Yes.
SQL Server is the service needed to access your databases. The express editions are the free versions of it. There are limitations, for instance a 10GB maximum of data.
SSMS is a management tool to perform maintenance on your DB's (located on various servers). Without it you're condemned to commandline tooling, nothing wrong with that but tedious for adhoc tasks.
AFAIK Powershell is a prerequisite for SQL Server.
For developement there is VS Express, also with limitations compared to the paid product.
Cheers
I don't like my signature at all
|
|
|
|
|
I think Express has a 4gb limit on the size of the database. Not generally a problem if you are aware of it!.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
R2 has an increased limit (I hear).
|
|
|
|
|
Yes, that's the one to get.
|
|
|
|
|
I agree with Estys that SQL Express R2 is the one to get, but I wanted to answer the question you had.
The difference between 1 and 4 is that 4 is the MS Service 2008 R2 operating system and not a database. It is the OS for a server.
Steve Maier
|
|
|
|
|
Cool! Thanks. I was thrown some loose requirements and some info on past configuration (maybe misquoted the past configuration, server/service,....)
I am installing this on a Windows Server 2008 R2 64-bit system. Eventually, i'm going to be adding some features to integrate MS Access 2007, Visual C++ (Studio 2008 Ed) code, some stored procedures (which i think are created/reside in my C++ generated executable), PowerShell.
Thanks all for the input and advice.
Regards,
John John
|
|
|
|
|
Hi All,
If I have two tables both with a varchar(50) field called Name how do i get just James2 to return?
Table 1 has one record 'James' and Table 2 has two records 'James' & 'James2'.
I've tried all the JOINS but I just cannot get this to work:
SELECT dbo.Table_2.Name
FROM dbo.Table_2
RIGHT JOIN
dbo.Table_1
ON dbo.Table_1.Name = dbo.Table_2.Name
I'm such a SQL Dunce!! Help!
Cheers,
|
|
|
|
|
add:
Where dbo.Table_2.Name = 'James2' ?
Scott
|
|
|
|
|
Do a left join on the name and filter where table2.name is null
Select *
From Table1 T
Left Join Table2 T2 on T.Name = T2.Name
Where T2.Name is NULL
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
|
Hi all,
I am looking at ways to automate the process of getting data from SQL Server 2008 into an Excel (2007) spreadsheet. I would like to set the value of a cell in the spreadsheet to the result of a SELECT COUNT query.
Is this possible?
Regards,
Anthony
modified on Thursday, August 26, 2010 5:21 AM
|
|
|
|
|
anthasaurus wrote: Is this possible?
Yup. Start here[^]
I are Troll
|
|
|
|
|
Greetings,
Apologies if this is a dumb question but I'm afraid my SQL knowledge is a little limited. Anyway I am using SQLCE as I don't need anything bigger at the moment but I have a problem when processing the following command
INSERT INTO [Contact]
([Name]
,[Tel]
,[Mobile]
,[Email])
VALUES
(N'Name'
,N'Tel'
,N'Mobile'
,N'Email');
SELECT @@IDENTITY AS ContactID
My problem is that although this functions correctly when issued by hand, my encapsulation of OLEDB only seems to permit a single command. Now this is the only occasion when I need to issue multiple commands so it seems a shame to have to mess up my existing code just for this instance.
So can anyone suggest how I might merge the above into a single command that INSERTs and gives me the ID of the inserted data?
Or is there a simple way with OLEDB & MFC that I can process multiple recordsets without adding too much overhead.
Any thoughts or suggestions would be appreciated.
Many thanks
Alan
|
|
|
|
|
Here is what I've done in the past ...
SQLtext = "Insert .... blah blah
Select scope_identity()"
' This returned the identity column value that was just created.
ID = sqlCmd.ExecuteScalar()
|
|
|
|