I have an smallint field which can have maximum of 6000 value.
Everytime I insert record I want to insert the next available number but not the max(field1) + 1.
Because I might be deleting some records so there would be some unused numbers between 1 - 6000 which were not allocated yet.
Is...
I opened a table using static cursor and it was failing to pick at 600000 record. If i used query to get 599999 records it was working but as soon as I increase it by one more, it failed. With 600000 record query I used dynamic cursor it started working.
Can anybody help me to know the reason?
isql -S . -U sa -P -i c:\abc.sql -b
if errorlevel 0 goto success
echo 'command failed'
goto end
:success
echo 'command worked
:end
This is always going to success though command fails sometimes.
This is my abc.sql
use master
-- database name
set @dbname=N'xyz'
if not exists(select *...
Thru my program it is storing –1.#QNAN in float data type field. I want to restrict Sql Server to store this value and if program is giving this as input then it store 0 in place of it. Is there any way to give formula or trigger something to check it?
There are multiple isql commands in a batch file. Can Sql script returns some value to first isql command? So rest of isql commands execution depends on the output of first isql command. Like true or false.
Can I make asynchronous call from extended stored procedure or from stored procedure from within Sql server and get back callback notification when process gets finished.
Is there any way that Sql Server does not create execution plan for some sql queries which I am sure that I am not going to repeat them. Same way for Stored procedures, it should not keep in memory.
Is there any default function thru which I can see windows system directory?
Actually I know that to execute system stored procedure it should be present either in MSsql folder or in windows system folder.
While I run sql scripts from dos prompt I tell the path to copy system stored procedure...
whole idea of giving this code is there I want to use in exec command inserted whereas when I use this way it says inserted is not object
CREATE TRIGGER tr1 ON [dbo].[Table1]
FOR INSERT
AS
declare @temp nvarchar(175)
declare @tbl nvarchar(15)
select @tbl ='Emp'
declare @rno int...
CREATE procedure xyz
@a int,
@b int out,
@c int out,
as
Declare @dbName nvarchar(35)
Declare @SqlStmt nvarchar(255)
Declare @RecNum int
SELECT DatabaseName,RecordNumber FROM Db1.dbo.Table1
DECLARE Cursor_1 CURSOR FOR
OPEN Cursor_1
FETCH NEXT FROM...
If Atl Com dll sends disconnected recordset to 3 clients. If A perform change on 1 record and marshalled the changed record to Com dll to update. How can B get change on that record. We don't want to send him back again all the recordsets. We just want to change the changed record only
If Atl Com dll sends disconnected recordset to 3 clients. If A perform change on 1 record and marshalled the changed record to Com dll to update. How can B get change on that record. We don't want to send him back again all the recordsets. We just want to change the changed record only.
create Procedure DropDatabase
@a int = 0
as
Declare @SqlStmt nvarchar(125)
declare @dbName nvarchar(25)
if @a>0
begin
select @dbName = DatabaseName from xx.dbo.xyz where RecId = @a
if @dbName is not NULL
begin
set @sqlStmt = 'Use Master;Drop Database '+ @dbName
exec sp_executeSql...
Can Createdatabase be part of BeginTrans in ADo and if while importing records from other database fails it should not createdatabase also.
I tried it seperately also if import fails then it should deletedatabase so sometimes it removes and sometimes it says it is in use so it fails.
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.