|
I've been looking around for approach recommendations on how to best update the code for an SQL Server 2005 user defined type written in C#. You can't deploy the type if it is 'in use' - for example, if a field in the database is declared to be of the type of the UDT.
Of course, I usually write perfect code that forsees all future possibilities. ... but on the off chance I might need to update the managed code into a database with real production stuff in it - I'm looking for the best approach to deploy updates to the UDT.
So far, the best I've figured out is that one tests the heck out of the string to type and type to string conversions, and when you want to deploy the update, you change all the UDT columns into strings (which converts the data in place, and frees the assembly from use) deploy the update, and then change all the columns back to the UDT.
Anyone have anything less brute forceish to recommend?
Mike
---------------------
www.opusedge.com
|
|
|
|
|
Hi all,
What are the Features encorparated in SQL Server2005 ?
Aditya Chitti
|
|
|
|
|
|
Go here[^] type http://msdn2.microsoft.com/en-us/sql/default.aspx into the search box. You should be able to quickly and with little trouble discover all the features of SQL Server 2005.
"When I get a little money, I buy books and if any is left, I buy food and clothes." --Erasmus
|
|
|
|
|
I suggest that you visit the MSDN site and search
You will find all features listed.
if (ToErr == Human.Nature)
{
Forgive = Divine;
}
|
|
|
|
|
Hi all,
How to install Recruitment Database in SQL Server 2000.
Please help me out.
Aditya Chitti
|
|
|
|
|
Since we don't know anything about this "Recruitment Database" we can't really help you. Perhaps you should speak to a qualified representative of the company that supplied it.
|
|
|
|
|
Hi all,
How to write a Query to list all the Records in the perticular Table. Please help me out.
Aditya Chitti
|
|
|
|
|
"select * from [tablename]"
|
|
|
|
|
Hi all,
how to query a SqL server and retrieve the Records.
Please help me out.
Aditya Chitti
|
|
|
|
|
aditya chitti wrote: how to query a SqL server and retrieve the Records.
SELECT {column names} FROM {table name}
However, I think you probably want more than that - You'll have to be more specific about your requirements.
|
|
|
|
|
Very simple question:
I have SQL 2000 installed, but don't seem to have a procedure sp_add_job:
...
EXEC sp_add_job
go
....
Msg 2812, Level 16, State 62, Server PEER170, Line 1
Could not find stored procedure 'sp_add_job'.
...
what have I missed?
cheers,
Neil
|
|
|
|
|
This proc is in msdb, not master. did you drop msdb?
|
|
|
|
|
Nope, just didn't realise it was located there.
Thanks for your help.
cheers,
Neil
|
|
|
|
|
I work with SqlServer 2000 using an easy SELECT with da datetime field as follows:
SELECT * FROM myTable WHERE date = '1.10.2006'
This works fine on my environmet(German). On the environment of another computer (French) I get the error massage 'The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value. The cursor was not declared'.
It seems, that the regional country setup of the other computer makes the difference. So i change the settings to German and tryed again. But I become the same error massage.
Is there any datetime-format setting in the SqlServer itselve and where can I find it ?
Thanks a lot *
Alfred
|
|
|
|
|
Don't write your SQL Statements in a culture specific way. Use the ISO date format (yyyy-mm-dd). Or, if the date is coming from an application, use parameters and let ADO.NET do the conversion for you.
|
|
|
|
|
I changed my code. Now it wirks fine...
Colin, I thank you a lot
|
|
|
|
|
I have an SQL statement that works for one database but when I try it on a microsoft access database it doesn't work.
SELECT DIGITS(field1) FROM myTable
The DIGITS() function will convert the field1 from a numeric into a string, but will ensure that the size is maintained. For example, if field1 contained the number 12 and the size of the field was 5 (precision 5, scale 0), this select statement would return 00012.
So my question is, what can I use that is valid in access SQL to accomplish the same goal?
|
|
|
|
|
You can try the Format function. For example,
SELECT Format(field1,"00000") from myTable
should give you all the numbers in field1 with 0 prefixed.
Hope this helps
Chandra
|
|
|
|
|
That is exactly what I was looking for. Thanks!
|
|
|
|
|
Hi,
I have an application that uses ODBC to connect to a SQL Server database. The database includes a number of tables which have columns (of datetime type) to timestamp the row entry with the current date and time. There is no way to get the current date/time from within my application, and so include it in my SQL INSERT INTO statement. Is there a way to have the SQL server automatically insert a datetime value? I have looked at the timestamp column, but I need the actual date and time.
Thanks,
Alice
|
|
|
|
|
CREATE TABLE [MyTestTable] (
[IDColumn] [int] IDENTITY (1, 1) NOT NULL ,
<code>[DateCreated] [datetime] NOT NULL CONSTRAINT [DF_MyTestTable_DateCreated] DEFAULT (getdate())</code> ,
CONSTRAINT [PK_MyTestTable] PRIMARY KEY CLUSTERED
(
[IDColumn]
) ON [PRIMARY]
) ON [PRIMARY]
GO
Or, in the Enterprise Manager's Design Table window, select the datetime column and set the default value to (getdate()) .
-- modified at 9:40 Friday 27th October, 2006
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
EricDV wrote: [DateCreated] AS (getdate()) ,
Surely that defines a computed column, in which case the date will update each time you select rows from that table?
What you need to do is create a default value so that if no date is supplied in an INSERT statement it defaults to the time of the INSERT.
|
|
|
|
|
Dammit man! You caught me again!
I'm gonna have to slow down and think about what I'm posting.
(Thanks for your correction.)
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
EricDV wrote: You caught me again!
No problem
EricDV wrote: I'm gonna have to slow down and think about what I'm posting.
Don't worry about it - It happens from time-to-time.
|
|
|
|