I have a server with sql server 2005, 2008 and sql express. This is a dev machine.
When I log onto the server I can get access to all servers as expected
[SERVERNAME] = 2005
[SERVERNAME]\mssql2008 = 2008
When I connect to my vpn connection both sql management 2008 and redgate software see [SERVERNAME] as my 2008 server.
When I try to...
I have 3 tables that look like this:
tblVideo:
VideoID | Video Name
1 video 1
2 video 2
3 video 3
4 video 4
tblCategory:
CategoryID | CategoryName
1 category1
2 category2
3 ...
Cannot use the ROLLBACK statement within an INSERT-EXEC statement
I am using two stored procedures. the first sp returns some int value
I am using this in the second sp with INSERT EXEC
But when i am executing the second sp , I am getting the above error
Please help
...
I have table cars:
Id int,
Model nvarchar(max),
DateOfProduction (datetime).
And data like:
1 BMW X5 1.1.2010
2 BMW X5 1.1.2009
3 BMW X3 1.1.2008
4 BMW X3 1.1.2007
5 BMW X7 1.1.2005
And I want to get newest car for each model:
1 BMW X5 1.1.2010
3 BMW X3 1.1.2008
5 BMW X7 1.1.2005
I can't cope with this:/
Could you help me ?
...
Hi,
How to use CREATE LOGIN statement on SQL Server 2005?
I was trying nearly everything, with commas, without them, with strings, without them etc.
CREATE LOGIN @loginame WITH PASSWORD = 'pass', DEFAULT_DATABASE='dbname' DEFAULT_LANGUAGE='us_english', CHECK_POLICY= OFF;
I always get below error:
Incorrect syntax near the keyword '...
in have forecast(x,know_x,know_y) function this function are used to predict the sales
of next . is there any related function in sql server or ssrs .....
Otherwise give me some idea.... i want to predict next 12 month sales projection...
help me asas..
thks
...
I know how to create a new schema and write a DDL script to create tables with the same name that reside in different schemas in the same database. I want to know how to do that using SQL Server 2005 Management Studio Express.
To repeat, I want to know if I can create two tables having the same name but residing in different schemas of ...
Hi,
I want to change the type of a column in MS SQL Server 2005, but before i change the type of that column i want to check if that column is of the type i want to change. How can i do that in SQL?
Thanxs,
Bas Hendriks.
Based on the anwser i wrote the following query that did the trick:
IF NOT EXISTS (SELECT *
FR...
Hail to the fellow programmers and query writers,
I have this beautiful query
SELECT ID, [1] AS coL1, [15] AS coL2, [2] AS coL3, [16] AS coL4, [12] AS coL5
FROM MY_TABLE
PIVOT (sum(INT_VALUE) FOR FUND_CODE IN ([1],[2],[15],[16],[12])) AS p
--GROUP BY ID, [1] , [15] , [2] , [16] , [12]
ORDER BY ID ASC
That returns me data like this:...
My understanding is that when NOLOCK is used in SELECT statement, it could read uncommitted / dirty rows as well. But I wanted to take advantage of NOLOCK hint on table so that my SELECT query will run fast.
Now, does NOLOCK on table but along with "SET TRANSACTION ISOLATION LEVEL READ COMMITTED" give me NOLOCK advantage and faster SE...
I have a select statement that returns a table full of SELECT statements (It goes through every column in every table and creates a select to find if that column contains any bad data).
I need to take this table full of SELECT statements, execute them, and see if any of them return rows. If the count(*) > 0, then I want to print out ...
I am trying to get the avg time a driver completed a delivery stops at each unique customer. I am using the following columns:
Name (varchar(50))
Reference1 (varchar(50))
CompletedTime (Datetime).
I am getting an avg but it includes the date & time NOT just date. Which is making the time avg incorrect.
thanks for the help!
Current...
I have a simple self referencing table as depicted here:
CREATE TABLE [dbo].[Project](
[ProjectId] [int] NOT NULL,
[ProjectName] [nvarchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[ParentProjectId] [int] NULL
CONSTRAINT [PK_Project] PRIMARY KEY CLUSTERED
(
[ProjectId] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PR...
Hi.
Is it possible to generated ALTER sql script from the changes you perform in Server Studio. This is possible in different tools for mysql, basically you get the log of executed statements. Is similar thing possible here, or how do you go about finding out what the modification (ALTER) script is?
Thanks.
-- MB
...
(I looked for an answer, but nothing really solved my issue so far.)
I want to keep a table up to date with a file directory tree within Microsoft SQL Server 2005. I do the norm now:
insert into #resultTable (Path)
exec master.dbo.xp_cmdshell 'dir/s/b G:\FileLibrary'
but this takes about 4 1/2 minutes to load each time (not to mentio...
"The Resource database is a read-only database that contains all the system objects that are included with SQL Server" [1]
This sounds that one database from one instance (which one?) contains all information on the whole SQL Server, though I observe that each instance has its own Resource database copy.
Is this phrase "with SQL S...
Currently on some operations I have to delete the old data and insert new one. But I noticed that inspite of deleting data the identity column did not reset and continued from its last max value. So i used the DBCC CheckIdent for achieve the same all this is taking place within a trasaction. Can i rollback the transaction back to the int...
IN MS SQLSERVER 2005 I cannot understand the following terms
server
instance
...
I getting this error while developing stored procedure
"Implicit conversion of varchar value to varchar cannot be performed because the collation of the value is unresolved due to a collation conflict."
statement is like this
Select City COLLATE DATABASE_DEFAULT AS Place, State, Country FROM DEPT1
UNION ALL
Select '' AS Place, 'Arizon...
public void RestoreDatabase(String databaseName, String filePath,
String serverName, String userName, String password, String dataFilePath, String logFilePath)
{
Restore sqlRestore = new Restore();
BackupDeviceItem deviceItem = new BackupDeviceItem(filePath, DeviceType.File);
sqlRestore.Devices.Add(deviceItem);
...