Suppose I have a database table that has a timedate column of the last time it was updated or inserted. Which would be preferable:
Have a trigger update the field.
Have the program that's doing the insertion/update set the field.
The first option seems to be the easiest since I don't even have to recompile to do it, but that's not r...
I'm using SQL Server 2008. My database is almost 2GB in size. 90% of it is one table (as per sp_spaceused), that I need don't for most of my work.
I was wondering if it was possible to take this table, and have it backed up in a separate file, allowing me to transfer the important data on a more frequent basis than this one.
My guess...
Does anyone know of a reasonably priced tool that will create DDL statements to create a SQL Server database and appropriate Insert statements to recreate the data? I use the Red Gate tools to do database compares (including content compares) and this comes close (I could always compare with an empty schema) but I was wondering if there...
Today we're using a shared SQL Server database and that is perfect as I don't know anything about SQL Server maintenance. But for economic reasons we're need to upgrade to a dedicated server.
Given that I don't have time to read the entire documentation, What do I absolutely need to know about SQL Server to not screw this up?
Resource...
I understand that the WITH RECOMPILE option forces the optimizer to rebuild the query plan for stored procs but when would you want that to happen?
What are some rules of thumb on when to use the WITH RECOMPILE option and when not to?
What's the effective overhead associated with just putting it on every sproc?
...
Hi I'm using ms2005 for a simple calendaring system.
We have three 'legacy' tables: Groups, Units and Staff.
I need to give each record in the tables a unique identifier (carrying across all 3 tables).
What would be best way to approach this? I am using NHibernate and was was wondering whether that could do it for me.
Anyway, any nods...
The only thing I don't have an automated tool for when working with SQL Server is a program that can create INSERT INTO scripts. I don't desperately need it so I'm not going to spend money on it. I'm just wondering if there is anything out there that can be used to generate INSERT INTO scripts given an existing database without spending ...
Can someone provide the download link for SQL Server Reports add-in for Visual Studio 2008(not Visual Web Developer!)?
...
I have this scenario where I need data integrity in the physical database. For example, I have a variable of @email_address VARCHAR(200) and I want to check if the value of @email_address is of email format. Anyone has any idea how to check format in T-SQL?
Many thanks!
...
The MSDN documenation states:
Indicates whether SQL Server uses the column as a ROWGUID. You can set this value to Yes only for a unique identity column.
This doesn't tell me why I would have this enabled or disabled.
...
Ok. So I am pretty new a this. I have a datatable that I want to pass to a stored procedure for further manipulation. I have read some stuff on the web and it looks like I should be able to convert the datatable to XML and then pass that to the stored procedure. What am I doning wrong? I have SQL server 2005. The data never gets passe...
One of our clients has an application (FoxPro 9) running on top of a SQL Server 2005 backend. Intermittently, they are losing their ODBC connection with the SQL Server database. Below is the intial error information:
Err Msg: Connectivity error: [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionRead (recv()).
ODBC Err Msg: [Micros...
What is the best strategy in the hardware configuration of a SQL server machine?
To my knowledge you set it up the following:
RAID 1 (2 disks) --> OS + SQL Server installation
RAID 1 (2 disks) --> SQL Server Logs
RAID 5 (4 disks) --> SQL Server databases
What have you experienced?
Is there a better way to do it?
...
How can I use SMO to rename the physical .mdf .ndf .ldf files.
This article was helpful but I need to use C# SMO Objects.
Using the SMO Server Object I can retrieve the database, then Get Access to the DataFile objects. Per this link. These have a Rename, however after rename, nothing changes.
...
Hello. I have a problem with a Database at my work. There is currently auditing in place, but its clunky, requires a lot of maintence, and it falls short in a few regards. So I am replacing it.
I want to do this in as generic of a way as possible and have designed the tables, and how everything will link and be updated.
Now, thats all ...
I can quite easily dump data into a text file such as:
sqlcmd -S myServer -d myDB -E -Q "select col1, col2, col3 from SomeTable" -o "MyData.txt"
However, I have looked at the help files for sqlcmd but have not seen an option specifically for CSV. Is there a way to dump data from a table into a CSV text file using sqlcmd?
...
I'm wondering what the simplest way to list all indexes for all tables in a database is. Should I call sp_helpindex for each table and store the results in a temp table, or is there an easier way?
Can anyone explain why constraints are stored in sysobjects but indexes are not?
...
We are having trouble with a Java web application running within Tomcat 6 that uses JDBC to connect to a SQL Server database.
After a few requests, the application server dies and the in the log files we find exceptions related to database connection failures.
We are not using any connection pooling right now and we are using the stand...
Hello Everyone,
I've got a SQL Server 2000 box that I'd like to put on "the Internet" so that developers could connect remotely without VPN access.
What's the safest way to do so? It might be temporary, e.g. every once in a while, but it's definitely necessary.
Thanks,
Rob
...
I'm trying to call a stored procedure (on a SQL 2005 server) from C#, .NET 2.0 using DateTime as a value to a SqlParameter. The SQL type in the stored procedure is 'datetime'.
Executing the sproc from SQL Management Studio works fine. But everytime I call it from C# I get an error about the date format.
When I run SQL Profiler to w...