I need to alter the length of a column "column_length" in say more than 500 tables and the tables might have no of records ranging from 10 records to 3 or 4 million records.
1) The column may just be a normal column
*create table test(column_length varchar(10))*
2) The column might contain non-clustered index on it.
*create table test...
I always felt that expecting exceptions to be thrown on a regular basis and using them as flow logic was a bad thing. Exceptions feel like they should be, well, the "exception". If you're expecting and planning for an exception, that would seem to indicate that your code should be refactored, at least in .NET...
However. A recent scen...
I have an index on columns A, B, C, D of table T
I have a query that pulls from T with A, B, C in the WHERE clause.
Will the index be used or will a separate index be needed that only includes A, B, C?
...
I have some tables that I build as a part of my report rollup. I don't need them afterwards at all. Someone mentioned to truncate them as it would be faster.
...
I'd like to just put in a comment in the block of my if-statement, but I get an error when I try. I want to be more like Steve McConnell.
declare @ConstraintName varchar(255)
set @ConstraintName = 'PK_Whatever'
IF LEFT(@ConstraintName, 2) = 'PK'
BEGIN
--can't drop primary keys
END
The error I get is:
Incorrect syntax near 'END'....
So a column will hold some text that beforehand I won't know how long the length of this string can be. Realistically 95% of the time, it will probably be between 100-500 chars, but there can be that one case where it will 10000 chars long. I have no control over the size of this string and never does the user. Besides varchar(max), what...
Stored procs in SQL Server sometimes finish with a return code, as opposed to a recordset of data. I've seen ASP code that's able to get this return code, but I can't figure out how to get this code with PHP's mssql driver.
mssql_get_last_message() always returns nothing, and I'm thinking it's because it only returns the very last line...
Sorry if the title is poorly descriptive, but I can't do better right now =(
So, I have this master-detail scheme, with the detail being a tree structure (one to many self relation) with n levels (on SQLServer 2005)
I need to copy a detail structure from one master to the another using a stored procedure, by passing the source master i...
Is it possible to reference a .NET Assembly from a SQL Server Stored procedure or function, or otherwise access the clr code from SQL Server?
EDIT Whilst this solution will require to be somewhat generic, I am fairly confident expecting SQL 2005+
...
Hi, Do anyone can help me with setting up anonymous authorization for reporting service 2005 and make it work in email subscription too. Thanks for the help as i been scratching my head for a while already.
...
When do we use client side reporting and when do we use server side reporting?
Which reporting is best practice (client/server)?
This pertains to SSRS reporting.
...
I hate case sensitivity in databases, but I'm developing for a client who uses it. How can I turn on this option on my SQL Server, so I can be sure I've gotten the case right in all my queries?
...
Ok, this is a curly one. I'm working on some Delphi code that I didn't write, and I'm encountering a very strange problem. One of my stored procedures' parameters is coming through as null, even though it's definitely being sent 1.
The Delphi code uses a TADOQuery to execute the stored procedure (anonymized):
ADOQuery1.SQL.Text := "ex...
I would like to get a list of good cloud hosting companies and what is offered by each. I specifically would like to focus on companies that can handle ASP.NET 3.5 and SQL Server 2008. Hopefully their are more options out there, other than Mosso. :)
Edit 1
GoDaddy has a great deal, check out my post below.
...
I have a report in SSRS 2005 that's based on a query that's similar to this one:
SELECT * FROM MyTable (NOLOCK)
WHERE col1 = 'ABC'
AND col2 LIKE '%XYZ%'
I need to be able to dynamically include the AND part of the WHERE clause in the query based on whether the user has checked a checkbox. Basically, this is a dynamic SQL statement a...
Does anyone happen to remember what is the the function of select state to grab records from sql server with additional row id column automatically generate?
Edit: I am happen to work again sql 2000
...
Scenario: C# apps uses SQL2000. It excecute 3 stored procs within a try catch in the app. In the catch the error is suppressed. Due to some legalities, the c# code cannot be changed and implemented.
Q: How do I trap the actual SQL error in the stored proc into a log file or other table? @@Error returns an error message to the app but w...
SQL Server 2000 Standard, Windows 2003
My coworker removed 'BUILTIN\Administrators' group from SQL Server which results in 'SQL Server Agent' not working.
All my TSQLs to synchronize databases stopped working.
I have Administrator rights on the server and my database user is in sysadmin role.
Does any one have idea how to bring 'BUIL...
I use several referenced tables with integer primary keys. Now I want to change ints to GUIDs leaving all references intact. What is the easiest way to do it?
Thank you!
Addition
I do understand the process in general, so I need more detailed advices, for example, how to fill new GUID column. Using default value newid() is correct, bu...
I am having a table Table1 with columns id1, id2, id3 all the columns are nullable
I may enter null or value to all columns in rows.
My question is I need to select the rows whose all the column values should not be null.
Thanks
...