Storing For XML EXPLICIT Results To Tmptable

Jul 9, 2014

SQL 2012R2 Std. I have a sql statement to retrieve data in XML format. I have to use EXPLICIT because I have to use tag <CDATA>

I would like to store the XML returned into 1 column containing the XML tags.

For example:

#tmpXML
row 1: <DOC><NET_INFO net_ID=34><NOTES><![CDATA[description]]></NOTES></NET_INFO></DOC>
row 2 <DOC><NET_INFO net_ID=35><NOTES><![CDATA[description2]]></NOTES></NET_INFO></DOC>

select *
into #tmpXML
FROM (SELECT 1 AS Tag

[Code] ....

But I keep getting an error message:

The FOR XML clause is invalid in views, inline functions, derived tables, and subqueries when they contain a set operator. To work around, wrap the SELECT containing a set operator using derived table syntax and apply FOR XML on top of it.

I have tried a couple of other ways but continue to get an error message.

View 3 Replies


ADVERTISEMENT

Storing Results Into Variables

Apr 18, 2001

I need to manage the number of rows affected by a query.
If I run this script on my database:
SELECT COUNT(*)
FROM TABLE_NAME
WHERE TABLE_NAME.FLAG = 'I'
AND NOT EXISTS
(SELECT*
FROMERR_TABLE_NAME
WHERE ERR_TABLE_NAME.FIELD_1 = TABLE_NAME.FIELD_1
AND ERR_TABLE_NAME.FIELD_2 = TABLE_NAME.FIELD_2)

the query analyzer gives me back the number of lines affected:

-----------
4,00

(1 row(s) affected)

I need to manage this amount (4,00), so I applied this modification:

DECLARE @NUM_ROWS INT

SET @NUM_ROWS = (SELECT COUNT(*)
FROM TABLE_NAME
WHERE TABLE_NAME.FLAG = 'I'
AND NOT EXISTS
(SELECT*
FROMERR_TABLE_NAME
WHERE ERR_TABLE_NAME.FIELD_1 = TABLE_NAME.FIELD_1
AND ERR_TABLE_NAME.FIELD_2 = TABLE_NAME.FIELD_2)
)

but it doesn't work!! the SRV returns me this:
Server: Msg 107, Level 16, State 3, Line 3
The column prefix 'TABLE_NAME' does not match with a table name or alias name used in the query.

Do you know another way to store the number of rows affected?

View 2 Replies View Related

Storing Query Results In A Variable

Mar 28, 2001

Can someone tell me how to store the results of a multi-row query in a text or varchar variable so that I might do something like this:

declare @var1 text

select @var1 = {results of select date, count(*) from testtable2 group by date)


Thanks!

joe

View 2 Replies View Related

Storing Results Of Select Statement In @variable

Feb 11, 2008



I'm new to sql stored procedures but I would like to store the results
of an sql statement in a variable such as:

SET @value = select max(price) from product

but this does not work, can someone tell me how I would go
about in storing the results in a variable.

@value is declared as int

Thanks in advance,
Sharp_At_C

View 1 Replies View Related

Storing Daily Cached Query Results In SQL Server

Mar 7, 2005

I'm working on a reporting tool that could bring back hundreds of thousands of results back at once. I need some way to run the actual query only once a day, and then the reporting tool would just pull back this cached results. To be short, I need to figure out how to do this using a minimum amount of resources. Would a DataView work with something like this? How would I have it update only once a day? I appreciate any advice!

View 2 Replies View Related

Speeding Up Site By Storing Query Results In File

Mar 4, 2008

Hello,
We have some queries that are long and intensive. We have thought about running the queries and storing the data in a text file for lookup from our website.

Example: Our online store only displays items that are in stock so when a user selects a category a query runs and grabs only items that are in stock and then displays them. There could be thousands of items the query needs to sort through before displaying the items that are in stock. What if we ran this query once every hours an stored the results in a txt file? The asp page would then go to the text file to grab the results instead of having to run the query every time a user selects a category. Will this speed up the site by not having to query every time? Would this be a correct way to eliminate queries that run thousands of times a day?

thanks
Andy

View 2 Replies View Related

Storing The Stored Procedure Results In A Temp. Table

Mar 28, 2008

All,

I'm trying to store the results of my store procedure in a temp table. when I try it, I got the error saying...

"Insert exec cannot be nested"

I suspsect this is because I have a Insert Exec statement inside my stored procedure...

Is there any way to come over this issue ?

syntax of my code...

create table #Temp1 (ID int)

insert into #Temp1
EXEC SP1

when I try to run the above code I get the error "Insert exec cannot be nested"

SP syntax :

Create Procedure SP1
as
Begin


create table #Temp2
statements.....


Insert into #temp2
exec SP<Name>


staments.. cont...

END

View 5 Replies View Related

Are There No Computed Column Types? For Storing Expressions (results Of Other Fields)

Jun 4, 2006

I just read something interesting here: http://www.informit.com/library/content.asp?b=STY_Sql_Server_7&seqNum=101

A column type that helds an expression, and in queries returns the results.

That sounds excelent in my database, to save some code in my client applications. E.g adding price totals, and taxes of an order.

I can't find any info about this in later versions of SQL server. Is this not possible anymore?

View 3 Replies View Related

Invalid Object Name '#TmpTable' Whenselecting From Temporary Table Made Using INTO From Exec(@str)

Apr 8, 2008

Hello,

Can anyone shed some light on why the following:


declare @str varchar(2000)
set @str = 'SELECT * INTO #TmpTable FROM FormHistory'
exec (@str)
SELECT * FROM #TmpTable

gives the following error:


Invalid object name '#TmpTable'.


This is a very cutdown version of what I am trying to achieve so it might not seem obvious why I am writing it into a string and using exec but in the real code I do need to do this. I have cut it right back to try to get to the bottom of why this doesn't work. I suspect the # in the string is causing the problems.

Thanks for any help

View 16 Replies View Related

Which Is Better? Storing Data In The Database OR Storing It In The File System

Dec 29, 2006

Hello there,I just want to ask if storing data in dbase is much better than storing it in the file system? Because for one, i am currenlty developing my thesis which uploads a blob.doc file to a web server (currently i'm using the localhost of ASP.NET) then retrieves it from the local hostAlso i want to know if im right at this, the localhost of ASP.NET is the same as the one of a natural web server on the net? Because i'm just thinking of uploading and downloading the files from a web server. Although our thesis defense didn't require us to really upload it on the net, we were advised to use a localhost on our PC's. I'll be just using my local server Is it ok to just use a web server for storing files than a database?    

View 6 Replies View Related

For Xml Explicit

Feb 4, 2008

is anybody using this? it looks like a lot of trouble to return a formatted string. I am considering it for something. Any opinions?

http://technet.microsoft.com/en-us/library/aa226532(SQL.80).aspx

caution: you have to X out of the Do You Want to Download Silverlight popup.

View 12 Replies View Related

Help With For Xmp Explicit

Jul 23, 2005

i have a situation, where i need to group my information by a certainid, but that information which should already be grouped, i need toorder based on a number in one of the columnsexample:<ex id=2 listorder=1><description>desc 2</description></ex><ex id=1 listorder=2><description>desc 1</description></ex>in my order clause i first put order by the id, and it will group theinformation accordingly, but will put the lowest number id first, notcaring about the listorderbut if i order by the listorder column first, the information isn'tgroupd properlyi don't know if i made myself clear enough?hope someboyd can help methnx in advance

View 1 Replies View Related

Explicit Commit

Jun 8, 1999

Hi ,
I've tried to switch MS-Sql/Server 6.5 on explicit_transactions
without success.
(set implicit_transaction on/off)

What is the exact syntax for doing that ?

Herve

(PS: Thanks Gregory for your quick answer )

View 1 Replies View Related

Explicit Commit

Jun 3, 1999

Hi All,

I don't know MS-SQLserver internal system at all. I 've just used Oracle
a couple years ago and so in some cases (e.g using TP-monitor MTS or Tuxedo)
you can switch off the implicit transaction by using
the option AUTOCOMMIT ON/OFF.

How can switch off the implicit transaction system on MS-SQLServer ?

In advance thanks,

Herve

View 1 Replies View Related

Using FOR XML Explicit Within A DTS Package

Sep 7, 2004

I created a SELECT statement that uses the FOR XML EXPLICIT clause so that SQL Server data can be exported to another system. Format thios system accepts is XML. What should I define within a DTS package so that this Select statement is executed and an XML file is created?

View 12 Replies View Related

Explicit Transactions

Feb 27, 2006

I have an cursor that loops 720 times.
Each FETCH does 6 INSERTS.
Each FETCH the 6 INSERTs a total of 200-300 records appended.

Would explicit transactions speed up the cursor?

In Oracle, I would keep track of how many times I've looped, and commit every nth time. I would put a catch remainder COMMIT at the end of the procedure.

I've got the IF @@TRANCOUNT > 19 COMMIT TRAN (about 6k records), but say I had <= 19 remaining at the end of the cursor, how do you get those to commit? I tried to put an IF @@TRANCOUNT > 1 COMMIT TRAN, but that didn't work.

What's a good @@TRANCOUNT to commit at in this case?

Thanks crew,
Carl

View 4 Replies View Related

Explicit Value Error, Why?

Jan 30, 2007

Hello,

In the SP below, I get the following error when I run it:
Explicit value must be specified for identity column in table 'Tests' when IDENTITY_INSERT is set to ON.

From what I've read of the INSERT method, it says you can add a variable value. So I don;t understand why it won't take mine.

CREATE PROC qaspAddTestRecord AS

DECLARE @aKey bigint
DECLARE @aTestSuiteId bigint

exec qaspGetNewID 'Tests', @aKey OUT

SELECT @aTestSuiteId= NewID FROM ID WHERE TableName='TestSuite'

SET IDENTITY_INSERT Tests ON

INSERT INTO Tests (TestSuiteId, TestIDInternal) VALUES (@aTestSuiteId, @aKey)

SET IDENTITY_INSERT Tests OFF
GO


--PhB

View 4 Replies View Related

FOR XML EXPLICIT Can't Get Element 4 Going

Jan 7, 2008

Hello all,I'm trying to generate some XML directly from MS SQL with thefollowing codeSELECT1 AS tag, NULL AS parent, NULL AS [GoogleCustomizations!1], NULL AS [Annotations!2], NULL AS [Annotation!3], NULL AS [Annotation!3!about], NULL AS [Annotation!3!score], NULL AS [Label!4], NULL AS [Label!4!name]UNIONSELECT2 AS tag, 1 AS parent, NULL, NULL, NULL, NULL, NULL, NULL, NULLUNIONSELECTTOP 503 AS tag, 2 AS parent, NULL, NULL, NULL, 'www.' + domainName, 1 -- score, NULL, NULLFROM tbl_auDomainNameUNIONSELECT4 AS tag, 3 AS parent, NULL, NULL, NULL, NULL, NULL, NULL, '_cse_ad-o6lgdody'FOR XML EXPLICITThe XML it needs to create is as following<GoogleCustomizations><Annotations><Annotation about="www.clickfind.com.au/*" score="1"><Label name="_cse_ad-o6lgdody" /></Annotation><Annotation about="www.lookle.com/*" score="1"><Label name="_cse_ad-o6lgdody" /></Annotation><Annotation about="www.sensis.com.au/*" score="1"><Label name="_cse_ad-o6lgdody" /></Annotation></Annotations></GoogleCustomizations>It is currently creating<GoogleCustomizations><Annotations><Annotation about="www.10000steps.org.au" score="1" /><Annotation about="www.101fm.asn.au" score="1" /><Annotation about="www.aao.gov.au" score="1"><Label name="_cse_ad-o6lgdody" /></Annotation></Annotations></GoogleCustomizations>I cannot get my head around how I can get the label <Labelname="_cse_ad-o6lgdody" />in each element. Does anyone know?Thanks in advance.

View 2 Replies View Related

XML Explicit With Text Column?

Jan 31, 2007

    HiI have to create an XML file based on a SQL SERVER 2005 table.Everything works fine:SELECT 1 as Tag,
NULL as Parent,
Ex_Id as [Exam!1!Ex_Id],
NULL as [Ex_Title!2!!cdata]
FROM Exams
WHERE ex_State = 'P'
UNION ALL
SELECT 2 as Tag,
1 as Parent,
Ex_Id,
ex_Title
FROM Exams
WHERE ex_State = 'P'
order by [Exam!1!Ex_Id], [Ex_Title!2!!cdata]
FOR XML EXPLICIT, ROOT('Exams')
BUT when i add another column, a text column, I get into trouble: SELECT 1 as Tag,
NULL as Parent,
Ex_Id as [Exam!1!Ex_Id],
NULL as [Ex_Title!2!!cdata],
NULL as [Ex_Situation!3!!cdata]
FROM Exams
WHERE ex_State = 'P'
UNION ALL
SELECT 2 as Tag,
1 as Parent,
Ex_Id,
ex_Title,
ex_Situation
FROM Exams
WHERE ex_State = 'P'
order by [Exam!1!Ex_Id], [Ex_Title!2!!cdata], [Ex_Situation!3!!cdata]
FOR XML EXPLICIT, ROOT('Exams')
The problem is clearly the fact that i have to sort on the text column, plus the fact that this column requires the CDATA tag enclosurePlease help me....i'm desperate :(

View 1 Replies View Related

Explicit DATE FORMAT

Jan 19, 2004

Hi:

How can I force MsSQL to a explicit DateFormat.
Like: 'DD/YY'

View 4 Replies View Related

Implicit Vs Explicit Joins

May 20, 2008

performance wise what is the difference between following queries

Select * from A, B Where A.ID = B.ID
Select * from A INNER JOIN B ON A.ID = B.ID
(ID is the primary key)

View 6 Replies View Related

Cannot Insert Explicit Value For Identity...

Apr 24, 2006

I am developing an integration process between two databases. One ofthem is a SQL Server 2000 and the other is using MSDE 2000. Theintegration process is done in C# (VS2003).The main database is the SQL Server, the MSDE will contain a reallysmall subset of the data found on the main. To help diminish the amountof time taken to develop an integration process between thosedatabases, the same structure are found on both side. The onlydifference, when I insert data in the MSDE from the SQL Server, I setthe IDENTITY_INSERT to ON and use the same IDs found on the SQL Server.I can insert one set of data without problem, but from there, if I tryagain, I will always receive the "Cannot insert explicit value foridentity column in table ... when IDENTITY_INSERT is set to OFF." Isaw on Microsoft website the article ID 878501; I noticed I was usingMSDE sp3, I upgraded to SP4... and I still have the problem.I know, when I call the update function on the sqldataadapter, theadapters contain the IDENTITY_INSERT ON and it's set to OFF after theinsert. The "Cannot insert..." error is the only one I received.Can anyone help me on that issue? Take note that this approach wasused because of customer requirements; the size of the database alsocauses some problem (over 200 tables) and we decided to use the samestructure on both side to minimize the support time.

View 3 Replies View Related

Can I Administrate A Db Without Explicit Permissions On That Db?

May 8, 2008



Hi all,

I'm using SQL Server Express 2005, with mixed authentication mode.
I would like to connect, manipulate data and administrate db's on my server without explicit permissions on those db's.
I've created a new Login with SQL Server authentication and assigned it the public & sysadmin server roles BUT I can't even connect to db's where I don't have an explicit db role (db_owner, ddl_admin...)!
What am I missing?
How can I administrate a db without explicit permissions (db role) on that db?

Thanks,

Assaf

View 6 Replies View Related

Please Help With Explicit Permissions For A Database

Nov 6, 2005

Hello!

View 1 Replies View Related

An Explicit Value For The Identity Column In Table

Sep 15, 2005

for some unknow reasons.. my store proc stop working.. and i got an error.. i have installaed the latest SP4 for SQL server 2000 and still have the problem !any ideas why ?? Message "An explicit value for the identity column in table 'LCMS_Modules' can only be specified when a column list is used and IDENTITY_INSERT is ON."CREATE procedure LCMS_Modules_Add
 @PageID int, @ModuleDefID int, @Panename nvarchar(32), @Title nvarchar(128), @Admins nvarchar(256)
as
insert into LCMS_Modulesvalues(@PageID, @ModuleDefID, 99, @Panename, @Title, '0;', @Admins, 0, '', 'Center', '', '', '', 1, 0)GO

View 1 Replies View Related

Connecting With An Explicit Network Path

Jul 12, 2006

I have a DTS that pulls a file from a networked drive (generally using the u: designation) for part of its process. Recently, the server has been dropping network drive connections, so sometimes the DTS will fail (I'm not certain why it's dropping the connections, nor do I have the access or control to figure out such.)

I've been told that I should change the DTS package to use an explicit path (i.e., \serverfolder1folder2file.mdb instead of u:folder2file.mdb) to work around this problem. However, Enterprise Manager doesn't seem to like using this for the "File name" attribute in the connection properties. (This is an Access connection, if that matters.)

Is there any way to get the explicit path (probably the wrong terminology here) to work with the connection properties?

View 2 Replies View Related

Trouble Declaring Hierarchy Using FOR XML EXPLICIT

Jan 31, 2006

I'm attempting to use FOR XML EXPLICIT in SQLServer to adhere to the following template:
<group>
<sourceid>
<source></source>
<id></id>
<grouptype>
<scheme></scheme>
<typevalue></typevalue>
</grouptype>
<description>
<short></short>
<long></long>
</descrption>
</group>

Here's my code:
SELECT 1 as Tag,
NULL as Parent,
@p_school_desc as [sourceid!1!source!element],
@p_term_code as [sourceid!1!id!element],
NULL as [grouptype!1!scheme!element],
NULL as [grouptype!1!typevalue!element],
NULL as [description!1!short!element],
NULL as [description!1!long!element]
FROM course_main AS sourceid
where sourceid.course_id = @p_course
UNION
SELECT 1 as Tag,
NULL as Parent,
NULL,
NULL,
@p_destination as [grouptype!2!scheme!element],
'Term' as [grouptype!2!typevalue!element],
NULL,
NULL
FROM course_main AS grouptype
where grouptype.course_id = @p_course
UNION
SELECT 1 as Tag,
NULL as Parent,
NULL,
NULL,
NULL,
NULL,
@p_term_code as [description!2!short!element],
@p_term_description as [description!2!long!element]
FROM course_main AS grouptype
where grouptype.course_id = @p_course
FOR XML EXPLICIT

I'm receiving the foollowing error:
Server: Msg 6812, Level 16, State 1, Line 14
XML tag ID 1 that was originally declared as 'sourceid' is being redeclared as 'grouptype'.
Is there anyway to have two different child notes off of the same parent node?

Thanks in advance!

View 1 Replies View Related

Trouble Declaring Hierarchy Using FOR XML EXPLICIT

Jan 31, 2006

I'm attempting to use FOR XML EXPLICIT in SQLServer to adhere to the following template:
<group>
<sourceid>
<source></source>
<id></id>
<grouptype>
<scheme></scheme>
<typevalue></typevalue>
</grouptype>
<description>
<short></short>
<long></long>
</descrption>
</group>

Here's my code:
SELECT 1 as Tag,
NULL as Parent,
@p_school_descas [sourceid!1!source!element],
@p_term_code as [sourceid!1!id!element],
NULLas [grouptype!1!scheme!element],
NULLas [grouptype!1!typevalue!element],
NULLas [description!1!short!element],
NULLas [description!1!long!element]
FROM course_main AS sourceid
where sourceid.course_id = @p_course
UNION
SELECT 1 as Tag,
NULL as Parent,
NULL,
NULL,
@p_destinationas [grouptype!2!scheme!element],
'Term' as [grouptype!2!typevalue!element],
NULL,
NULL
FROM course_main AS grouptype
where grouptype.course_id = @p_course
UNION
SELECT 1 as Tag,
NULL as Parent,
NULL,
NULL,
NULL,
NULL,
@p_term_codeas [description!2!short!element],
@p_term_descriptionas [description!2!long!element]
FROM course_main AS grouptype
where grouptype.course_id = @p_course
FOR XML EXPLICIT

I'm receiving the foollowing error:Server: Msg 6812, Level 16, State 1, Line 14
XML tag ID 1 that was originally declared as 'sourceid' is being redeclared as 'grouptype'.

Is there anyway to have two different child notes off of the same parent node?

Thanks in advance!

View 1 Replies View Related

Unable To Custom Format My XML With For XML Explicit

Apr 16, 2008

Hi,
Is it possible to format any kind of XML file with the FOR XML EXPLICIT mode in SQL Server 2005? I am asking because I am trying to format my file in a way that I could get 2 or 3 elements on my parent or child level and put some attributes (icon path for example) in these 2nd element or 3rd element. I am unable to format it that way. Let me show you the way that I would like to have my XML file formated :

<?xml version="1.0" encoding="UTF-8" ?>
<rows>
<row id="14" sort="parent">
<cell icon="../../images/TreeGrid/folder.gif">Operations</cell>
<row id="14.13" sort=”child”>
<cell icon="../../images/TreeGrid/Red.gif">% SP</cell>
<row id="14.13.1" sort=”sub-child”>
<cell icon="../../images/TreeGrid/Red.gif">% SP Sub</cell>


I want to have all my parent, children, sub-children to have these attribut but I am having difficulty putting one in the “Cell” tags. And I really think that my problem resides in the specifying of my column and their directives but I do not know how to fix it. See my icon path is commented here. I have to put the [row!2!cell!xmltext], but it is not working.

Here is the way that I am building my Select query.

SELECT
1 as tag,
NULL as parent,
NULL AS 'rows!1!', ----Root rows tag
ID_metric as [row!2!id],
Description_english as [row!2!cell!Element],
----Icon as [row!2!cell!xmltext],
Sort as [row!2!sort],
ID_metric as [row!3!id],
Description_english as [row!3!cell!Element],
--Icon as [row!3!cell!xmltext],
sort as [row!3!sort],
ID_metric as [row!4!id],
Description_english as [row!4!cell!Element],
--Icon as [row!4!cell!xmltext],
sort as [row!4!sort],
ID_metric as [row!5!id],
Description_english as [row!5!cell!Element],
--Icon as [row!5!cell!xmltext],
sort as [row!5!sort],
FROM #buildData
WHERE HLevel = 0
UNION ALL
SELECT
2 as tag,
1 as parent,
NULL AS 'rows!1!',
ID_metric as [row!2!id],
Description_english as [row!2!cell!Element],
--Icon as [row!2!cell!xmltext],
sort as [row!2!sort],
ID_metric as [row!3!id],
Description_english as [row!3!cell!Element],
--Icon as [row!3!cell!xmltext],
sort as [row!3!sort],
ID_metric as [row!4!id],
Description_english as [row!4!cell!Element],
--Icon as [row!4!cell!xmltext],
sort as [row!4!sort],
ID_metric as [row!5!id],
Description_english as [row!5!cell!Element],
--Icon as [row!5!cell!xmltext],
sort as [row!5!sort],
FROM #buildData
WHERE HLevel = 1
UNION ALL
SELECT
3 as tag,
2 as parent,
NULL AS 'rows!1!',
ID_metric as [row!2!id],
Description_english as [row!2!cell!Element],
--Icon as [row!2!cell!xmltext],
sort as [row!2!sort],
ID_metric as [row!3!id],
Description_english as [row!3!cell!Element],
--Icon as [row!3!cell!xmltext],
sort as [row!3!sort],
ID_metric as [row!4!id],
Description_english as [row!4!cell!Element],
--Icon as [row!4!cell!xmltext],
sort as [row!4!sort],
ID_metric as [row!5!id],
Description_english as [row!5!cell!Element],
--Icon as [row!5!cell!xmltext],
sort as [row!5!sort],
FROM #buildData
WHERE HLevel = 2
UNION ALL
SELECT
4 as tag,
3 as parent,
NULL AS 'rows!1!',
ID_metric as [row!2!id],
Description_english as [row!2!cell!Element],
--Icon as [row!2!cell!xmltext],
sort as [row!2!sort],
ID_metric as [row!3!id],
Description_english as [row!3!cell!Element],
--Icon as [row!3!cell!xmltext],
sort as [row!3!sort],
ID_metric as [row!4!id],
Description_english as [row!4!cell!Element],
--Icon as [row!4!cell!xmltext],
sort as [row!4!sort],
ID_metric as [row!5!id],
Description_english as [row!5!cell!Element],
--Icon as [row!5!cell!xml],
sort as [row!5!sort],
FROM #buildData
WHERE HLevel = 3
ORDER BY [row!2!sort], [row!3!sort], [row!4!sort], [row!5!sort]
for XML explicit

My actual XML Result is this :

<rows>
<row id="14" sort="parent">
<cell>% SP</cell>
<row id="14.13" sort="child">
<cell>% SP </cell>
<row id="14.13.1" sort="child">
<cell>% SP cild </cell>

Is it possible to customized anything with For XML Explicit?
Anybody that can help my with that or indicate me where I am doing wrong? Thanks a lot.

View 11 Replies View Related

Error Message: Cannot Insert Explicit Value

Oct 25, 2006

Hello Everyone,

I am trying to insert a new record into a sql table and I get the following error message:

Msg 544, Level 16, State 1, Line 1
Cannot insert explicit value for identity column in table 'tbl_MLS_ReportCriteria' when IDENTITY_INSERT is set to OFF.


Here is the code:


USE MLS
INSERT INTO dbo.tbl_MLS_ReportCriteria (CriteriaID, Name, DisplayName, DetailedInstructions, TypeID, Source, DefaultValue, ValueField, DescriptionField, IncludeAllOption)
VALUES ('65', 'Summary3', 'Tertiary Summarize By', NULL, '2', 'SelectOptions', 'Company', NULL, NULL, '0')


What do I need to change and or look for?

TIA

Kurt

View 9 Replies View Related

Difference Between Explicit Inner Join And Implicit

Mar 31, 2008

Is there any difference between explicit inner join and implicitinner joinExample of an explicit inner join:SELECT *FROM employeeINNER JOIN departmentON employee.DepartmentID = department.DepartmentIDExample of an implicit inner join:SELECT *FROM employee, departmentWHERE employee.DepartmentID = department.DepartmentID

View 11 Replies View Related

Public Role And Explicit Rights

Sep 19, 2005

I gave a developer rights to the Public role on a SQL Server 2000 database.  The Public role only has explicitly set select rights to the system tables and one user table.  There are no other explicit rights set.  The developer was able to open a table that had no rights set in enterprise manager and change data.  Is this possible?

View 1 Replies View Related

Executing Statements W/o Explicit Transaction

May 30, 2008

Hi

What is SQL Server 2005 default behavior with statement like this:


SELECT * FROM dbo.Products

Will it take any shared locks on Products table? Is it different than:


BEGIN TRAN



SELECT * FROM dbo.Products WITH NOLOCK

COMMIT



TIA

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved