I am trying to create a new table by copying an existing table in SQL Server 2008 using Management Studio. The existing table contains no data. I am using the following code but am receiving an error for Incorrect Syntax near AS. I am not sure what is wrong here. I am a SQL newb and any help would be appreciated. Thanks.
CREATE TABLE Drop_Centers_Detail
AS (Select * From Centers_Detail)
I'm developing Reporting services on VS2005 and have to connect to SQL Server 2008.
The following Error occurs:
"This server version is not supported. You must have Microsoft SQL Server 2005 Beta 2 or later."
I found on the net a patch for it, but it doesn't work
(link to patch)
"The upgrade patch cannot be installed by the Windows Installer Service because the program to be upgraded is missing, or the upgrade patch may update a different version of the program."
what else can I do ? :(
I work with a team that has a sharepoint site currently runnning and its lists are linked to an access DB. My question is really on the investment level, what would be the reasons to upgrade DB to sharepoint if only a few 100 users access this site. Is there a real benefit to replacing the DB with a version of SQL Server, escpecially if about to replace Access 2002 with 2007 some day. I know SQL Server can handle more memory and traffic for more users, but I'm looking for more reasons than that if there are any.
Having a problem moving a site from Win2003 IIS6 w/ SQL2005 Express to a Win2008 IIS7 w/Fill SQL 2005? I keep getting this error
Desc : SQL Network Interfaces: Error Locating Server/Instance Specified [xFFFFFFFF].
Can anyone point me in the right direction
Is it possible to have a varchar column as a primary key with values like 'a ' and 'a', is gives always this error "Violation of PRIMARY KEY constraint" in MS SQL Server 2008.
In Oracle dons't give any error.
BTW I'm not implementing this way I'm only trying to migrate the data from oracle to sql server.
Regards
Hi!
is it possible to install another IDE language to SQL Server 2008 Express like i can do in Visual Studio? In the options of Visual Studio, i can change the Environnement Language. Can i do the same with SQL Server 2008?
alex
Hi,
I've a sql table with a primary key(Auto Incremented) and a foreign key.Now I need to modify the table by modifying the foreign key to second primary key so that its values are not allowed to duplicate.
How do i alter my table without affecting the data? Need the sql code.
Regards,
Vix
I am planning on deploying a database to SQL Azure, so I cannot use the SQL CLR. However, I have a need to create an aggregate function -- in my case, I need to STUnion a bunch of Geography objects together. (Azure is expected to support Spatial by June.)
Is there another way to accomplish this, without making use of the CLR, in a query? Or do I have to create a UDF that will take a table as a parameter and return the aggregate?
I am trying to migrate sharepoint wss 3.0 databases from SQL Express 2005 to SQL 2008 Workgroup edition.
I have backed up the database, but not sure how to best attached/restore them to the new version and get up and running again.
Thanks
I'm running the following statement to see what queries are executing in sql server:
select *
from sys.dm_exec_requests r
cross apply sys.dm_exec_sql_text(r.sql_handle)
where r.database_id = DB_ID('<dbname>')
The sql text that comes back is parameterized:
(@Parm0 int) select * from foo where foo_id = @Parm0
Is there any way to get the values for the parameters that the statement is using? Say by joining to another table perhaps?
I want to add a database task that runs on a 6 hours interval. The task is to delete some records that matches certain condition.
What is the best way to achieve this in Sql Server 2008 ?
I know I can do this on the app side but I want it on sql server side.
Please help me to find out error in my SQL query. I have created this query to compare dates
select * from Joinplans jp
where cast(convert(varchar,GETDATE(),103) AS datetime) BETWEEN
CASE(convert(varchar,jp.planstartDate,103) AS datetime) AND
CASE(convert(varchar,DATEADD(DAY,jp.planDays,jp.planstartDate),103) AS DATETIME)
It's giving me the error:
incorrect near 'AS'
I am using SQL Server 2005.
I don't seem to find a tool for it, nor an odbc driver.
Thanks
UPDATE : I'm aware of the sql scripting possibilities. But than again : how to script a sql 2k table? (not just ddl, but data also?)
Of course you can write this all by yourself, but importing data into CE cannot be such a hassle, or can it ?
UPDATE2 : I don't seem to be able to choose the right dialect for inserting
please help me to find out error in my sql query. i have created this query to compare dates
select * from Joinplans jp
where cast(convert(varchar ,GETDATE(),103) AS datetime) BETWEEN
CASE(convert(varchar,jp.planstartDate,103) AS datetime) AND
CASE(convert(varchar,DATEADD(DAY,jp.planDays,jp.planstartDate),103) AS DATETIME)
It's giving me the error:
incorrect near 'AS'
I am using SQL Server 2005.
Windows 7 computer running SQL Server Express 2008 (sp1).
When I try to run net start mssql$sqlexpress I receive an error:
System error 5 has occurred.
Access is denied
The SQL service is running under "Network Service" account
The service starts fine if I use the services window. Could somebody help me figure out why I am receiving this error?
Hello everyone,
I am going to install SQL Server 2008 Enterprise cluster on Windows Server 2008. I am wondering whether I have to setup a Windows domain (or active directory) in order to install SQL Server cluster?
thanks in advance,
George
Store a byte[] stored in a SQL XML parameter to a varbinary(MAX) field in SQL Server 2005. Can it be done ?
Here's my stored procedure:
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[AddPerson]
@Data AS XML
AS
INSERT INTO Persons (name,image_binary)
SELECT
rowWals.value('./@Name', 'varchar(64)') AS [Name],
rowWals.value('./@ImageBinary', 'varbinary(MAX)') AS [ImageBinary]
FROM
@Data.nodes ('/Data/Names') as b(rowVals)
SELECT SCOPE_IDENTITY() AS Id
In my schema Name is of type String and ImageBinary is o type byte[].
Simple problem. I have an SQL Server database (MyData.mdf) and I want to convert it to a Compact database. (MyData.sdf) Just can't find the proper tool which can do this for me.
And I would also be able to convert the compact database back to a regular SQL Server database...
Is there a SQL statement that will list the names of all the tables, views, and stored procs from MS SQL Server database, ordered by schema name?
I would like to generate an Excel spreadsheet from this list with the columns: schema, type (table, view, stored proc), and name.
I'm using Linq to SQL on an SQL Compact database. I have a function where I insert multiple records into the database. I only call SubmitChanges at the end of the function. Would using a transaction (using the TransactionScope class) bring me any more performance or advantages?
Currently im working on a research paper about sql-injection with RFID tags and Im curious if it is possible to create a database trigger with an sql injections if stacked queries are disabled. If stacked queries are enabled, of course it is easy (assuming you know the table layout), but what if they're disabled for security reasons.
What is the easiest way to automatically fill a datetime column in an SQL data table with the date the row was created? Using SQL Server 2005 if that matters.
On my SQL Server 2008 I have a stored procedure with a large number of parameters.
The first part of them is used in every call and parameters from the second part are used rarely. And I can't move the logic to two different stored procedures.
Is there a way to encapsulate all this parameters to a class or struct and pass it as a stored procedure parameter?
Can I use SQL CLR. Are there other ways?