I have one table that has multiple id's and associated dates as well as other fields. I would like to query all the id's with the id's latest date entry and include other fields in this query. The following query selects the one id value and its latest date entry:
SELECT id, MAX(InspectionDt)...
I have attempted to remotely connect to a SQL Express database server via SQL Server Enterpricse Management Studio using windows authentication but I get the following error message:
"an error has occured while establishing to the server. When connection to SQL Server 2005 this failuer may be...
I have a where clause looking for blanks and nulls in a column e.g.,
where column is null and column = ''
Is there a way to combine these into one where statement? I am looking for either or.
I would like to find the following occurences of invalid values in a field.
The first occurence is I have a field that limits the number of characters to 7. However users sometimes enter values in this field that are 6 characters or less. Is there a way to query these out?
The second occurence...
I have moved a disk array from an old server to a new database server which has sql databases on them. I restored the databases from backup tapes into new databases. I would like to remove the original databases from the array. The new database has not been connected to these original databases...
What SQL syntax would I use to search for only lower case letters in a given field. This is done in SQL 2005. The field should only have upper case. I need to convert the lower case to upper case.
I just received a database full of tables from an outside source. These tables have multiple fields in each of them. My question is this database allowed nulls in all the fields. Is there a way/script that I can run that would automatically convert the nulls to not nulls. I would like to avoid...
I have a database with a log file (ldf) that has grown to 90gb. I would like to reduce this size of this file. Approximately 99% of this file is used. The Shrink command will not reduce it any lower than 90gb. It seems that there are a bunch of transactions in the log file that need to be...
Does anyone know if you can prevent a user from exporting a table from a database to another database/format. I would like to prevent users from making copies of the database data.
The following dynamic sql statement executes the first print statement when the @standid variable is not null. Any ideas, perhaps a dynamic sql qwerk?
declare @standid varchar(100)
Declare @SQL VarChar(1000)
SELECT @SQL = ' SELECT' + @standid + '= standid FROM ' + @TableName + ' where...
I cannot get the debugger in Enterprise Manager to work correctly. I would like to be able to step through a stored procedure but when I set a break point and run the code it the debugger does not stop at the breakpoint. This may help, all of the step buttons, restart and stop debugging are...
Can you use a parameter in a stored procedure to select a table? e.g.,
create procedure pStandEditErrorCheck @standedit char(6)
as
--Check for Duplicate Standids
SELECT standid, count(*) AS Total_Duplicate_Standids
FROM @standedit--stand_edits
GROUP BY standid
HAVING count(*) > 1
return
I have multiple databases on SQL Server. I loaded data into these database which took up 80GB. A few months later the database was at 120GB. I deleted a bunch of data from the database and only 3GB was freed up. I used the Database Maintenance Plan Wizard to free up space which it did. The...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.